src/main/java/net/batchik/crdt/zookeeper/ZKServiceDiscovery.java
/**
     * Registers a new node for the given service
     * @param address the address for the new instance
     * @param port the port of the new instance
     * @throws Exception
     */
Registers a new node for the given service
@param address the address for the new instance
@param port the port of the new instance
@throws Exception
Registers a new node for the given service @param address the address for the new instance @param port the port of the new instance @throws Exception
public void register(InetAddress address, int port) throws Exception {
        final ServiceInstance<String> thisInstance = ServiceInstance.<String>builder()
                .name(serviceName)
                .port(port)
                .address(address.getHostAddress())
                .uriSpec(new UriSpec("{scheme}://{address}:{port}"))
                .build();
        serviceDiscovery.registerService(thisInstance);
        Runtime.getRuntime().addShutdownHook(new Thread() {
            public void run() {
                try {
                    serviceDiscovery.unregisterService(thisInstance);
                } catch (Exception e) { }
            }
        });
    }
public void register ( InetAddress address , int port ) throws Exception { final ServiceInstance < String > thisInstance = ServiceInstance . < String > builder ( ) . name ( serviceName ) . port ( port ) . address ( address . getHostAddress ( ) ) . uriSpec ( new UriSpec ( "{scheme}://{address}:{port}" ) ) . build ( ) ; serviceDiscovery . registerService ( thisInstance ) ; Runtime . getRuntime ( ) . addShutdownHook ( new Thread ( ) { public void run ( ) { try { serviceDiscovery . unregisterService ( thisInstance ) ; } catch ( Exception e ) { } } } ) ; }
Registers a new node for the given service
 @param address the address for the new instance
 @param port the port of the new instance
 @throws Exception
Registers a new node for the given service @param address the address for the new instance @param port the port of the new instance @throws Exception