Search in sources :

Example 16 with EventFilter

use of com.hazelcast.spi.EventFilter in project hazelcast by hazelcast.

the class ReplicatedMapProxy method addEntryListener.

@Override
public String addEntryListener(EntryListener<K, V> listener, K key) {
    isNotNull(listener, "listener");
    EventFilter eventFilter = new ReplicatedEntryEventFilter(serializationService.toData(key));
    return eventPublishingService.addEventListener(listener, eventFilter, name);
}
Also used : ReplicatedEntryEventFilter(com.hazelcast.replicatedmap.impl.record.ReplicatedEntryEventFilter) ReplicatedQueryEventFilter(com.hazelcast.replicatedmap.impl.record.ReplicatedQueryEventFilter) TrueEventFilter(com.hazelcast.spi.impl.eventservice.impl.TrueEventFilter) EventFilter(com.hazelcast.spi.EventFilter) ReplicatedEntryEventFilter(com.hazelcast.replicatedmap.impl.record.ReplicatedEntryEventFilter)

Example 17 with EventFilter

use of com.hazelcast.spi.EventFilter in project hazelcast by hazelcast.

the class ReplicatedMapProxy method addEntryListener.

@Override
public String addEntryListener(EntryListener<K, V> listener, Predicate<K, V> predicate, K key) {
    isNotNull(listener, "listener");
    EventFilter eventFilter = new ReplicatedQueryEventFilter(serializationService.toData(key), predicate);
    return eventPublishingService.addEventListener(listener, eventFilter, name);
}
Also used : ReplicatedQueryEventFilter(com.hazelcast.replicatedmap.impl.record.ReplicatedQueryEventFilter) ReplicatedQueryEventFilter(com.hazelcast.replicatedmap.impl.record.ReplicatedQueryEventFilter) TrueEventFilter(com.hazelcast.spi.impl.eventservice.impl.TrueEventFilter) EventFilter(com.hazelcast.spi.EventFilter) ReplicatedEntryEventFilter(com.hazelcast.replicatedmap.impl.record.ReplicatedEntryEventFilter)

Example 18 with EventFilter

use of com.hazelcast.spi.EventFilter in project hazelcast by hazelcast.

the class EventServiceSegment method pingNotifiableEventListener.

private void pingNotifiableEventListener(String topic, Registration registration, boolean register) {
    Object listener = registration.getListener();
    if (!(listener instanceof NotifiableEventListener)) {
        EventFilter filter = registration.getFilter();
        if (filter instanceof ListenerWrapperEventFilter) {
            listener = ((ListenerWrapperEventFilter) filter).getListener();
        }
    }
    pingNotifiableEventListenerInternal(listener, topic, registration, register);
    pingNotifiableEventListenerInternal(service, topic, registration, register);
}
Also used : ListenerWrapperEventFilter(com.hazelcast.spi.ListenerWrapperEventFilter) NotifiableEventListener(com.hazelcast.spi.NotifiableEventListener) EventFilter(com.hazelcast.spi.EventFilter) ListenerWrapperEventFilter(com.hazelcast.spi.ListenerWrapperEventFilter)

Example 19 with EventFilter

use of com.hazelcast.spi.EventFilter in project hazelcast by hazelcast.

the class NearCachedMapProxyImpl method addNearCacheInvalidateListener.

private void addNearCacheInvalidateListener() {
    repairingHandler = mapNearCacheManager.newRepairingHandler(name, nearCache);
    EventFilter eventFilter = new UuidFilter(getNodeEngine().getLocalMember().getUuid());
    invalidationListenerId = mapServiceContext.addEventListener(new NearCacheInvalidationListener(), eventFilter, name);
}
Also used : UuidFilter(com.hazelcast.map.impl.nearcache.invalidation.UuidFilter) EventFilter(com.hazelcast.spi.EventFilter)

Example 20 with EventFilter

use of com.hazelcast.spi.EventFilter in project hazelcast by hazelcast.

the class DefaultQueryCache method addEntryListenerInternal.

private String addEntryListenerInternal(MapListener listener, K key, boolean includeValue) {
    checkNotNull(listener, "listener cannot be null");
    Data keyData = toData(key);
    EventFilter filter = new EntryEventFilter(includeValue, keyData);
    QueryCacheEventService eventService = getEventService();
    String mapName = delegate.getName();
    return eventService.addListener(mapName, cacheName, listener, filter);
}
Also used : QueryCacheEventService(com.hazelcast.map.impl.querycache.QueryCacheEventService) EntryEventFilter(com.hazelcast.map.impl.EntryEventFilter) Data(com.hazelcast.nio.serialization.Data) EntryEventFilter(com.hazelcast.map.impl.EntryEventFilter) QueryEventFilter(com.hazelcast.map.impl.query.QueryEventFilter) EventFilter(com.hazelcast.spi.EventFilter)

Aggregations

EventFilter (com.hazelcast.spi.EventFilter)20 TrueEventFilter (com.hazelcast.spi.impl.eventservice.impl.TrueEventFilter)8 EntryEventFilter (com.hazelcast.map.impl.EntryEventFilter)7 EventRegistration (com.hazelcast.spi.EventRegistration)7 QueryEventFilter (com.hazelcast.map.impl.query.QueryEventFilter)5 QueryCacheEventService (com.hazelcast.map.impl.querycache.QueryCacheEventService)3 ReplicatedEntryEventFilter (com.hazelcast.replicatedmap.impl.record.ReplicatedEntryEventFilter)3 ReplicatedQueryEventFilter (com.hazelcast.replicatedmap.impl.record.ReplicatedQueryEventFilter)3 CachePartitionLostEventFilter (com.hazelcast.cache.impl.event.CachePartitionLostEventFilter)2 InternalCachePartitionLostListenerAdapter (com.hazelcast.cache.impl.event.InternalCachePartitionLostListenerAdapter)2 ClientEndpoint (com.hazelcast.client.ClientEndpoint)2 ListenerAdapters.createListenerAdapter (com.hazelcast.map.impl.ListenerAdapters.createListenerAdapter)2 MapPartitionLostEventFilter (com.hazelcast.map.impl.MapPartitionLostEventFilter)2 Data (com.hazelcast.nio.serialization.Data)2 CacheService (com.hazelcast.cache.impl.CacheService)1 ICacheService (com.hazelcast.cache.impl.ICacheService)1 CachePartitionLostEvent (com.hazelcast.cache.impl.event.CachePartitionLostEvent)1 CachePartitionLostListener (com.hazelcast.cache.impl.event.CachePartitionLostListener)1 ClientMessage (com.hazelcast.client.impl.protocol.ClientMessage)1 EntryListenerConfig (com.hazelcast.config.EntryListenerConfig)1