Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
d8feef4806df40f2b6aa831a5086966bcf8bc38b
[simgrid.git] / examples / java / startKillTime / Slave.java
1 /* Copyright (c) 2006-2014, 2016. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 package startKillTime;
8 import org.simgrid.msg.Msg;
9 import org.simgrid.msg.Host;
10 import org.simgrid.msg.Process;
11 import org.simgrid.msg.MsgException;
12
13 /* Lazy Guy Slave, suspends itself ASAP */
14 public class Slave extends Process {
15   public Slave(Host host, String name, String[]args) {
16     super(host,name,args);
17   }
18
19   public void main(String[] args) throws MsgException {
20     Msg.info("Hello!");
21     try {
22       waitFor(10.0);
23       Msg.info("OK, goodbye now.");
24     } catch (MsgException e) {
25       Msg.debug("Wait cancelled.");
26     }
27   }
28 }