This is an automated email from the ASF dual-hosted git repository.

sunnianjun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 492822b168b Add EventSubscriber (#31222)
492822b168b is described below

commit 492822b168bd9d7cff034641c042a71ce347387e
Author: Liang Zhang <[email protected]>
AuthorDate: Mon May 13 23:30:54 2024 +0800

    Add EventSubscriber (#31222)
---
 .../infra/util/eventbus/EventBusContext.java       |  8 +++----
 .../infra/util/eventbus/EventSubscriber.java}      | 27 ++++------------------
 .../infra/util/eventbus/EventBusContextTest.java   |  4 ++--
 ...nerFixture.java => EventSubscriberFixture.java} |  3 ++-
 .../mode/subsciber/RuleItemChangedSubscriber.java  |  3 ++-
 ...ShardingSphereSchemaDataRegistrySubscriber.java |  3 ++-
 .../subscriber/ClusterProcessSubscriber.java       |  3 ++-
 .../subscriber/ProcessListChangedSubscriber.java   |  3 ++-
 .../subscriber/ClusterStatusSubscriber.java        |  3 ++-
 .../subscriber/ComputeNodeStatusSubscriber.java    |  3 ++-
 .../QualifiedDataSourceStatusSubscriber.java       |  3 ++-
 .../subscriber/CacheEvictedSubscriber.java         |  3 ++-
 .../subscriber/ConfigurationChangedSubscriber.java |  3 ++-
 .../ContextManagerSubscriberRegister.java          |  5 ++--
 .../subscriber/DatabaseChangedSubscriber.java      |  3 ++-
 .../ResourceMetaDataChangedSubscriber.java         |  3 ++-
 .../subscriber/StateChangedSubscriber.java         |  3 ++-
 .../subscriber/StandaloneProcessSubscriber.java    |  3 ++-
 .../admin/executor/ShowProcessListExecutor.java    |  3 ++-
 19 files changed, 44 insertions(+), 45 deletions(-)

diff --git 
a/infra/util/src/main/java/org/apache/shardingsphere/infra/util/eventbus/EventBusContext.java
 
b/infra/util/src/main/java/org/apache/shardingsphere/infra/util/eventbus/EventBusContext.java
index 48293435831..4e66252f9a4 100644
--- 
a/infra/util/src/main/java/org/apache/shardingsphere/infra/util/eventbus/EventBusContext.java
+++ 
b/infra/util/src/main/java/org/apache/shardingsphere/infra/util/eventbus/EventBusContext.java
@@ -33,12 +33,12 @@ public final class EventBusContext {
     }
     
     /**
-     * Register object.
+     * Register event subscriber.
      * 
-     * @param object object
+     * @param subscriber event subscriber
      */
