use of com.hazelcast.spi.EventFilter in project hazelcast by hazelcast.
the class AbstractQueryCacheConfigurator method setEntryListener.
protected void setEntryListener(String mapName, String cacheName, QueryCacheConfig config) {
for (EntryListenerConfig listenerConfig : config.getEntryListenerConfigs()) {
MapListener listener = getListener(listenerConfig);
if (listener != null) {
EventFilter filter = new EntryEventFilter(listenerConfig.isIncludeValue(), null);
eventService.addListener(mapName, cacheName, listener, filter);
}
}
}
use of com.hazelcast.spi.EventFilter in project hazelcast by hazelcast.
the class DefaultQueryCache method addEntryListener.
@Override
public String 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(includeValue, toData(key), predicate);
String mapName = delegate.getName();
return eventService.addListener(mapName, cacheName, listener, filter);
}
use of com.hazelcast.spi.EventFilter in project hazelcast by hazelcast.
the class DefaultQueryCache method addEntryListener.
@Override
public String 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(includeValue, null, predicate);
String mapName = delegate.getName();
return eventService.addListener(mapName, cacheName, listener, filter);
}
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) {
isNotNull(listener, "listener");
EventFilter eventFilter = new ReplicatedQueryEventFilter(null, predicate);
return eventPublishingService.addEventListener(listener, eventFilter, name);
}
use of com.hazelcast.spi.EventFilter in project hazelcast by hazelcast.
the class MapService method onRegister.
@Override
public void onRegister(Object service, String serviceName, String topic, EventRegistration registration) {
EventFilter filter = registration.getFilter();
if (!(filter instanceof EventListenerFilter) || !filter.eval(INVALIDATION.getType())) {
return;
}
MapContainer mapContainer = mapServiceContext.getMapContainer(topic);
mapContainer.increaseInvalidationListenerCount();
}
Aggregations