Search in sources :

Example 1 with ReplicatedEntryEventFilter

use of com.hazelcast.replicatedmap.impl.record.ReplicatedEntryEventFilter in project hazelcast by hazelcast.

the class ReplicatedMapProxy method addEntryListener.

@Override
public String addEntryListener(EntryListener<K, V> listener, K key) {
    isNotNull(listener, "listener");
    EventFilter eventFilter = new ReplicatedEntryEventFilter(serializationService.toData(key));
    return eventPublishingService.addEventListener(listener, eventFilter, name);
}
Also used : ReplicatedEntryEventFilter(com.hazelcast.replicatedmap.impl.record.ReplicatedEntryEventFilter) ReplicatedQueryEventFilter(com.hazelcast.replicatedmap.impl.record.ReplicatedQueryEventFilter) TrueEventFilter(com.hazelcast.spi.impl.eventservice.impl.TrueEventFilter) EventFilter(com.hazelcast.spi.EventFilter) ReplicatedEntryEventFilter(com.hazelcast.replicatedmap.impl.record.ReplicatedEntryEventFilter)

Example 2 with ReplicatedEntryEventFilter

use of com.hazelcast.replicatedmap.impl.record.ReplicatedEntryEventFilter in project hazelcast by hazelcast.

the class AbstractReplicatedMapAddEntryListenerMessageTask method call.

@Override
protected Object call() {
    ReplicatedMapService service = getService(ReplicatedMapService.SERVICE_NAME);
    ReplicatedMapEventPublishingService eventPublishingService = service.getEventPublishingService();
    String registrationId;
    Predicate predicate = getPredicate();
    if (predicate == null) {
        registrationId = eventPublishingService.addEventListener(this, new ReplicatedEntryEventFilter(getKey()), getDistributedObjectName());
    } else {
        registrationId = eventPublishingService.addEventListener(this, new ReplicatedQueryEventFilter(getKey(), predicate), getDistributedObjectName());
    }
    endpoint.addListenerDestroyAction(ReplicatedMapService.SERVICE_NAME, getDistributedObjectName(), registrationId);
    return registrationId;
}
Also used : ReplicatedQueryEventFilter(com.hazelcast.replicatedmap.impl.record.ReplicatedQueryEventFilter) ReplicatedEntryEventFilter(com.hazelcast.replicatedmap.impl.record.ReplicatedEntryEventFilter) ReplicatedMapService(com.hazelcast.replicatedmap.impl.ReplicatedMapService) ReplicatedMapEventPublishingService(com.hazelcast.replicatedmap.impl.ReplicatedMapEventPublishingService) Predicate(com.hazelcast.query.Predicate)

Aggregations

ReplicatedEntryEventFilter (com.hazelcast.replicatedmap.impl.record.ReplicatedEntryEventFilter)2 ReplicatedQueryEventFilter (com.hazelcast.replicatedmap.impl.record.ReplicatedQueryEventFilter)2 Predicate (com.hazelcast.query.Predicate)1 ReplicatedMapEventPublishingService (com.hazelcast.replicatedmap.impl.ReplicatedMapEventPublishingService)1 ReplicatedMapService (com.hazelcast.replicatedmap.impl.ReplicatedMapService)1 EventFilter (com.hazelcast.spi.EventFilter)1 TrueEventFilter (com.hazelcast.spi.impl.eventservice.impl.TrueEventFilter)1