use of com.hazelcast.spi.ClientAwareService in project hazelcast by hazelcast.
the class ClientDisconnectionOperation method run.
@Override
public void run() throws Exception {
ClientEngineImpl engine = getService();
final ClientEndpointManagerImpl endpointManager = (ClientEndpointManagerImpl) engine.getEndpointManager();
if (!engine.removeOwnershipMapping(clientUuid, memberUuid)) {
return;
}
Set<ClientEndpoint> endpoints = endpointManager.getEndpoints(clientUuid);
// This part cleans up listener and transactions
for (ClientEndpoint endpoint : endpoints) {
endpoint.getConnection().close("ClientDisconnectionOperation: Client disconnected from cluster", null);
}
// This part cleans up locks conditions semaphore etc..
NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine();
nodeEngine.onClientDisconnected(clientUuid);
Collection<ClientAwareService> services = nodeEngine.getServices(ClientAwareService.class);
for (ClientAwareService service : services) {
service.clientDisconnected(clientUuid);
}
}
Aggregations