Search in sources :

Example 1 with ShutdownOperation

use of com.hazelcast.scheduledexecutor.impl.operations.ShutdownOperation in project hazelcast by hazelcast.

the class ScheduledExecutorServiceProxy method shutdown.

@Override
public void shutdown() {
    NodeEngine nodeEngine = getNodeEngine();
    Collection<Member> members = nodeEngine.getClusterService().getMembers();
    OperationService operationService = nodeEngine.getOperationService();
    Collection<Future> calls = new LinkedList<Future>();
    for (Member member : members) {
        if (member.localMember()) {
            getService().shutdownExecutor(name);
        } else {
            Operation op = new ShutdownOperation(name);
            calls.add(operationService.invokeOnTarget(SERVICE_NAME, op, member.getAddress()));
        }
    }
    waitWithDeadline(calls, SHUTDOWN_TIMEOUT, TimeUnit.SECONDS, WHILE_SHUTDOWN_EXCEPTION_HANDLER);
}
Also used : NodeEngine(com.hazelcast.spi.NodeEngine) Future(java.util.concurrent.Future) IScheduledFuture(com.hazelcast.scheduledexecutor.IScheduledFuture) ShutdownOperation(com.hazelcast.scheduledexecutor.impl.operations.ShutdownOperation) OperationService(com.hazelcast.spi.OperationService) GetAllScheduledOnMemberOperation(com.hazelcast.scheduledexecutor.impl.operations.GetAllScheduledOnMemberOperation) ScheduleTaskOperation(com.hazelcast.scheduledexecutor.impl.operations.ScheduleTaskOperation) Operation(com.hazelcast.spi.Operation) ShutdownOperation(com.hazelcast.scheduledexecutor.impl.operations.ShutdownOperation) Member(com.hazelcast.core.Member) LinkedList(java.util.LinkedList)

Example 2 with ShutdownOperation

use of com.hazelcast.scheduledexecutor.impl.operations.ShutdownOperation in project hazelcast by hazelcast.

the class ScheduledExecutorShutdownMessageTask method prepareOperation.

@Override
protected Operation prepareOperation() {
    Operation op = new ShutdownOperation(parameters.schedulerName);
    op.setCallerUuid(endpoint.getUuid());
    return op;
}
Also used : ShutdownOperation(com.hazelcast.scheduledexecutor.impl.operations.ShutdownOperation) Operation(com.hazelcast.spi.Operation) ShutdownOperation(com.hazelcast.scheduledexecutor.impl.operations.ShutdownOperation)

Aggregations

ShutdownOperation (com.hazelcast.scheduledexecutor.impl.operations.ShutdownOperation)2 Operation (com.hazelcast.spi.Operation)2 Member (com.hazelcast.core.Member)1 IScheduledFuture (com.hazelcast.scheduledexecutor.IScheduledFuture)1 GetAllScheduledOnMemberOperation (com.hazelcast.scheduledexecutor.impl.operations.GetAllScheduledOnMemberOperation)1 ScheduleTaskOperation (com.hazelcast.scheduledexecutor.impl.operations.ScheduleTaskOperation)1 NodeEngine (com.hazelcast.spi.NodeEngine)1 OperationService (com.hazelcast.spi.OperationService)1 LinkedList (java.util.LinkedList)1 Future (java.util.concurrent.Future)1