@Test public void testMapEvictAndListener() throws InterruptedException { IMap<String, String> map = Hazelcast.getMap("testMapEvictAndListener"); String a = "/home/data/file1.dat"; String b = "/home/data/file2.dat"; List<String> list = new CopyOnWriteArrayList<String>(); list.add(a); list.add(b); final List<String> newList = new CopyOnWriteArrayList<String>(); final CountDownLatch latch = new CountDownLatch(list.size()); map.addEntryListener(new EntryListener<String, String>() { public void entryAdded(EntryEvent<String, String> event) { System.out.println(event); } public void entryRemoved(EntryEvent<String, String> event) { System.out.println(event); } public void entryUpdated(EntryEvent<String, String> event) { System.out.println(event); } public void entryEvicted(EntryEvent<String, String> event) { System.out.println(event); newList.add(event.getValue()); latch.countDown(); } }, true); map.put("a", list.get(0), 1, TimeUnit.SECONDS); Thread.sleep(1100); map.put("a", list.get(1), 1, TimeUnit.SECONDS); assertTrue(latch.await(20, TimeUnit.SECONDS)); assertEquals(list.get(0), newList.get(0)); assertEquals(list.get(1), newList.get(1)); }
@Deprecated public static <K, V> IMap<K, V> getMap(String name) { return getDefaultInstance().getMap(name); }
Hazelcast { @Deprecated public static <K, V> IMap<K, V> getMap(String name) { return getDefaultInstance().getMap(name); } }
Hazelcast { @Deprecated public static <K, V> IMap<K, V> getMap(String name) { return getDefaultInstance().getMap(name); } private  Hazelcast(); }
Hazelcast { @Deprecated public static <K, V> IMap<K, V> getMap(String name) { return getDefaultInstance().getMap(name); } private  Hazelcast(); @Deprecated static HazelcastInstance init(Config config); @Deprecated static HazelcastInstance getDefaultInstance(); @Deprecated static IQueue<E> getQueue(String name); @Deprecated static ITopic<E> getTopic(String name); @Deprecated static ISet<E> getSet(String name); @Deprecated static IList<E> getList(String name); @Deprecated static IMap<K, V> getMap(String name); @Deprecated static MultiMap<K, V> getMultiMap(String name); @Deprecated static ILock getLock(Object key); @Deprecated static Cluster getCluster(); @Deprecated static ExecutorService getExecutorService(); @Deprecated static ExecutorService getExecutorService(String name); @Deprecated static Transaction getTransaction(); @Deprecated static AtomicNumber getAtomicNumber(String name); @Deprecated static ICountDownLatch getCountDownLatch(String name); @Deprecated static ISemaphore getSemaphore(String name); @Deprecated static IdGenerator getIdGenerator(String name); @Deprecated static void shutdown(); static void shutdownAll(); @Deprecated static void restart(); @Deprecated static Collection<Instance> getInstances(); @Deprecated static void addInstanceListener(InstanceListener instanceListener); @Deprecated static void removeInstanceListener(InstanceListener instanceListener); static HazelcastInstance newHazelcastInstance(Config config); static HazelcastInstance newHazelcastInstance(); static HazelcastInstance newLiteMemberHazelcastInstance(); static HazelcastInstance getHazelcastInstanceByName(String instanceName); static Set<HazelcastInstance> getAllHazelcastInstances(); @Deprecated static Config getConfig(); @Deprecated static PartitionService getPartitionService(); @Deprecated static LoggingService getLoggingService(); @Deprecated static LifecycleService getLifecycleService(); static void setOutOfMemoryHandler(OutOfMemoryHandler outOfMemoryHandler); }
Hazelcast { @Deprecated public static <K, V> IMap<K, V> getMap(String name) { return getDefaultInstance().getMap(name); } private  Hazelcast(); @Deprecated static HazelcastInstance init(Config config); @Deprecated static HazelcastInstance getDefaultInstance(); @Deprecated static IQueue<E> getQueue(String name); @Deprecated static ITopic<E> getTopic(String name); @Deprecated static ISet<E> getSet(String name); @Deprecated static IList<E> getList(String name); @Deprecated static IMap<K, V> getMap(String name); @Deprecated static MultiMap<K, V> getMultiMap(String name); @Deprecated static ILock getLock(Object key); @Deprecated static Cluster getCluster(); @Deprecated static ExecutorService getExecutorService(); @Deprecated static ExecutorService getExecutorService(String name); @Deprecated static Transaction getTransaction(); @Deprecated static AtomicNumber getAtomicNumber(String name); @Deprecated static ICountDownLatch getCountDownLatch(String name); @Deprecated static ISemaphore getSemaphore(String name); @Deprecated static IdGenerator getIdGenerator(String name); @Deprecated static void shutdown(); static void shutdownAll(); @Deprecated static void restart(); @Deprecated static Collection<Instance> getInstances(); @Deprecated static void addInstanceListener(InstanceListener instanceListener); @Deprecated static void removeInstanceListener(InstanceListener instanceListener); static HazelcastInstance newHazelcastInstance(Config config); static HazelcastInstance newHazelcastInstance(); static HazelcastInstance newLiteMemberHazelcastInstance(); static HazelcastInstance getHazelcastInstanceByName(String instanceName); static Set<HazelcastInstance> getAllHazelcastInstances(); @Deprecated static Config getConfig(); @Deprecated static PartitionService getPartitionService(); @Deprecated static LoggingService getLoggingService(); @Deprecated static LifecycleService getLifecycleService(); static void setOutOfMemoryHandler(OutOfMemoryHandler outOfMemoryHandler);  }