use of com.hazelcast.spi.impl.eventservice.EventService in project hazelcast by hazelcast.
the class ClientServiceProxy method addClientListener.
@Nonnull
@Override
public UUID addClientListener(@Nonnull ClientListener clientListener) {
checkNotNull(clientListener, "clientListener should not be null");
EventService eventService = nodeEngine.getEventService();
EventRegistration registration = eventService.registerLocalListener(ClientEngineImpl.SERVICE_NAME, ClientEngineImpl.SERVICE_NAME, clientListener);
return registration.getId();
}
use of com.hazelcast.spi.impl.eventservice.EventService in project hazelcast by hazelcast.
the class SetAddListenerMessageTask method processInternal.
@Override
protected CompletableFuture<UUID> processInternal() {
Data partitionKey = serializationService.toData(parameters.name);
ItemListener listener = createItemListener(endpoint, partitionKey);
EventService eventService = clientEngine.getEventService();
CollectionEventFilter filter = new CollectionEventFilter(parameters.includeValue);
if (parameters.localOnly) {
return newCompletedFuture(eventService.registerLocalListener(getServiceName(), parameters.name, filter, listener).getId());
}
return eventService.registerListenerAsync(getServiceName(), parameters.name, filter, listener).thenApplyAsync(EventRegistration::getId, CALLER_RUNS);
}
use of com.hazelcast.spi.impl.eventservice.EventService in project hazelcast by hazelcast.
the class RemoveCPGroupAvailabilityListenerMessageTask method processInternal.
@Override
protected CompletableFuture<Boolean> processInternal() {
UUID registrationId = parameters;
endpoint.removeDestroyAction(registrationId);
EventService eventService = clientEngine.getEventService();
return eventService.deregisterListenerAsync(getServiceName(), EVENT_TOPIC_AVAILABILITY, registrationId);
}
use of com.hazelcast.spi.impl.eventservice.EventService in project hazelcast by hazelcast.
the class TopicDestroyTest method assertRegistrationSize.
void assertRegistrationSize(int size) {
EventService eventService = getNode(instance).getNodeEngine().getEventService();
Collection<EventRegistration> regs = eventService.getRegistrations(TopicService.SERVICE_NAME, topicName);
assertEquals(size, regs.size());
}
use of com.hazelcast.spi.impl.eventservice.EventService in project hazelcast by hazelcast.
the class PartitionLostListenerRegistrationTest method assertRegistrationsSizeEventually.
private static void assertRegistrationsSizeEventually(final HazelcastInstance instance, final int expectedSize) {
assertTrueEventually(new AssertTask() {
@Override
public void run() {
assertTrueEventually(new AssertTask() {
@Override
public void run() {
EventService eventService = getNode(instance).getNodeEngine().getEventService();
Collection<EventRegistration> registrations = eventService.getRegistrations(SERVICE_NAME, PARTITION_LOST_EVENT_TOPIC);
assertEquals(expectedSize, registrations.size());
}
});
}
});
}
Aggregations