Search in sources :

Example 1 with DeregistrationOperation

use of com.hazelcast.spi.impl.eventservice.impl.operations.DeregistrationOperation in project hazelcast by hazelcast.

the class EventServiceImpl method invokeDeregistrationOnOtherNodes.

private void invokeDeregistrationOnOtherNodes(String serviceName, String topic, String id) {
    OperationService operationService = nodeEngine.getOperationService();
    Collection<Member> members = nodeEngine.getClusterService().getMembers();
    Collection<Future> calls = new ArrayList<Future>(members.size());
    for (Member member : members) {
        if (!member.localMember()) {
            DeregistrationOperation operation = new DeregistrationOperation(topic, id);
            Future f = operationService.invokeOnTarget(serviceName, operation, member.getAddress());
            calls.add(f);
        }
    }
    waitWithDeadline(calls, DEREGISTER_TIMEOUT_SECONDS, TimeUnit.SECONDS, deregistrationExceptionHandler);
}
Also used : ArrayList(java.util.ArrayList) Future(java.util.concurrent.Future) OperationService(com.hazelcast.spi.OperationService) Member(com.hazelcast.core.Member) DeregistrationOperation(com.hazelcast.spi.impl.eventservice.impl.operations.DeregistrationOperation)

Aggregations

Member (com.hazelcast.core.Member)1 OperationService (com.hazelcast.spi.OperationService)1 DeregistrationOperation (com.hazelcast.spi.impl.eventservice.impl.operations.DeregistrationOperation)1 ArrayList (java.util.ArrayList)1 Future (java.util.concurrent.Future)1