public void addDiscoveryAgent(DiscoveryAgent agent) { agents.add(agent); agent.setDiscoveryListener(this); for (URI uri : registered.values()) { try { agent.registerService(uri); } catch (IOException e) { } } }
public void reportFailed(URI serviceUri) throws IOException { registered.remove(serviceUri.toString()); for (DiscoveryAgent agent : agents) { agent.reportFailed(serviceUri); } }
@Override public void unregisterService(final URI serviceUri) throws IOException { registered.remove(serviceUri.toString()); for (final DiscoveryAgent agent : agents) { agent.unregisterService(serviceUri); } }
discovery.setDiscoveryListener(clusterHandler);
@Override public void registerService(final URI serviceUri) throws IOException { registered.put(serviceUri.toString(), serviceUri); for (final DiscoveryAgent agent : agents) { agent.registerService(serviceUri); } }
public void registerService(URI serviceUri) throws IOException { registered.put(serviceUri.toString(), serviceUri); for (DiscoveryAgent agent : agents) { agent.registerService(serviceUri); } }
public void addDiscoveryAgent(final DiscoveryAgent agent) { agents.add(agent); agent.setDiscoveryListener(this); for (final URI uri : registered.values()) { try { agent.registerService(uri); } catch (Exception e) { //Ignore } } }
try { uri = new URI(uriString); agent.registerService(uri); } catch (Exception e) { log.error("Cannot register service '" + getName() + "' with DiscoveryAgent.", e);
public void unregisterService(URI serviceUri) throws IOException { registered.remove(serviceUri.toString()); for (DiscoveryAgent agent : agents) { agent.unregisterService(serviceUri); } }
@Override public void reportFailed(final URI serviceUri) throws IOException { registered.remove(serviceUri.toString()); for (final DiscoveryAgent agent : agents) { agent.reportFailed(serviceUri); } }
try { this.serviceUri = new URI(uriString); agent.registerService(this.serviceUri); } catch (Exception e) { log.error("Cannot register service '" + this.getName() + "' with DiscoveryAgent.", e);
public void stop() throws ServiceException { synchronized (this) { DiscoveryAgent agent = SystemInstance.get().getComponent(DiscoveryAgent.class); if (agent != null && discoveryUriFormat != null && uri != null) { try { agent.unregisterService(uri); } catch (IOException e) { log.error("Cannot unregister service '" + getName() + "' with DiscoveryAgent.", e); } } next.stop(); if (socketListener != null) { socketListener.stop(); socketListener = null; } } }
@Override public void stop() throws ServiceException { synchronized (this) { final DiscoveryAgent agent = SystemInstance.get().getComponent(DiscoveryAgent.class); if (agent != null && this.discoveryUriFormat != null && this.serviceUri != null) { try { agent.unregisterService(this.serviceUri); } catch (IOException e) { log.error("Cannot unregister service '" + this.getName() + "' with DiscoveryAgent.", e); } } this.next.stop(); if (this.socketListener != null) { this.socketListener.stop(); this.socketListener = null; } } }