Search in sources :

Example 6 with Registration

use of com.hazelcast.spi.impl.eventservice.impl.Registration in project hazelcast by hazelcast.

the class NodeQueryCacheEventService method hasListener.

@Override
public boolean hasListener(String mapName, String cacheName) {
    String listenerName = generateListenerName(mapName, cacheName);
    Collection<EventRegistration> eventRegistrations = getRegistrations(listenerName);
    if (eventRegistrations.isEmpty()) {
        return false;
    }
    for (EventRegistration eventRegistration : eventRegistrations) {
        Registration registration = (Registration) eventRegistration;
        Object listener = registration.getListener();
        if (listener instanceof QueryCacheListenerAdapter) {
            return true;
        }
    }
    return false;
}
Also used : EventRegistration(com.hazelcast.spi.EventRegistration) Registration(com.hazelcast.spi.impl.eventservice.impl.Registration) EventRegistration(com.hazelcast.spi.EventRegistration) QueryCacheListenerAdapter(com.hazelcast.map.impl.querycache.QueryCacheListenerAdapter)

Example 7 with Registration

use of com.hazelcast.spi.impl.eventservice.impl.Registration in project hazelcast by hazelcast.

the class RegistrationOperation method readInternal.

@Override
protected void readInternal(ObjectDataInput in) throws IOException {
    registration = new Registration();
    registration.readData(in);
}
Also used : Registration(com.hazelcast.spi.impl.eventservice.impl.Registration)

Aggregations

Registration (com.hazelcast.spi.impl.eventservice.impl.Registration)7 QueryCacheListenerAdapter (com.hazelcast.map.impl.querycache.QueryCacheListenerAdapter)3 EventRegistration (com.hazelcast.spi.EventRegistration)3 EntryEventFilter (com.hazelcast.map.impl.EntryEventFilter)1 EventData (com.hazelcast.map.impl.event.EventData)1 LocalCacheWideEventData (com.hazelcast.map.impl.querycache.event.LocalCacheWideEventData)1 LocalEntryEventData (com.hazelcast.map.impl.querycache.event.LocalEntryEventData)1 Data (com.hazelcast.nio.serialization.Data)1 EventFilter (com.hazelcast.spi.EventFilter)1 NodeEngineImpl (com.hazelcast.spi.impl.NodeEngineImpl)1 EventServiceImpl (com.hazelcast.spi.impl.eventservice.impl.EventServiceImpl)1 TrueEventFilter (com.hazelcast.spi.impl.eventservice.impl.TrueEventFilter)1