@Test public void getInstance() { ZookeeperRegisterServiceImpl service1 = ZookeeperRegisterServiceImpl.getInstance(); Assertions.assertEquals(service1, service); }
static ZookeeperRegisterServiceImpl getInstance() { if (null == instance) { synchronized (ZookeeperRegisterServiceImpl.class) { if (null == instance) { instance = new ZookeeperRegisterServiceImpl(); } } } return instance; }
ZookeeperRegisterServiceImpl implements RegistryService<IZkChildListener> { static ZookeeperRegisterServiceImpl getInstance() { if (null == instance) { synchronized (ZookeeperRegisterServiceImpl.class) { if (null == instance) { instance = new ZookeeperRegisterServiceImpl(); } } } return instance; } }
ZookeeperRegisterServiceImpl implements RegistryService<IZkChildListener> { static ZookeeperRegisterServiceImpl getInstance() { if (null == instance) { synchronized (ZookeeperRegisterServiceImpl.class) { if (null == instance) { instance = new ZookeeperRegisterServiceImpl(); } } } return instance; } private  ZookeeperRegisterServiceImpl(); }
ZookeeperRegisterServiceImpl implements RegistryService<IZkChildListener> { static ZookeeperRegisterServiceImpl getInstance() { if (null == instance) { synchronized (ZookeeperRegisterServiceImpl.class) { if (null == instance) { instance = new ZookeeperRegisterServiceImpl(); } } } return instance; } private  ZookeeperRegisterServiceImpl(); @Override void register(InetSocketAddress address); @Override void unregister(InetSocketAddress address); @Override void subscribe(String cluster, IZkChildListener listener); @Override void unsubscribe(String cluster, IZkChildListener listener); @Override List<InetSocketAddress> lookup(String key); @Override void close(); }
ZookeeperRegisterServiceImpl implements RegistryService<IZkChildListener> { static ZookeeperRegisterServiceImpl getInstance() { if (null == instance) { synchronized (ZookeeperRegisterServiceImpl.class) { if (null == instance) { instance = new ZookeeperRegisterServiceImpl(); } } } return instance; } private  ZookeeperRegisterServiceImpl(); @Override void register(InetSocketAddress address); @Override void unregister(InetSocketAddress address); @Override void subscribe(String cluster, IZkChildListener listener); @Override void unsubscribe(String cluster, IZkChildListener listener); @Override List<InetSocketAddress> lookup(String key); @Override void close();  }