use of com.hazelcast.config.EntryListenerConfig in project hazelcast by hazelcast.
the class ListenerTest method hazelcastAwareEntryListener_whenConfiguredViaClassName_thenInjectHazelcastInstance.
@Test
public void hazelcastAwareEntryListener_whenConfiguredViaClassName_thenInjectHazelcastInstance() throws InterruptedException {
EntryListenerConfig listenerConfig = new EntryListenerConfig("com.hazelcast.map.ListenerTest$PingPongListener", false, true);
hazelcastAwareEntryListener_injectHazelcastInstance(listenerConfig);
}
use of com.hazelcast.config.EntryListenerConfig in project hazelcast by hazelcast.
the class MultiMapListenerTest method testConfigListenerRegistration.
@Test
public void testConfigListenerRegistration() throws InterruptedException {
Config config = new Config();
final String name = "default";
final CountDownLatch latch = new CountDownLatch(1);
config.getMultiMapConfig(name).addEntryListenerConfig(new EntryListenerConfig().setImplementation(new EntryAdapter() {
public void entryAdded(EntryEvent event) {
latch.countDown();
}
}));
final HazelcastInstance hz = createHazelcastInstance(config);
hz.getMultiMap(name).put(1, 1);
assertTrue(latch.await(10, TimeUnit.SECONDS));
}
Aggregations