use of com.hazelcast.spi.impl.eventservice.EventRegistration in project hazelcast by hazelcast.
the class AbstractCollectionProxyImpl method addItemListener.
@Nonnull
public UUID addItemListener(@Nonnull ItemListener<E> listener, boolean includeValue) {
checkNotNull(listener, "Null listener is not allowed!");
final EventService eventService = getNodeEngine().getEventService();
final CollectionEventFilter filter = new CollectionEventFilter(includeValue);
final EventRegistration registration = eventService.registerListener(getServiceName(), name, filter, listener);
return registration.getId();
}
use of com.hazelcast.spi.impl.eventservice.EventRegistration in project hazelcast by hazelcast.
the class PartitionEventManager method addMigrationListenerAsync.
public CompletableFuture<UUID> addMigrationListenerAsync(@Nonnull MigrationListener listener) {
checkNotNull(listener, "listener can't be null");
final MigrationListenerAdapter adapter = new MigrationListenerAdapter(listener);
EventService eventService = nodeEngine.getEventService();
return eventService.registerListenerAsync(SERVICE_NAME, MIGRATION_EVENT_TOPIC, adapter).thenApplyAsync(EventRegistration::getId, CALLER_RUNS);
}
use of com.hazelcast.spi.impl.eventservice.EventRegistration in project hazelcast by hazelcast.
the class PartitionEventManager method addMigrationListener.
public UUID addMigrationListener(@Nonnull MigrationListener listener) {
checkNotNull(listener, "listener can't be null");
final MigrationListenerAdapter adapter = new MigrationListenerAdapter(listener);
EventService eventService = nodeEngine.getEventService();
EventRegistration registration = eventService.registerListener(SERVICE_NAME, MIGRATION_EVENT_TOPIC, adapter);
return registration.getId();
}
use of com.hazelcast.spi.impl.eventservice.EventRegistration in project hazelcast by hazelcast.
the class PartitionEventManager method onPartitionLost.
public void onPartitionLost(IPartitionLostEvent event) {
assert event instanceof PartitionLostEvent;
EventService eventService = nodeEngine.getEventService();
Collection<EventRegistration> registrations = eventService.getRegistrations(SERVICE_NAME, PARTITION_LOST_EVENT_TOPIC);
eventService.publishEvent(SERVICE_NAME, registrations, event, event.getPartitionId());
}
use of com.hazelcast.spi.impl.eventservice.EventRegistration in project hazelcast by hazelcast.
the class PartitionEventManager method addPartitionLostListener.
public UUID addPartitionLostListener(@Nonnull PartitionLostListener listener) {
checkNotNull(listener, "listener can't be null");
final PartitionLostListenerAdapter adapter = new PartitionLostListenerAdapter(listener);
EventService eventService = nodeEngine.getEventService();
EventRegistration registration = eventService.registerListener(SERVICE_NAME, PARTITION_LOST_EVENT_TOPIC, adapter);
return registration.getId();
}
Aggregations