Skip to content

Commit

Permalink
Polish apache#4093 : To add exported and unexported events for Servic…
Browse files Browse the repository at this point in the history
…eConfig
  • Loading branch information
mercyblitz committed May 20, 2019
1 parent 05c0b30 commit 952d943
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import org.apache.dubbo.config.annotation.Service;
import org.apache.dubbo.config.context.ConfigManager;
import org.apache.dubbo.config.event.ServiceConfigExportedEvent;
import org.apache.dubbo.config.event.ServiceConfigUnExportedEvent;
import org.apache.dubbo.config.event.ServiceConfigUnexportedEvent;
import org.apache.dubbo.config.invoker.DelegateProviderMetaDataInvoker;
import org.apache.dubbo.config.support.Parameter;
import org.apache.dubbo.metadata.integration.MetadataReportService;
Expand Down Expand Up @@ -434,7 +434,7 @@ public synchronized void unexport() {
unexported = true;

// dispatch a ServiceConfigUnExportedEvent since 2.7.2
dispatch(new ServiceConfigUnExportedEvent(this));
dispatch(new ServiceConfigUnexportedEvent(this));
}

@SuppressWarnings({"unchecked", "rawtypes"})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
*
* @since 2.7.2
*/
public class ServiceConfigUnExportedEvent extends Event {
public class ServiceConfigUnexportedEvent extends Event {

public ServiceConfigUnExportedEvent(ServiceConfig source) {
public ServiceConfigUnexportedEvent(ServiceConfig source) {
super(source);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.apache.dubbo.config.api.Greeting;
import org.apache.dubbo.config.context.ConfigManager;
import org.apache.dubbo.config.event.ServiceConfigExportedEvent;
import org.apache.dubbo.config.event.ServiceConfigUnExportedEvent;
import org.apache.dubbo.config.event.ServiceConfigUnexportedEvent;
import org.apache.dubbo.config.mock.MockProtocol2;
import org.apache.dubbo.config.mock.MockRegistryFactory2;
import org.apache.dubbo.config.mock.TestProxyFactory;
Expand Down Expand Up @@ -204,9 +204,9 @@ public void onEvent(ServiceConfigExportedEvent event) {

assertTrue(reference.compareAndSet(service, null));

eventDispatcher.addEventListener(new EventListener<ServiceConfigUnExportedEvent>() {
eventDispatcher.addEventListener(new EventListener<ServiceConfigUnexportedEvent>() {
@Override
public void onEvent(ServiceConfigUnExportedEvent event) {
public void onEvent(ServiceConfigUnexportedEvent event) {
reference.set(event.getServiceConfig());
}
});
Expand Down

0 comments on commit 952d943

Please sign in to comment.