Search in sources :

Example 6 with ReplicatedMapEventPublishingService

use of com.hazelcast.replicatedmap.impl.ReplicatedMapEventPublishingService in project hazelcast by hazelcast.

the class AbstractReplicatedMapAddEntryListenerMessageTask method processInternal.

@Override
protected CompletableFuture<UUID> processInternal() {
    ReplicatedMapService service = getService(ReplicatedMapService.SERVICE_NAME);
    ReplicatedMapEventPublishingService eventPublishingService = service.getEventPublishingService();
    Predicate predicate = getPredicate();
    ReplicatedEntryEventFilter filter;
    if (predicate == null) {
        filter = new ReplicatedEntryEventFilter(getKey());
    } else {
        filter = new ReplicatedQueryEventFilter(getKey(), predicate);
    }
    return newCompletedFuture(eventPublishingService.addLocalEventListener(this, filter, getDistributedObjectName()));
}
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)

Example 7 with ReplicatedMapEventPublishingService

use of com.hazelcast.replicatedmap.impl.ReplicatedMapEventPublishingService in project hazelcast by hazelcast.

the class ReplicatedMapRemoveEntryListenerMessageTask method deRegisterListener.

@Override
protected Future<Boolean> deRegisterListener() {
    ReplicatedMapService service = getService(ReplicatedMapService.SERVICE_NAME);
    ReplicatedMapEventPublishingService eventPublishingService = service.getEventPublishingService();
    return eventPublishingService.removeEventListenerAsync(parameters.name, parameters.registrationId);
}
Also used : ReplicatedMapService(com.hazelcast.replicatedmap.impl.ReplicatedMapService) ReplicatedMapEventPublishingService(com.hazelcast.replicatedmap.impl.ReplicatedMapEventPublishingService)

Example 8 with ReplicatedMapEventPublishingService

use of com.hazelcast.replicatedmap.impl.ReplicatedMapEventPublishingService in project hazelcast by hazelcast.

the class ReplicatedMapClearMessageTask method reduce.

@Override
protected Object reduce(Map<Integer, Object> map) {
    int deletedEntrySize = 0;
    for (Object deletedEntryPerPartition : map.values()) {
        deletedEntrySize += (Integer) deletedEntryPerPartition;
    }
    ReplicatedMapService service = getService(getServiceName());
    ReplicatedMapEventPublishingService eventPublishingService = service.getEventPublishingService();
    eventPublishingService.fireMapClearedEvent(deletedEntrySize, getDistributedObjectName());
    return null;
}
Also used : ReplicatedMapService(com.hazelcast.replicatedmap.impl.ReplicatedMapService) ReplicatedMapEventPublishingService(com.hazelcast.replicatedmap.impl.ReplicatedMapEventPublishingService)

Example 9 with ReplicatedMapEventPublishingService

use of com.hazelcast.replicatedmap.impl.ReplicatedMapEventPublishingService in project hazelcast by hazelcast.

the class ReplicateUpdateOperation method publishEvent.

private void publishEvent() {
    ReplicatedMapService service = getService();
    ReplicatedMapEventPublishingService eventPublishingService = service.getEventPublishingService();
    Data dataOldValue = getNodeEngine().toData(response.getResponse());
    if (isRemove) {
        eventPublishingService.fireEntryListenerEvent(dataKey, dataOldValue, null, name, origin);
    } else {
        eventPublishingService.fireEntryListenerEvent(dataKey, dataOldValue, dataValue, name, origin);
    }
}
Also used : ReplicatedMapService(com.hazelcast.replicatedmap.impl.ReplicatedMapService) Data(com.hazelcast.internal.serialization.Data) ReplicatedMapEventPublishingService(com.hazelcast.replicatedmap.impl.ReplicatedMapEventPublishingService)

Example 10 with ReplicatedMapEventPublishingService

use of com.hazelcast.replicatedmap.impl.ReplicatedMapEventPublishingService in project hazelcast by hazelcast.

the class RemoveOperation method afterRun.

@Override
public void afterRun() throws Exception {
    sendReplicationOperation(true);
    ReplicatedMapEventPublishingService eventPublishingService = service.getEventPublishingService();
    eventPublishingService.fireEntryListenerEvent(key, oldValue, null, name, getCallerAddress());
}
Also used : ReplicatedMapEventPublishingService(com.hazelcast.replicatedmap.impl.ReplicatedMapEventPublishingService)

Aggregations

ReplicatedMapEventPublishingService (com.hazelcast.replicatedmap.impl.ReplicatedMapEventPublishingService)10 ReplicatedMapService (com.hazelcast.replicatedmap.impl.ReplicatedMapService)7 Data (com.hazelcast.internal.serialization.Data)4 Predicate (com.hazelcast.query.Predicate)2 ReplicatedEntryEventFilter (com.hazelcast.replicatedmap.impl.record.ReplicatedEntryEventFilter)2 ReplicatedQueryEventFilter (com.hazelcast.replicatedmap.impl.record.ReplicatedQueryEventFilter)2 Address (com.hazelcast.cluster.Address)1 IPartitionService (com.hazelcast.internal.partition.IPartitionService)1 ReplicatedRecordStore (com.hazelcast.replicatedmap.impl.record.ReplicatedRecordStore)1