Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
8f2140a3c4467544168e9d9e43514751afa9d60f
[simgrid.git] / examples / master_slave_kill / Slave.java
1 /*
2  * Copyright 2006,2007,2010. The SimGrid Team. 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 master_slave_kill;
8 import org.simgrid.msg.HostFailureException;
9 import org.simgrid.msg.HostNotFoundException;
10 import org.simgrid.msg.Msg;
11 import org.simgrid.msg.Task;
12 import org.simgrid.msg.TimeoutException;
13 import org.simgrid.msg.TransferFailureException;
14 import org.simgrid.msg.Process;
15
16 import master_slave_kill.FinalizeTask;
17
18 public class Slave extends Process {
19         public Slave(String hostname, String name) throws HostNotFoundException {
20                 super(hostname, name);
21         }
22         public void main(String[] args) throws TransferFailureException, HostFailureException, TimeoutException {
23         Msg.info("Slave Hello!");
24         
25         FinalizeTask task = new FinalizeTask();
26         Msg.info("Send Mail1!");
27         task.send("mail1");
28         
29         Msg.info("Send Mail2 !");
30         Task task2 = Task.receive("mail2");
31          Msg.info("Receive Mail2!");
32   }
33 }