use of com.hazelcast.client.impl.spi.impl.listener.ClientListenerServiceImpl in project hazelcast by hazelcast.
the class ClientResponseHandlerSupplier method handleResponse.
private void handleResponse(ClientMessage message) {
if (ClientMessage.isFlagSet(message.getHeaderFlags(), ClientMessage.BACKUP_EVENT_FLAG)) {
ClientListenerServiceImpl listenerService = (ClientListenerServiceImpl) client.getListenerService();
listenerService.handleEventMessageOnCallingThread(message);
return;
}
long correlationId = message.getCorrelationId();
ClientInvocation invocation = invocationService.getInvocation(correlationId);
if (invocation == null) {
logger.warning("No call for callId: " + correlationId + ", response: " + message);
return;
}
if (EXCEPTION_MESSAGE_TYPE == message.getMessageType()) {
invocation.notifyException(correlationId, client.getClientExceptionFactory().createException(message));
} else {
invocation.notify(message);
}
}
use of com.hazelcast.client.impl.spi.impl.listener.ClientListenerServiceImpl in project hazelcast by hazelcast.
the class ListenerLeakTest method getClientEventRegistrations.
private Collection<ClientConnectionRegistration> getClientEventRegistrations(HazelcastInstance client, UUID id) {
HazelcastClientInstanceImpl clientImpl = ClientTestUtil.getHazelcastClientInstanceImpl(client);
ClientListenerServiceImpl listenerService = (ClientListenerServiceImpl) clientImpl.getListenerService();
return listenerService.getActiveRegistrations(id).values();
}
use of com.hazelcast.client.impl.spi.impl.listener.ClientListenerServiceImpl in project hazelcast by hazelcast.
the class AbstractListenersOnReconnectTest method getClientEventRegistrations.
private Map<Connection, ClientConnectionRegistration> getClientEventRegistrations(HazelcastInstance client, UUID id) {
HazelcastClientInstanceImpl clientImpl = ClientTestUtil.getHazelcastClientInstanceImpl(client);
ClientListenerServiceImpl listenerService = (ClientListenerServiceImpl) clientImpl.getListenerService();
return listenerService.getActiveRegistrations(id);
}
use of com.hazelcast.client.impl.spi.impl.listener.ClientListenerServiceImpl in project hazelcast by hazelcast.
the class ClientQueryCacheDestroyResourcesTest method destroy_deregisters_listeners.
@Test
public void destroy_deregisters_listeners() {
QueryCache<String, String> queryCache1 = map1.getQueryCache(QUERY_CACHE_NAME_1);
QueryCache<String, String> queryCache2 = map2.getQueryCache(QUERY_CACHE_NAME_2);
QueryCache<String, String> queryCache3 = map3.getQueryCache(QUERY_CACHE_NAME_3);
HazelcastClientInstanceImpl client = getHazelcastClientInstanceImpl(clientInstance);
ClientListenerServiceImpl listenerService = (ClientListenerServiceImpl) client.getListenerService();
int numberOfListenersBeforeDestroy = listenerService.getRegistrations().size();
queryCache1.destroy();
queryCache2.destroy();
queryCache3.destroy();
final Map<UUID, ClientListenerRegistration> registrations = listenerService.getRegistrations();
// we expect at least 1 for backup listener and 1 listener for ProxyManager and
// we expect 3 listeners to be deleted one for each queryCache.
assertEquals(registrations.toString(), 3, numberOfListenersBeforeDestroy - registrations.size());
}
Aggregations