use of es.bsc.compss.nio.commands.CommandShutdown in project compss by bsc-wdc.
the class NIOWorkerNode method stop.
@Override
public void stop(ShutdownListener sl) {
if (started) {
LOGGER.debug("Shutting down " + this.getName());
if (node == null) {
sl.notifyFailure(new UnstartedNodeException());
LOGGER.error("Shutdown has failed");
}
Connection c = NIOAgent.getTransferManager().startConnection(node);
commManager.shuttingDown(this, c, sl);
CommandShutdown cmd = new CommandShutdown(null, null);
c.sendCommand(cmd);
c.receive();
c.finishConnection();
} else {
LOGGER.debug("Worker " + this.getName() + " has not started. Setting this to be stopped");
workerStarter.setToStop();
sl.notifyEnd();
}
}
Aggregations