Search in sources :

Example 11 with ListenerAdapter

use of com.hazelcast.map.impl.ListenerAdapter in project hazelcast by hazelcast.

the class ClientQueryCacheEventService method addListener.

@Override
public String addListener(String mapName, String cacheName, MapListener listener, EventFilter filter) {
    checkHasText(mapName, "mapName");
    checkHasText(cacheName, "cacheName");
    checkNotNull(listener, "listener cannot be null");
    QueryCacheToListenerMapper queryCacheToListenerMapper = getOrPutIfAbsent(registrations, mapName, REGISTRY_CONSTRUCTOR);
    ListenerAdapter listenerAdaptor = createQueryCacheListenerAdaptor(listener);
    return queryCacheToListenerMapper.addListener(cacheName, listenerAdaptor, filter);
}
Also used : ListenerAdapter(com.hazelcast.map.impl.ListenerAdapter)

Example 12 with ListenerAdapter

use of com.hazelcast.map.impl.ListenerAdapter in project hazelcast by hazelcast.

the class ClientMapProxy method addEntryListener.

@Override
public String addEntryListener(MapListener listener, Predicate<K, V> predicate, boolean includeValue) {
    checkNotNull(listener, NULL_LISTENER_IS_NOT_ALLOWED);
    checkNotNull(predicate, NULL_PREDICATE_IS_NOT_ALLOWED);
    ListenerAdapter listenerAdaptor = createListenerAdapter(listener);
    return addEntryListenerInternal(listenerAdaptor, predicate, includeValue);
}
Also used : ListenerAdapter(com.hazelcast.map.impl.ListenerAdapter) ListenerAdapters.createListenerAdapter(com.hazelcast.map.impl.ListenerAdapters.createListenerAdapter)

Example 13 with ListenerAdapter

use of com.hazelcast.map.impl.ListenerAdapter in project hazelcast by hazelcast.

the class ClientMapProxy method addEntryListener.

@Override
public String addEntryListener(EntryListener listener, final boolean includeValue) {
    checkNotNull(listener, NULL_LISTENER_IS_NOT_ALLOWED);
    ListenerAdapter listenerAdaptor = createListenerAdapter(listener);
    return addEntryListenerInternal(listenerAdaptor, includeValue);
}
Also used : ListenerAdapter(com.hazelcast.map.impl.ListenerAdapter) ListenerAdapters.createListenerAdapter(com.hazelcast.map.impl.ListenerAdapters.createListenerAdapter)

Example 14 with ListenerAdapter

use of com.hazelcast.map.impl.ListenerAdapter in project hazelcast by hazelcast.

the class ClientMapProxy method addEntryListener.

@Override
public String addEntryListener(EntryListener listener, Predicate<K, V> predicate, boolean includeValue) {
    checkNotNull(listener, NULL_LISTENER_IS_NOT_ALLOWED);
    checkNotNull(predicate, NULL_PREDICATE_IS_NOT_ALLOWED);
    ListenerAdapter listenerAdaptor = createListenerAdapter(listener);
    return addEntryListenerInternal(listenerAdaptor, predicate, includeValue);
}
Also used : ListenerAdapter(com.hazelcast.map.impl.ListenerAdapter) ListenerAdapters.createListenerAdapter(com.hazelcast.map.impl.ListenerAdapters.createListenerAdapter)

Example 15 with ListenerAdapter

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, final boolean includeValue) {
    checkNotNull(listener, NULL_LISTENER_IS_NOT_ALLOWED);
    ListenerAdapter listenerAdaptor = createListenerAdapter(listener);
    EventHandler<ClientMessage> handler = new ClientMultiMapEventHandler(listenerAdaptor);
    return registerListener(createEntryListenerCodec(includeValue), handler);
}
Also used : ListenerAdapters.createListenerAdapter(com.hazelcast.map.impl.ListenerAdapters.createListenerAdapter) ListenerAdapter(com.hazelcast.map.impl.ListenerAdapter) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage) Nonnull(javax.annotation.Nonnull)

Aggregations

ListenerAdapter (com.hazelcast.map.impl.ListenerAdapter)18 ListenerAdapters.createListenerAdapter (com.hazelcast.map.impl.ListenerAdapters.createListenerAdapter)11 ClientMessage (com.hazelcast.client.impl.protocol.ClientMessage)2 Nonnull (javax.annotation.Nonnull)2 Address (com.hazelcast.cluster.Address)1 EntryEvent (com.hazelcast.core.EntryEvent)1 Data (com.hazelcast.internal.serialization.Data)1 ContextMutexFactory (com.hazelcast.internal.util.ContextMutexFactory)1 MapUtil.createHashMap (com.hazelcast.internal.util.MapUtil.createHashMap)1 IMapEvent (com.hazelcast.map.IMapEvent)1 MapInterceptor (com.hazelcast.map.MapInterceptor)1 EventListenerFilter (com.hazelcast.map.impl.EventListenerFilter)1 InterceptorRegistry (com.hazelcast.map.impl.InterceptorRegistry)1 MapContainer (com.hazelcast.map.impl.MapContainer)1 MapDataSerializerHook (com.hazelcast.map.impl.MapDataSerializerHook)1 MapService (com.hazelcast.map.impl.MapService)1 MapServiceContext (com.hazelcast.map.impl.MapServiceContext)1 QueryCacheContext (com.hazelcast.map.impl.querycache.QueryCacheContext)1 QueryCacheEventService (com.hazelcast.map.impl.querycache.QueryCacheEventService)1 QueryCacheListenerAdapter (com.hazelcast.map.impl.querycache.QueryCacheListenerAdapter)1