@Test public void testRegisterServiceChangeListener() { final DiscoveryConfig discoveryConfig = Services.newDiscoverConfig(); _serviceRepository.registerServiceChangeListener(discoveryConfig, new DefaultServiceChangeListener()); Assert.assertTrue(_serviceRepository.containsService(discoveryConfig.getServiceId())); }
public void registerServiceChangeListener(final DiscoveryConfig discoveryConfig, final ServiceChangeListener listener) { if ((discoveryConfig == null) || (listener == null)) { return; } final String serviceId = StringValues.toLowerCase(discoveryConfig.getServiceId()); if (StringValues.isNullOrWhitespace(serviceId)) { return; } if (!containsService(serviceId)) { registerService(discoveryConfig); } services.get(serviceId).addListener(listener); }
ServiceRepository { public void registerServiceChangeListener(final DiscoveryConfig discoveryConfig, final ServiceChangeListener listener) { if ((discoveryConfig == null) || (listener == null)) { return; } final String serviceId = StringValues.toLowerCase(discoveryConfig.getServiceId()); if (StringValues.isNullOrWhitespace(serviceId)) { return; } if (!containsService(serviceId)) { registerService(discoveryConfig); } services.get(serviceId).addListener(listener); } }
ServiceRepository { public void registerServiceChangeListener(final DiscoveryConfig discoveryConfig, final ServiceChangeListener listener) { if ((discoveryConfig == null) || (listener == null)) { return; } final String serviceId = StringValues.toLowerCase(discoveryConfig.getServiceId()); if (StringValues.isNullOrWhitespace(serviceId)) { return; } if (!containsService(serviceId)) { registerService(discoveryConfig); } services.get(serviceId).addListener(listener); } ServiceRepository(final ArtemisClientConfig config); protected  ServiceRepository(final ArtemisClientConfig config, ServiceDiscovery serviceDiscovery); }
ServiceRepository { public void registerServiceChangeListener(final DiscoveryConfig discoveryConfig, final ServiceChangeListener listener) { if ((discoveryConfig == null) || (listener == null)) { return; } final String serviceId = StringValues.toLowerCase(discoveryConfig.getServiceId()); if (StringValues.isNullOrWhitespace(serviceId)) { return; } if (!containsService(serviceId)) { registerService(discoveryConfig); } services.get(serviceId).addListener(listener); } ServiceRepository(final ArtemisClientConfig config); protected  ServiceRepository(final ArtemisClientConfig config, ServiceDiscovery serviceDiscovery); boolean containsService(final String serviceId); List<DiscoveryConfig> getDiscoveryConfigs(); DiscoveryConfig getDiscoveryConfig(final String serviceId); List<ServiceContext> getServices(); Service getService(final DiscoveryConfig discoveryConfig); void registerServiceChangeListener(final DiscoveryConfig discoveryConfig, final ServiceChangeListener listener); }
ServiceRepository { public void registerServiceChangeListener(final DiscoveryConfig discoveryConfig, final ServiceChangeListener listener) { if ((discoveryConfig == null) || (listener == null)) { return; } final String serviceId = StringValues.toLowerCase(discoveryConfig.getServiceId()); if (StringValues.isNullOrWhitespace(serviceId)) { return; } if (!containsService(serviceId)) { registerService(discoveryConfig); } services.get(serviceId).addListener(listener); } ServiceRepository(final ArtemisClientConfig config); protected  ServiceRepository(final ArtemisClientConfig config, ServiceDiscovery serviceDiscovery); boolean containsService(final String serviceId); List<DiscoveryConfig> getDiscoveryConfigs(); DiscoveryConfig getDiscoveryConfig(final String serviceId); List<ServiceContext> getServices(); Service getService(final DiscoveryConfig discoveryConfig); void registerServiceChangeListener(final DiscoveryConfig discoveryConfig, final ServiceChangeListener listener);  }