-    public void register(final Object object) {
-        eventBus.register(object);
+    public void register(final EventSubscriber subscriber) {
+        eventBus.register(subscriber);
     }
     
     /**
diff --git 
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/eventbus/fixture/EventListenerFixture.java
 
b/infra/util/src/main/java/org/apache/shardingsphere/infra/util/eventbus/EventSubscriber.java
similarity index 62%
copy from 
infra/util/src/test/java/org/apache/shardingsphere/infra/util/eventbus/fixture/EventListenerFixture.java
copy to 
infra/util/src/main/java/org/apache/shardingsphere/infra/util/eventbus/EventSubscriber.java
index 76f04b6f50f..63b9b959854 100644
--- 
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/eventbus/fixture/EventListenerFixture.java
+++ 
b/infra/util/src/main/java/org/apache/shardingsphere/infra/util/eventbus/EventSubscriber.java
@@ -15,27 +15,10 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.infra.util.eventbus.fixture;
+package org.apache.shardingsphere.infra.util.eventbus;
 
-import com.google.common.eventbus.Subscribe;
-import lombok.Getter;
-
-import java.util.LinkedList;
-import java.util.List;
-
-@Getter
-public final class EventListenerFixture {
-    
-    private final List<String> events = new LinkedList<>();
-    
-    /**
-     * Listen.
-     * 
-     * @param event event
-     */
-    @SuppressWarnings("unused")
-    @Subscribe
-    public void listen(final String event) {
-        events.add(event);
-    }
+/**
+ * Event subscriber.
+ */
+public interface EventSubscriber {
 }
diff --git 
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/eventbus/EventBusContextTest.java
 
b/infra/util/src/test/java/org/apache/shardingsphere/infra/util/eventbus/EventBusContextTest.java
index 7ae43d6054e..899a3cead53 100644
--- 
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/eventbus/EventBusContextTest.java
+++ 
b/infra/util/src/test/java/org/apache/shardingsphere/infra/util/eventbus/EventBusContextTest.java
@@ -17,7 +17,7 @@
 
 package org.apache.shardingsphere.infra.util.eventbus;
 
-import 
org.apache.shardingsphere.infra.util.eventbus.fixture.EventListenerFixture;
+import 
org.apache.shardingsphere.infra.util.eventbus.fixture.EventSubscriberFixture;
 import org.junit.jupiter.api.Test;
 
 import static org.hamcrest.CoreMatchers.is;
@@ -28,7 +28,7 @@ class EventBusContextTest {
     @Test
     void assertEventBusContextTest() {
         EventBusContext eventBusContext = new EventBusContext();
-        EventListenerFixture listener = new EventListenerFixture();
+        EventSubscriberFixture listener = new EventSubscriberFixture();
         eventBusContext.register(listener);
         eventBusContext.post("foo_event");
         assertThat(listener.getEvents().size(), is(1));
diff --git 
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/eventbus/fixture/EventListenerFixture.java
 
b/infra/util/src/test/java/org/apache/shardingsphere/infra/util/eventbus/fixture/EventSubscriberFixture.java
similarity index 89%
rename from 
infra/util/src/test/java/org/apache/shardingsphere/infra/util/eventbus/fixture/EventListenerFixture.java
rename to 
infra/util/src/test/java/org/apache/shardingsphere/infra/util/eventbus/fixture/EventSubscriberFixture.java
index 76f04b6f50f..032a3e1879c 100644
--- 
a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/eventbus/fixture/EventListenerFixture.java
+++ 
b/infra/util/src/test/java/org/apache/shardingsphere/infra/util/eventbus/fixture/EventSubscriberFixture.java
@@ -19,12 +19,13 @@ package 
org.apache.shardingsphere.infra.util.eventbus.fixture;
 
 import com.google.common.eventbus.Subscribe;
 import lombok.Getter;
+import org.apache.shardingsphere.infra.util.eventbus.EventSubscriber;
 
 import java.util.LinkedList;
 import java.util.List;
 
 @Getter
-public final class EventListenerFixture {
+public final class EventSubscriberFixture implements EventSubscriber {
     
     private final List<String> events = new LinkedList<>();
     
diff --git 
a/mode/core/src/main/java/org/apache/shardingsphere/mode/subsciber/RuleItemChangedSubscriber.java
 
b/mode/core/src/main/java/org/apache/shardingsphere/mode/subsciber/RuleItemChangedSubscriber.java
index 28c02926d78..8c2cb2ad484 100644
--- 
a/mode/core/src/main/java/org/apache/shardingsphere/mode/subsciber/RuleItemChangedSubscriber.java
+++ 
b/mode/core/src/main/java/org/apache/shardingsphere/mode/subsciber/RuleItemChangedSubscriber.java
@@ -23,6 +23,7 @@ import 
org.apache.shardingsphere.infra.config.rule.RuleConfiguration;
 import 
org.apache.shardingsphere.infra.rule.event.rule.alter.AlterRuleItemEvent;
 import org.apache.shardingsphere.infra.rule.event.rule.drop.DropRuleItemEvent;
 import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader;
+import org.apache.shardingsphere.infra.util.eventbus.EventSubscriber;
 import org.apache.shardingsphere.mode.manager.ContextManager;
 import 
org.apache.shardingsphere.mode.spi.RuleItemConfigurationChangedProcessor;
 
@@ -30,7 +31,7 @@ import 
org.apache.shardingsphere.mode.spi.RuleItemConfigurationChangedProcessor;
  * Rule item changed subscriber.
  */
 @RequiredArgsConstructor
-public final class RuleItemChangedSubscriber {
+public final class RuleItemChangedSubscriber implements EventSubscriber {
     
     private final ContextManager contextManager;
     
diff --git 
a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/metadata/subscriber/ShardingSphereSchemaDataRegistrySubscriber.java
 
b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/metadata/subscriber/ShardingSphereSchemaDataRegistrySubscriber.java
index 6ec93b79cc9..8c738752d9c 100644
--- 
a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/metadata/subscriber/ShardingSphereSchemaDataRegistrySubscriber.java
+++ 
b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/metadata/subscriber/ShardingSphereSchemaDataRegistrySubscriber.java
@@ -19,6 +19,7 @@ package 
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.meta
 
 import com.google.common.eventbus.Subscribe;
 import org.apache.shardingsphere.infra.util.eventbus.EventBusContext;
+import org.apache.shardingsphere.infra.util.eventbus.EventSubscriber;
 import 
org.apache.shardingsphere.metadata.persist.data.ShardingSphereDataPersistService;
 import 
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.data.event.ShardingSphereSchemaDataAlteredEvent;
 import 
org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository;
@@ -26,7 +27,7 @@ import 
org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepositor
 /**
  * ShardingSphere schema data registry subscriber.
  */
-public final class ShardingSphereSchemaDataRegistrySubscriber {
+public final class ShardingSphereSchemaDataRegistrySubscriber implements 
EventSubscriber {
     
     private final ShardingSphereDataPersistService persistService;
     
diff --git 
a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/process/subscriber/ClusterProcessSubscriber.java
 
b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/process/subscriber/ClusterProcessSubscriber.java
index 6b23cd3d2cd..f6554b0b5fc 100644
--- 
a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/process/subscriber/ClusterProcessSubscriber.java
+++ 
b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/process/subscriber/ClusterProcessSubscriber.java
@@ -23,6 +23,7 @@ import 
org.apache.shardingsphere.infra.executor.sql.process.yaml.YamlProcessList
 import 
org.apache.shardingsphere.infra.executor.sql.process.yaml.swapper.YamlProcessListSwapper;
 import org.apache.shardingsphere.infra.instance.metadata.InstanceType;
 import org.apache.shardingsphere.infra.util.eventbus.EventBusContext;
+import org.apache.shardingsphere.infra.util.eventbus.EventSubscriber;
 import org.apache.shardingsphere.infra.util.yaml.YamlEngine;
 import org.apache.shardingsphere.metadata.persist.node.ComputeNode;
 import org.apache.shardingsphere.metadata.persist.node.ProcessNode;
@@ -41,7 +42,7 @@ import java.util.stream.Stream;
 /**
  * Cluster process subscriber.
  */
-public final class ClusterProcessSubscriber implements ProcessSubscriber {
+public final class ClusterProcessSubscriber implements ProcessSubscriber, 
EventSubscriber {
     
     private final PersistRepository repository;
     
diff --git 
a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/process/subscriber/ProcessListChangedSubscriber.java
 
b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/process/subscriber/ProcessListChangedSubscriber.java
index 2ea39e0655d..86172a33363 100644
--- 
a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/process/subscriber/ProcessListChangedSubscriber.java
+++ 
b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/process/subscriber/ProcessListChangedSubscriber.java
@@ -23,6 +23,7 @@ import 
org.apache.shardingsphere.infra.executor.sql.process.Process;
 import org.apache.shardingsphere.infra.executor.sql.process.ProcessRegistry;
 import 
org.apache.shardingsphere.infra.executor.sql.process.lock.ProcessOperationLockRegistry;
 import 
org.apache.shardingsphere.infra.executor.sql.process.yaml.swapper.YamlProcessListSwapper;
+import org.apache.shardingsphere.infra.util.eventbus.EventSubscriber;
 import org.apache.shardingsphere.infra.util.yaml.YamlEngine;
 import org.apache.shardingsphere.metadata.persist.node.ComputeNode;
 import org.apache.shardingsphere.metadata.persist.node.ProcessNode;
@@ -43,7 +44,7 @@ import java.util.Collection;
  */
 @SuppressWarnings("unused")
 @RequiredArgsConstructor
-public final class ProcessListChangedSubscriber {
+public final class ProcessListChangedSubscriber implements EventSubscriber {
     
     private final ContextManager contextManager;
     
diff --git 
a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/cluster/subscriber/ClusterStatusSubscriber.java
 
b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/cluster/subscriber/ClusterStatusSubscriber.java
index 2a0ea7d7765..12007181f1c 100644
--- 
a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/cluster/subscriber/ClusterStatusSubscriber.java
+++ 
b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/cluster/subscriber/ClusterStatusSubscriber.java
@@ -19,6 +19,7 @@ package 
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.stat
 
 import com.google.common.eventbus.Subscribe;
 import org.apache.shardingsphere.infra.util.eventbus.EventBusContext;
+import org.apache.shardingsphere.infra.util.eventbus.EventSubscriber;
 import org.apache.shardingsphere.metadata.persist.node.ComputeNode;
 import 
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.cluster.event.ClusterStatusChangedEvent;
 import 
org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository;
@@ -26,7 +27,7 @@ import 
org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepositor
 /**
  * Cluster status subscriber.
  */
-public final class ClusterStatusSubscriber {
+public final class ClusterStatusSubscriber implements EventSubscriber {
     
     private final ClusterPersistRepository repository;
     
diff --git 
a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/compute/subscriber/ComputeNodeStatusSubscriber.java
 
b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/compute/subscriber/ComputeNodeStatusSubscriber.java
index fdaee700c03..3b24717a67b 100644
--- 
a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/compute/subscriber/ComputeNodeStatusSubscriber.java
+++ 
b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/compute/subscriber/ComputeNodeStatusSubscriber.java
@@ -18,6 +18,7 @@
 package 
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.compute.subscriber;
 
 import com.google.common.eventbus.Subscribe;
+import org.apache.shardingsphere.infra.util.eventbus.EventSubscriber;
 import org.apache.shardingsphere.metadata.persist.node.ComputeNode;
 import org.apache.shardingsphere.mode.event.node.ComputeNodeStatusChangedEvent;
 import 
org.apache.shardingsphere.mode.manager.cluster.coordinator.RegistryCenter;
@@ -29,7 +30,7 @@ import java.util.Collections;
 /**
  * Compute node status subscriber.
  */
-public final class ComputeNodeStatusSubscriber {
+public final class ComputeNodeStatusSubscriber implements EventSubscriber {
     
     private final RegistryCenter registryCenter;
     
diff --git 
a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/storage/subscriber/QualifiedDataSourceStatusSubscriber.java
 
b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/storage/subscriber/QualifiedDataSourceStatusSubscriber.java
index 4ca615157c3..7893bf4d959 100644
--- 
a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/storage/subscriber/QualifiedDataSourceStatusSubscriber.java
+++ 
b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/storage/subscriber/QualifiedDataSourceStatusSubscriber.java
@@ -19,6 +19,7 @@ package 
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.stat
 
 import com.google.common.eventbus.Subscribe;
 import org.apache.shardingsphere.infra.util.eventbus.EventBusContext;
+import org.apache.shardingsphere.infra.util.eventbus.EventSubscriber;
 import 
org.apache.shardingsphere.mode.event.node.QualifiedDataSourceDeletedEvent;
 import 
org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository;
 import org.apache.shardingsphere.mode.storage.node.QualifiedDataSourceNode;
@@ -26,7 +27,7 @@ import 
org.apache.shardingsphere.mode.storage.node.QualifiedDataSourceNode;
 /**
  * Qualified data source status subscriber.
  */
-public final class QualifiedDataSourceStatusSubscriber {
+public final class QualifiedDataSourceStatusSubscriber implements 
EventSubscriber {
     
     private final ClusterPersistRepository repository;
     
diff --git 
a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/CacheEvictedSubscriber.java
 
b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/CacheEvictedSubscriber.java
index a8198960f40..0748a20df67 100644
--- 
a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/CacheEvictedSubscriber.java
+++ 
b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/CacheEvictedSubscriber.java
@@ -20,12 +20,13 @@ package 
org.apache.shardingsphere.mode.manager.cluster.coordinator.subscriber;
 import com.google.common.eventbus.Subscribe;
 import org.apache.shardingsphere.infra.rule.event.GovernanceEvent;
 import 
org.apache.shardingsphere.infra.spi.type.ordered.cache.OrderedServicesCache;
+import org.apache.shardingsphere.infra.util.eventbus.EventSubscriber;
 
 /**
  * Cache evicted subscriber.
  */
 @SuppressWarnings("unused")
-public final class CacheEvictedSubscriber {
+public final class CacheEvictedSubscriber implements EventSubscriber {
     
     /**
      * Callback of any {@link GovernanceEvent}.
diff --git 
a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/ConfigurationChangedSubscriber.java
 
b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/ConfigurationChangedSubscriber.java
index 181d8d4dee5..bbe45c2fead 100644
--- 
a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/ConfigurationChangedSubscriber.java
+++ 
b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/ConfigurationChangedSubscriber.java
@@ -19,6 +19,7 @@ package 
org.apache.shardingsphere.mode.manager.cluster.coordinator.subscriber;
 
 import com.google.common.eventbus.Subscribe;
 import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.infra.util.eventbus.EventSubscriber;
 import 
org.apache.shardingsphere.mode.event.config.AlterGlobalRuleConfigurationEvent;
 import org.apache.shardingsphere.mode.event.config.AlterPropertiesEvent;
 import 
org.apache.shardingsphere.mode.event.datasource.unit.AlterStorageUnitEvent;
@@ -31,7 +32,7 @@ import org.apache.shardingsphere.mode.manager.ContextManager;
  */
 @RequiredArgsConstructor
 @SuppressWarnings("unused")
-public final class ConfigurationChangedSubscriber {
+public final class ConfigurationChangedSubscriber implements EventSubscriber {
     
     private final ContextManager contextManager;
     
diff --git 
a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/ContextManagerSubscriberRegister.java
 
b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/ContextManagerSubscriberRegister.java
index 31468d81c72..cb3617516bf 100644
--- 
a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/ContextManagerSubscriberRegister.java
+++ 
b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/ContextManagerSubscriberRegister.java
@@ -18,6 +18,7 @@
 package org.apache.shardingsphere.mode.manager.cluster.coordinator.subscriber;
 
 import org.apache.shardingsphere.infra.util.eventbus.EventBusContext;
+import org.apache.shardingsphere.infra.util.eventbus.EventSubscriber;
 import org.apache.shardingsphere.mode.manager.ContextManager;
 import 
org.apache.shardingsphere.mode.manager.cluster.coordinator.RegistryCenter;
 import 
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.process.subscriber.ProcessListChangedSubscriber;
@@ -28,11 +29,11 @@ import java.util.Collection;
 /**
  * Context manager subscriber register.
  */
-public final class ContextManagerSubscriberRegister {
+public final class ContextManagerSubscriberRegister implements EventSubscriber 
{
     
     private final EventBusContext eventBusContext;
     
-    private final Collection<Object> subscribers;
+    private final Collection<EventSubscriber> subscribers;
     
     public ContextManagerSubscriberRegister(final RegistryCenter 
registryCenter, final ContextManager contextManager) {
         eventBusContext = 
contextManager.getInstanceContext().getEventBusContext();
diff --git 
a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/DatabaseChangedSubscriber.java
 
b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/DatabaseChangedSubscriber.java
index 56a958550b6..f6c0224d1fe 100644
--- 
a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/DatabaseChangedSubscriber.java
+++ 
b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/DatabaseChangedSubscriber.java
@@ -19,6 +19,7 @@ package 
org.apache.shardingsphere.mode.manager.cluster.coordinator.subscriber;
 
 import com.google.common.eventbus.Subscribe;
 import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.infra.util.eventbus.EventSubscriber;
 import org.apache.shardingsphere.mode.manager.ContextManager;
 import 
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.data.event.DatabaseDataAddedEvent;
 import 
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.data.event.DatabaseDataDeletedEvent;
@@ -33,7 +34,7 @@ import 
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.data.
  */
 @RequiredArgsConstructor
 @SuppressWarnings("unused")
-public final class DatabaseChangedSubscriber {
+public final class DatabaseChangedSubscriber implements EventSubscriber {
     
     private final ContextManager contextManager;
     
diff --git 
a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/ResourceMetaDataChangedSubscriber.java
 
b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/ResourceMetaDataChangedSubscriber.java
index 879e11f2cc3..05afc49a5ea 100644
--- 
a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/ResourceMetaDataChangedSubscriber.java
+++ 
b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/ResourceMetaDataChangedSubscriber.java
@@ -21,6 +21,7 @@ import com.google.common.eventbus.Subscribe;
 import lombok.RequiredArgsConstructor;
 import 
org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereTable;
 import 
org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereView;
+import org.apache.shardingsphere.infra.util.eventbus.EventSubscriber;
 import 
org.apache.shardingsphere.mode.event.schema.table.CreateOrAlterTableEvent;
 import org.apache.shardingsphere.mode.event.schema.table.DropTableEvent;
 import org.apache.shardingsphere.mode.event.schema.view.CreateOrAlterViewEvent;
@@ -38,7 +39,7 @@ import java.util.Map;
  */
 @RequiredArgsConstructor
 @SuppressWarnings("unused")
-public final class ResourceMetaDataChangedSubscriber {
+public final class ResourceMetaDataChangedSubscriber implements 
EventSubscriber {
     
     private final ContextManager contextManager;
     
diff --git 
a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/StateChangedSubscriber.java
 
b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/StateChangedSubscriber.java
index 6d9390b2c4a..c44a129bfb2 100644
--- 
a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/StateChangedSubscriber.java
+++ 
b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/StateChangedSubscriber.java
@@ -25,6 +25,7 @@ import 
org.apache.shardingsphere.infra.metadata.database.schema.QualifiedDataSou
 import 
org.apache.shardingsphere.infra.rule.attribute.datasource.StaticDataSourceRuleAttribute;
 import org.apache.shardingsphere.infra.state.datasource.DataSourceState;
 import org.apache.shardingsphere.infra.state.datasource.DataSourceStateManager;
+import org.apache.shardingsphere.infra.util.eventbus.EventSubscriber;
 import org.apache.shardingsphere.mode.manager.ContextManager;
 import 
org.apache.shardingsphere.mode.manager.cluster.coordinator.RegistryCenter;
 import 
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.status.cluster.event.ClusterLockDeletedEvent;
@@ -42,7 +43,7 @@ import 
org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.statu
  */
 @RequiredArgsConstructor
 @SuppressWarnings("unused")
-public final class StateChangedSubscriber {
+public final class StateChangedSubscriber implements EventSubscriber {
     
     private final ContextManager contextManager;
     
diff --git 
a/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/subscriber/StandaloneProcessSubscriber.java
 
b/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/subscriber/StandaloneProcessSubscriber.java
index 95081a3549f..74c694c4250 100644
--- 
a/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/subscriber/StandaloneProcessSubscriber.java
+++ 
b/mode/type/standalone/core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/subscriber/StandaloneProcessSubscriber.java
@@ -21,6 +21,7 @@ import com.google.common.eventbus.Subscribe;
 import org.apache.shardingsphere.infra.executor.sql.process.Process;
 import org.apache.shardingsphere.infra.executor.sql.process.ProcessRegistry;
 import org.apache.shardingsphere.infra.util.eventbus.EventBusContext;
+import org.apache.shardingsphere.infra.util.eventbus.EventSubscriber;
 import org.apache.shardingsphere.mode.process.ProcessSubscriber;
 import org.apache.shardingsphere.mode.process.event.KillProcessRequestEvent;
 import 
org.apache.shardingsphere.mode.process.event.ShowProcessListRequestEvent;
@@ -32,7 +33,7 @@ import java.sql.Statement;
 /**
  * Standalone process subscriber.
  */
-public final class StandaloneProcessSubscriber implements ProcessSubscriber {
+public final class StandaloneProcessSubscriber implements ProcessSubscriber, 
EventSubscriber {
     
     private final EventBusContext eventBusContext;
     
diff --git 
a/proxy/backend/type/mysql/src/main/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowProcessListExecutor.java
 
b/proxy/backend/type/mysql/src/main/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowProcessListExecutor.java
index 53edf23561f..cfe26930287 100644
--- 
a/proxy/backend/type/mysql/src/main/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowProcessListExecutor.java
+++ 
b/proxy/backend/type/mysql/src/main/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowProcessListExecutor.java
@@ -28,6 +28,7 @@ import 
org.apache.shardingsphere.infra.executor.sql.execute.result.query.type.me
 import org.apache.shardingsphere.infra.executor.sql.process.Process;
 import org.apache.shardingsphere.infra.merge.result.MergedResult;
 import 
org.apache.shardingsphere.infra.merge.result.impl.transparent.TransparentMergedResult;
+import org.apache.shardingsphere.infra.util.eventbus.EventSubscriber;
 import 
org.apache.shardingsphere.mode.process.event.ShowProcessListRequestEvent;
 import 
org.apache.shardingsphere.mode.process.event.ShowProcessListResponseEvent;
 import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
@@ -45,7 +46,7 @@ import java.util.stream.Collectors;
 /**
  * Show process list executor.
  */
-public final class ShowProcessListExecutor implements 
DatabaseAdminQueryExecutor {
+public final class ShowProcessListExecutor implements 
DatabaseAdminQueryExecutor, EventSubscriber {
     
     private final boolean showFullProcesslist;
     

Reply via email to