Search in sources :

Example 1 with RegistrationOperation

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

the class EventServiceImpl method invokeRegistrationOnOtherNodes.

private void invokeRegistrationOnOtherNodes(String serviceName, Registration reg) {
    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()) {
            RegistrationOperation operation = new RegistrationOperation(reg);
            Future f = operationService.invokeOnTarget(serviceName, operation, member.getAddress());
            calls.add(f);
        }
    }
    waitWithDeadline(calls, REGISTRATION_TIMEOUT_SECONDS, TimeUnit.SECONDS, registrationExceptionHandler);
}
Also used : ArrayList(java.util.ArrayList) Future(java.util.concurrent.Future) OperationService(com.hazelcast.spi.OperationService) RegistrationOperation(com.hazelcast.spi.impl.eventservice.impl.operations.RegistrationOperation) PostJoinRegistrationOperation(com.hazelcast.spi.impl.eventservice.impl.operations.PostJoinRegistrationOperation) Member(com.hazelcast.core.Member)

Aggregations

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