Logo AND Algorithmique Numérique Distribuée

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