1 /* Copyright (c) 2006-2020. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
7 import org.simgrid.msg.Msg;
8 import org.simgrid.msg.Process;
9 import org.simgrid.msg.MsgException;
10 import org.simgrid.msg.HostNotFoundException;
12 public class Killer extends Process {
13 public Killer(String hostname, String name) throws HostNotFoundException {
14 super(hostname, name);
16 public void main(String[] args) throws MsgException {
17 Victim poorVictim = null;
20 poorVictim = new Victim("Boivin","victim");
22 } catch (MsgException e){
24 Msg.error("Cannot create the victim process!");
28 Msg.info("Resume Process");
31 Msg.info("Kill Process");
34 Msg.info("Ok, goodbye now.");
35 // The actor can also commit a suicide with the following command
36 exit(); // This will forcefully stop the current actor
37 // Of course, it's not useful here at the end of the main function, but that's for the example (and to check that this still works in the automated tests)