@Override public void unregisterService(final URI serviceUri) throws IOException { registered.remove(serviceUri.toString()); for (final DiscoveryAgent agent : agents) { agent.unregisterService(serviceUri); } }
@Managed public String[] getAgents() { final List<String> list = new ArrayList<String>(); for (final DiscoveryAgent agent : DiscoveryRegistry.this.agents) { list.add(agent.getClass().getName()); } return list.toArray(new String[list.size()]); }
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 } } }