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);
}
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;
}
Aggregations