}
@Override
public void onFinalized(Run r) {
super.onFinalized(r);
Computer computer = r.getExecutor().getOwner();
Node node = computer.getNode();
if (node instanceof VirtualMachineSlave) {
VirtualMachineSlave slave = (VirtualMachineSlave)node;
if (slave.getRebootAfterRun()) {
try {
System.err.println("NukeSlaveListener about to disconnect. the next error bitching about a slave disconnecting is normal");
computer.getChannel().syncLocalIO();
computer.getChannel().close();
computer.disconnect(null);
computer.waitUntilOffline();
} catch (Exception e) {
}
VirtualMachineLauncher launcher = (VirtualMachineLauncher)slave.getLauncher();
VirtualMachine virtualMachine = launcher.getVirtualMachine();