Examples of addEntryListener()


Examples of com.hazelcast.core.MultiMap.addEntryListener()

        final Object key = "key";
        final int maxItems = 88;
        final MultiMap mm = client.getMultiMap(randomString());

        MyEntryListener listener = new CountDownValueNotNullListener(maxItems);
        mm.addEntryListener(listener, key, true);

        for (int i = 0; i < maxItems; i++) {
            mm.put(key, i);
            mm.remove(key, i);
        }
View Full Code Here

Examples of com.hazelcast.core.MultiMap.addEntryListener()

        final Object key = "key";
        final int maxItems = 62;
        final MultiMap mm = client.getMultiMap(randomString());

        MyEntryListener listener = new CountDownValueNullListener(maxItems);
        mm.addEntryListener(listener, key, false);

        for (int i = 0; i < maxItems; i++) {
            mm.put(key, i);
            mm.remove(key, i);
        }
View Full Code Here

Examples of com.hazelcast.core.MultiMap.addEntryListener()

        final Object key = "key";
        final int maxItems = 98;
        final MultiMap mm = client.getMultiMap(randomString());

        MyEntryListener listener = new CountDownValueNotNullListener(maxItems, 1);
        final String id = mm.addEntryListener(listener, key, true);

        for (int i = 0; i < maxItems; i++) {
            mm.put(key, i);
        }
        mm.remove(key);
View Full Code Here

Examples of com.hazelcast.core.MultiMap.addEntryListener()

        final Object key = "key";
        final int maxItems = 56;
        final MultiMap mm = client.getMultiMap(randomString());

        MyEntryListener listener = new CountDownValueNullListener(maxItems, 1);
        final String id = mm.addEntryListener(listener, key, false);

        for (int i = 0; i < maxItems; i++) {
            mm.put(key, i);
        }
        mm.remove(key);
View Full Code Here

Examples of com.hazelcast.core.MultiMap.addEntryListener()

    @Test
    public void testListeners_clearAll() {
        final MultiMap mm = client.getMultiMap(randomString());
        MyEntryListener listener = new CountDownValueNullListener(1);
        mm.addEntryListener(listener, false);
        mm.put("key", "value");
        mm.clear();
        assertOpenEventually(listener.addLatch);
        assertOpenEventually(listener.clearLatch);
    }
View Full Code Here

Examples of com.hazelcast.core.MultiMap.addEntryListener()

    @Test
    public void testListeners_clearAllFromNode() {
        final String name = randomString();
        final MultiMap mm = client.getMultiMap(name);
        MyEntryListener listener = new CountDownValueNullListener(1);
        mm.addEntryListener(listener, false);
        mm.put("key", "value");
        server.getMultiMap(name).clear();
        assertOpenEventually(listener.addLatch);
        assertOpenEventually(listener.clearLatch);
    }
View Full Code Here

Examples of com.hazelcast.core.MultiMap.addEntryListener()

        final String name = randomString();
        final MultiMap mm = client.getMultiMap(name);
        final CountDownLatch gateClearAll = new CountDownLatch(1);
        final CountDownLatch gateAdd = new CountDownLatch(1);
        final EntryListener listener = new EntListener(gateAdd, null, null, null, gateClearAll, null);
        mm.addEntryListener(listener, false);
        mm.put("key", "value");
        server.getMultiMap(name).clear();
        assertOpenEventually(gateAdd);
        assertOpenEventually(gateClearAll);
    }
View Full Code Here

Examples of com.hazelcast.core.ReplicatedMap.addEntryListener()

        for (int i = 0; i < replicatedMaps.length; i++) {
            ReplicatedMap replicatedMap = replicatedMaps[i];
            CountDownLatch latch = new CountDownLatch(latches[i]);
            WatcherListener listener = new WatcherListener(latch, eventType);
            watcherDefinitions[i] = new WatcherDefinition(latch, replicatedMap, listener);
            registrationIds[i] = replicatedMap.addEntryListener(listener);
        }
        try {
            runnable.run();
            long deadline = TimeUnit.SECONDS.toNanos(timeoutSeconds);
            for (WatcherDefinition definition : watcherDefinitions) {
View Full Code Here

Examples of com.hazelcast.replicatedmap.impl.record.ReplicatedRecordStore.addEntryListener()

        final ClientEndpoint endpoint = getEndpoint();
        final ReplicatedRecordStore replicatedRecordStore = getReplicatedRecordStore();
        final EntryListener<Object, Object> listener = new ClientReplicatedMapEntryListener();
        String registrationId;
        if (predicate == null) {
            registrationId = replicatedRecordStore.addEntryListener(listener, key);
        } else {
            registrationId = replicatedRecordStore.addEntryListener(listener, predicate, key);
        }
        endpoint.setListenerRegistration(ReplicatedMapService.SERVICE_NAME, getMapName(), registrationId);
        return registrationId;
View Full Code Here

Examples of com.hazelcast.replicatedmap.impl.record.ReplicatedRecordStore.addEntryListener()

        final EntryListener<Object, Object> listener = new ClientReplicatedMapEntryListener();
        String registrationId;
        if (predicate == null) {
            registrationId = replicatedRecordStore.addEntryListener(listener, key);
        } else {
            registrationId = replicatedRecordStore.addEntryListener(listener, predicate, key);
        }
        endpoint.setListenerRegistration(ReplicatedMapService.SERVICE_NAME, getMapName(), registrationId);
        return registrationId;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.