@Test public void testListenerCalledWhenAddNode() throws Exception { AddTrigger<String> trigger = new AddTrigger<>(FOO); _nodeDiscovery.addListener(trigger); createNode(FOO); assertTrue(trigger.firedWithin(10, TimeUnit.SECONDS)); }
public void addListener(NodeListener<T> listener) { _listeners.add(listener); }
NodeDiscovery implements Closeable { public void addListener(NodeListener<T> listener) { _listeners.add(listener); } }
NodeDiscovery implements Closeable { public void addListener(NodeListener<T> listener) { _listeners.add(listener); } NodeDiscovery(CuratorFramework curator, String nodePath, NodeDataParser<T> parser); }
NodeDiscovery implements Closeable { public void addListener(NodeListener<T> listener) { _listeners.add(listener); } NodeDiscovery(CuratorFramework curator, String nodePath, NodeDataParser<T> parser); void start(); Map<String, T> getNodes(); boolean contains(T node); void addListener(NodeListener<T> listener); void removeListener(NodeListener<T> listener); @Override synchronized void close(); }
NodeDiscovery implements Closeable { public void addListener(NodeListener<T> listener) { _listeners.add(listener); } NodeDiscovery(CuratorFramework curator, String nodePath, NodeDataParser<T> parser); void start(); Map<String, T> getNodes(); boolean contains(T node); void addListener(NodeListener<T> listener); void removeListener(NodeListener<T> listener); @Override synchronized void close();  }