@Test public void addInstanceListener() throws InterruptedException { final CountDownLatch destroyedLatch = new CountDownLatch(1); final CountDownLatch createdLatch = new CountDownLatch(1); final IMap<Integer, Integer> instance = getHazelcastClient().getMap("addInstanceListener"); InstanceListener listener = new InstanceListener() { public void instanceDestroyed(InstanceEvent event) { assertEquals(InstanceEventType.DESTROYED, event.getEventType()); assertEquals(instance, event.getInstance()); destroyedLatch.countDown(); } public void instanceCreated(InstanceEvent event) { assertEquals(InstanceEventType.CREATED, event.getEventType()); IMap<Integer, Integer> map = (IMap<Integer, Integer>) event.getInstance(); assertEquals(instance.getName(), map.getName()); createdLatch.countDown(); } }; getHazelcastClient().addInstanceListener(listener); instance.put(1, 1); assertEquals(1, instance.size()); assertTrue(createdLatch.await(10, TimeUnit.SECONDS)); instance.destroy(); assertTrue(destroyedLatch.await(10, TimeUnit.SECONDS)); getHazelcastClient().removeInstanceListener(listener); }
public void addInstanceListener(InstanceListener instanceListener) { clusterClientProxy.addInstanceListener(instanceListener); }
HazelcastClient implements HazelcastInstance { public void addInstanceListener(InstanceListener instanceListener) { clusterClientProxy.addInstanceListener(instanceListener); } }
HazelcastClient implements HazelcastInstance { public void addInstanceListener(InstanceListener instanceListener) { clusterClientProxy.addInstanceListener(instanceListener); } private  HazelcastClient(ClientConfig config); }
HazelcastClient implements HazelcastInstance { public void addInstanceListener(InstanceListener instanceListener) { clusterClientProxy.addInstanceListener(instanceListener); } private  HazelcastClient(ClientConfig config); InRunnable getInRunnable(); OutRunnable getOutRunnable(); static HazelcastClient newHazelcastClient(ClientConfig config); Config getConfig(); PartitionService getPartitionService(); ClientService getClientService(); LoggingService getLoggingService(); IMap<K, V> getMap(String name); Object getClientProxy(Object o); com.hazelcast.core.Transaction getTransaction(); ConnectionManager getConnectionManager(); void addInstanceListener(InstanceListener instanceListener); Cluster getCluster(); ExecutorService getExecutorService(); ExecutorService getExecutorService(String name); IdGenerator getIdGenerator(String name); AtomicNumber getAtomicNumber(String name); ICountDownLatch getCountDownLatch(String name); ISemaphore getSemaphore(String name); Collection<Instance> getInstances(); IList<E> getList(String name); ILock getLock(Object obj); MultiMap<K, V> getMultiMap(String name); String getName(); IQueue<E> getQueue(String name); ISet<E> getSet(String name); ITopic<E> getTopic(String name); void removeInstanceListener(InstanceListener instanceListener); static void shutdownAll(); static Collection<HazelcastClient> getAllHazelcastClients(); void shutdown(); boolean isActive(); void restart(); LifecycleService getLifecycleService(); ClientConfig getClientConfig(); }
HazelcastClient implements HazelcastInstance { public void addInstanceListener(InstanceListener instanceListener) { clusterClientProxy.addInstanceListener(instanceListener); } private  HazelcastClient(ClientConfig config); InRunnable getInRunnable(); OutRunnable getOutRunnable(); static HazelcastClient newHazelcastClient(ClientConfig config); Config getConfig(); PartitionService getPartitionService(); ClientService getClientService(); LoggingService getLoggingService(); IMap<K, V> getMap(String name); Object getClientProxy(Object o); com.hazelcast.core.Transaction getTransaction(); ConnectionManager getConnectionManager(); void addInstanceListener(InstanceListener instanceListener); Cluster getCluster(); ExecutorService getExecutorService(); ExecutorService getExecutorService(String name); IdGenerator getIdGenerator(String name); AtomicNumber getAtomicNumber(String name); ICountDownLatch getCountDownLatch(String name); ISemaphore getSemaphore(String name); Collection<Instance> getInstances(); IList<E> getList(String name); ILock getLock(Object obj); MultiMap<K, V> getMultiMap(String name); String getName(); IQueue<E> getQueue(String name); ISet<E> getSet(String name); ITopic<E> getTopic(String name); void removeInstanceListener(InstanceListener instanceListener); static void shutdownAll(); static Collection<HazelcastClient> getAllHazelcastClients(); void shutdown(); boolean isActive(); void restart(); LifecycleService getLifecycleService(); ClientConfig getClientConfig();  }