Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove EventListener implementation in DubboBootstrap #7638

Merged
merged 1 commit into from
Apr 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@
import org.apache.dubbo.config.metadata.ConfigurableMetadataServiceExporter;
import org.apache.dubbo.config.utils.ConfigValidationUtils;
import org.apache.dubbo.config.utils.ReferenceConfigCache;
import org.apache.dubbo.event.EventDispatcher;
import org.apache.dubbo.event.EventListener;
import org.apache.dubbo.event.GenericEventListener;
import org.apache.dubbo.metadata.MetadataService;
import org.apache.dubbo.metadata.MetadataServiceExporter;
import org.apache.dubbo.metadata.WritableMetadataService;
Expand Down Expand Up @@ -123,7 +120,7 @@
*
* @since 2.7.5
*/
public class DubboBootstrap extends GenericEventListener {
public class DubboBootstrap {

public static final String DEFAULT_REGISTRY_ID = "REGISTRY#DEFAULT";

Expand Down Expand Up @@ -153,8 +150,6 @@ public class DubboBootstrap extends GenericEventListener {

private final ExecutorService executorService = newSingleThreadExecutor();

private final EventDispatcher eventDispatcher = EventDispatcher.getDefaultExtension();

private final ExecutorRepository executorRepository = getExtensionLoader(ExecutorRepository.class).getDefaultExtension();

private final ConfigManager configManager;
Expand Down Expand Up @@ -531,8 +526,6 @@ public void initialize() {

initMetadataService();

initEventListener();

if (logger.isInfoEnabled()) {
logger.info(NAME + " has been initialized!");
}
Expand Down Expand Up @@ -867,14 +860,6 @@ private void initMetadataService() {
this.metadataServiceExporter = new ConfigurableMetadataServiceExporter(metadataService);
}

/**
* Initialize {@link EventListener}
*/
private void initEventListener() {
// Add current instance into listeners
addEventListener(this);
}

/**
* Start the bootstrap
*/
Expand Down Expand Up @@ -1047,17 +1032,6 @@ private DynamicConfiguration prepareEnvironment(ConfigCenterConfig configCenter)
return null;
}

/**
* Add an instance of {@link EventListener}
*
* @param listener {@link EventListener}
* @return {@link DubboBootstrap}
*/
public DubboBootstrap addEventListener(EventListener<?> listener) {
eventDispatcher.addEventListener(listener);
return this;
}

/**
* export {@link MetadataService}
*/
Expand Down