use of com.hazelcast.spi.impl.eventservice.EventFilter in project hazelcast by hazelcast.
the class AbstractMapAddEntryListenerMessageTask method processInternal.
@Override
protected CompletableFuture<UUID> processInternal() {
final MapService mapService = getService(MapService.SERVICE_NAME);
Object listener = newMapListener();
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
String name = getDistributedObjectName();
EventFilter eventFilter = getEventFilter();
if (isLocalOnly()) {
return newCompletedFuture(mapServiceContext.addLocalEventListener(listener, eventFilter, name));
}
return mapServiceContext.addEventListenerAsync(listener, eventFilter, name);
}
use of com.hazelcast.spi.impl.eventservice.EventFilter in project hazelcast by hazelcast.
the class DefaultQueryCache method addEntryListener.
@Override
public UUID addEntryListener(MapListener listener, Predicate<K, V> predicate, boolean includeValue) {
checkNotNull(listener, "listener cannot be null");
checkNotNull(predicate, "predicate cannot be null");
QueryCacheEventService eventService = getEventService();
EventFilter filter = new QueryEventFilter(null, predicate, includeValue);
String mapName = delegate.getName();
return eventService.addListener(mapName, cacheId, listener, filter);
}
use of com.hazelcast.spi.impl.eventservice.EventFilter in project hazelcast by hazelcast.
the class DefaultQueryCache method addEntryListener.
@Override
public UUID addEntryListener(MapListener listener, Predicate<K, V> predicate, K key, boolean includeValue) {
checkNotNull(listener, "listener cannot be null");
checkNotNull(predicate, "predicate cannot be null");
checkNotNull(key, "key cannot be null");
QueryCacheEventService eventService = getEventService();
EventFilter filter = new QueryEventFilter(toData(key), predicate, includeValue);
String mapName = delegate.getName();
return eventService.addListener(mapName, cacheId, listener, filter);
}
use of com.hazelcast.spi.impl.eventservice.EventFilter in project hazelcast by hazelcast.
the class NearCachedMapProxyImpl method addNearCacheInvalidationListener.
public UUID addNearCacheInvalidationListener(InvalidationListener listener) {
// local member UUID may change after a split-brain merge
UUID localMemberUuid = getNodeEngine().getClusterService().getLocalMember().getUuid();
EventFilter eventFilter = new UuidFilter(localMemberUuid);
return mapServiceContext.addEventListener(listener, eventFilter, name);
}
use of com.hazelcast.spi.impl.eventservice.EventFilter in project hazelcast by hazelcast.
the class ReplicatedMapProxy method addEntryListener.
@Nonnull
@Override
public UUID addEntryListener(@Nonnull EntryListener<K, V> listener, @Nonnull Predicate<K, V> predicate) {
checkNotNull(listener, NULL_LISTENER_IS_NOT_ALLOWED);
checkNotNull(predicate, NULL_PREDICATE_IS_NOT_ALLOWED);
EventFilter eventFilter = new ReplicatedQueryEventFilter(null, predicate);
return eventPublishingService.addLocalEventListener(listener, eventFilter, name);
}
Aggregations