use of com.hazelcast.client.ClientEndpoint in project hazelcast by hazelcast.
the class AbstractAllPartitionsMessageTask method processMessage.
@Override
protected void processMessage() throws Exception {
ClientEndpoint endpoint = getEndpoint();
OperationFactory operationFactory = new OperationFactoryWrapper(createOperationFactory(), endpoint.getUuid());
final InternalOperationService operationService = nodeEngine.getOperationService();
Map<Integer, Object> map = operationService.invokeOnAllPartitions(getServiceName(), operationFactory);
sendResponse(reduce(map));
}
use of com.hazelcast.client.ClientEndpoint in project hazelcast by hazelcast.
the class AddMembershipListenerMessageTask method call.
@Override
protected Object call() {
String serviceName = ClusterServiceImpl.SERVICE_NAME;
ClusterServiceImpl service = getService(serviceName);
ClientEndpoint endpoint = getEndpoint();
String registrationId = service.addMembershipListener(new MembershipListenerImpl(endpoint));
endpoint.addListenerDestroyAction(serviceName, serviceName, registrationId);
return registrationId;
}
use of com.hazelcast.client.ClientEndpoint 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);
}
}
use of com.hazelcast.client.ClientEndpoint in project hazelcast by hazelcast.
the class CacheAddEntryListenerMessageTask method call.
@Override
protected Object call() {
ClientEndpoint endpoint = getEndpoint();
final CacheService service = getService(CacheService.SERVICE_NAME);
CacheEntryListener cacheEntryListener = new CacheEntryListener(endpoint, this);
final String registrationId = service.registerListener(parameters.name, cacheEntryListener, cacheEntryListener, parameters.localOnly);
endpoint.addDestroyAction(registrationId, new Callable<Boolean>() {
@Override
public Boolean call() throws Exception {
return service.deregisterListener(parameters.name, registrationId);
}
});
return registrationId;
}
use of com.hazelcast.client.ClientEndpoint in project hazelcast by hazelcast.
the class MapPublisherCreateWithValueMessageTask method createInvocations.
private void createInvocations(Collection<MemberImpl> members, List<Future> futures) {
final InternalOperationService operationService = nodeEngine.getOperationService();
final ClientEndpoint endpoint = getEndpoint();
for (MemberImpl member : members) {
Predicate predicate = serializationService.toObject(parameters.predicate);
AccumulatorInfo accumulatorInfo = AccumulatorInfo.createAccumulatorInfo(parameters.mapName, parameters.cacheName, predicate, parameters.batchSize, parameters.bufferSize, parameters.delaySeconds, true, parameters.populate, parameters.coalesce);
PublisherCreateOperation operation = new PublisherCreateOperation(accumulatorInfo);
operation.setCallerUuid(endpoint.getUuid());
Address address = member.getAddress();
InvocationBuilder invocationBuilder = operationService.createInvocationBuilder(SERVICE_NAME, operation, address);
Future future = invocationBuilder.invoke();
futures.add(future);
}
}
Aggregations