use of com.hazelcast.map.impl.ListenerAdapter in project hazelcast by hazelcast.
the class ClientMultiMapProxy method addEntryListener.
@Nonnull
@Override
public UUID addEntryListener(@Nonnull EntryListener<K, V> listener, @Nonnull K key, final boolean includeValue) {
checkNotNull(listener, NULL_LISTENER_IS_NOT_ALLOWED);
checkNotNull(key, NULL_KEY_IS_NOT_ALLOWED);
final Data keyData = toData(key);
ListenerAdapter listenerAdapter = createListenerAdapter(listener);
EventHandler<ClientMessage> handler = new ClientMultiMapToKeyEventHandler(listenerAdapter);
return registerListener(createEntryListenerToKeyCodec(includeValue, keyData), handler);
}
use of com.hazelcast.map.impl.ListenerAdapter in project hazelcast by hazelcast.
the class ClientQueryCacheEventService method addListener.
@Override
public UUID addListener(String mapName, String cacheId, MapListener listener, EventFilter filter) {
checkHasText(mapName, "mapName");
checkHasText(cacheId, "cacheId");
checkNotNull(listener, "listener cannot be null");
QueryCacheToListenerMapper queryCacheToListenerMapper = getOrPutIfAbsent(registrations, mapName, REGISTRY_CONSTRUCTOR);
ListenerAdapter listenerAdaptor = createQueryCacheListenerAdaptor(listener);
return queryCacheToListenerMapper.addListener(cacheId, listenerAdaptor, filter);
}
use of com.hazelcast.map.impl.ListenerAdapter in project hazelcast by hazelcast.
the class PostJoinMapOperation method createQueryCaches.
private void createQueryCaches() {
MapService mapService = getService();
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
QueryCacheContext queryCacheContext = mapServiceContext.getQueryCacheContext();
PublisherContext publisherContext = queryCacheContext.getPublisherContext();
MapPublisherRegistry mapPublisherRegistry = publisherContext.getMapPublisherRegistry();
for (AccumulatorInfo info : infoList) {
addAccumulatorInfo(queryCacheContext, info);
PublisherRegistry publisherRegistry = mapPublisherRegistry.getOrCreate(info.getMapName());
publisherRegistry.getOrCreate(info.getCacheId());
// marker listener.
mapServiceContext.addLocalListenerAdapter((ListenerAdapter<IMapEvent>) event -> {
}, info.getMapName());
}
}
Aggregations