@Test public void registerServiceChangeListener() { final Map<String, DefaultServiceChangeListener> registerServices = Maps.newHashMap(); final String serviceId = Services.newServiceId(); registerServices.put("framework.soa.v1.registryservice", new DefaultServiceChangeListener()); registerServices.put("framework.soa.testservice.v2.testservice", new DefaultServiceChangeListener()); registerServices.put("framework.soa.test.v1.testportal", new DefaultServiceChangeListener()); registerServices.put(serviceId, new DefaultServiceChangeListener()); for (final Map.Entry<String, DefaultServiceChangeListener> entry : registerServices.entrySet()) { final DiscoveryConfig discoveryConfig = new DiscoveryConfig(entry.getKey()); _discoveryClientImpl.registerServiceChangeListener(discoveryConfig, entry.getValue()); } for (final Map.Entry<String, DefaultServiceChangeListener> entry : registerServices.entrySet()) { final List<ServiceChangeEvent> serviceChangeEvents = entry.getValue().getServiceChangeEvents(); Assert.assertEquals(0, serviceChangeEvents.size()); } }
@Override public void registerServiceChangeListener(final DiscoveryConfig discoveryConfig, final ServiceChangeListener listener) { DiscoveryConfigChecker.DEFAULT.check(discoveryConfig, "discoveryConfig"); NullArgumentChecker.DEFAULT.check(listener, "listener"); serviceRepository.registerServiceChangeListener(discoveryConfig, listener); }
DiscoveryClientImpl implements DiscoveryClient { @Override public void registerServiceChangeListener(final DiscoveryConfig discoveryConfig, final ServiceChangeListener listener) { DiscoveryConfigChecker.DEFAULT.check(discoveryConfig, "discoveryConfig"); NullArgumentChecker.DEFAULT.check(listener, "listener"); serviceRepository.registerServiceChangeListener(discoveryConfig, listener); } }
DiscoveryClientImpl implements DiscoveryClient { @Override public void registerServiceChangeListener(final DiscoveryConfig discoveryConfig, final ServiceChangeListener listener) { DiscoveryConfigChecker.DEFAULT.check(discoveryConfig, "discoveryConfig"); NullArgumentChecker.DEFAULT.check(listener, "listener"); serviceRepository.registerServiceChangeListener(discoveryConfig, listener); } DiscoveryClientImpl(final String clientId, final ArtemisClientManagerConfig managerConfig); }
DiscoveryClientImpl implements DiscoveryClient { @Override public void registerServiceChangeListener(final DiscoveryConfig discoveryConfig, final ServiceChangeListener listener) { DiscoveryConfigChecker.DEFAULT.check(discoveryConfig, "discoveryConfig"); NullArgumentChecker.DEFAULT.check(listener, "listener"); serviceRepository.registerServiceChangeListener(discoveryConfig, listener); } DiscoveryClientImpl(final String clientId, final ArtemisClientManagerConfig managerConfig); @Override Service getService(final DiscoveryConfig discoveryConfig); @Override void registerServiceChangeListener(final DiscoveryConfig discoveryConfig, final ServiceChangeListener listener); }
DiscoveryClientImpl implements DiscoveryClient { @Override public void registerServiceChangeListener(final DiscoveryConfig discoveryConfig, final ServiceChangeListener listener) { DiscoveryConfigChecker.DEFAULT.check(discoveryConfig, "discoveryConfig"); NullArgumentChecker.DEFAULT.check(listener, "listener"); serviceRepository.registerServiceChangeListener(discoveryConfig, listener); } DiscoveryClientImpl(final String clientId, final ArtemisClientManagerConfig managerConfig); @Override Service getService(final DiscoveryConfig discoveryConfig); @Override void registerServiceChangeListener(final DiscoveryConfig discoveryConfig, final ServiceChangeListener listener);  }