Search in sources :

Example 1 with CommandExecutorShutdown

use of es.bsc.compss.nio.commands.CommandExecutorShutdown in project compss by bsc-wdc.

the class NIOWorkerNode method shutdownExecutionManager.

@Override
public void shutdownExecutionManager(ExecutorShutdownListener esl) {
    if (started) {
        LOGGER.debug("Shutting down execution manager " + this.getName());
        if (node == null) {
            esl.notifyFailure(new UnstartedNodeException());
            LOGGER.error("Shutdown execution manager has failed");
        }
        Connection c = NIOAgent.getTransferManager().startConnection(node);
        commManager.shuttingDownEM(this, c, esl);
        CommandExecutorShutdown cmd = new CommandExecutorShutdown(null);
        c.sendCommand(cmd);
        c.receive();
        c.finishConnection();
    } else {
        LOGGER.debug("Worker " + this.getName() + " has not started. Considering execution manager stopped");
        esl.notifyEnd();
    }
}
Also used : CommandExecutorShutdown(es.bsc.compss.nio.commands.CommandExecutorShutdown) UnstartedNodeException(es.bsc.compss.exceptions.UnstartedNodeException) Connection(es.bsc.comm.Connection)

Aggregations

Connection (es.bsc.comm.Connection)1 UnstartedNodeException (es.bsc.compss.exceptions.UnstartedNodeException)1 CommandExecutorShutdown (es.bsc.compss.nio.commands.CommandExecutorShutdown)1