src/main/java/net/batchik/crdt/zookeeper/ZKServiceDiscovery.java
/**
             * Called when the cache has changed (instances added/deleted, etc.)
             */
Called when the cache has changed (instances added/deleted, etc.)
Called when the cache has changed ( instances added / deleted etc . )
@Override
            public void cacheChanged() {
                try {
                    for (ServiceInstance<String> instance : serviceDiscovery.queryForInstances(serviceName)) {
                        String address = instance.getAddress() + ":" + instance.getPort();
                        serviceListener.newPeer(address);
                    }
                } catch (Exception e) { }
            }
@ Override public void cacheChanged ( ) { try { for ( ServiceInstance < String > instance : serviceDiscovery . queryForInstances ( serviceName ) ) { String address = instance . getAddress ( ) + ":" + instance . getPort ( ) ; serviceListener . newPeer ( address ) ; } } catch ( Exception e ) { } }
Called when the cache has changed (instances added/deleted, etc.)
Called when the cache has changed ( instances added / deleted etc . )