Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr/gitroot/simgrid/simgrid
[simgrid.git] / examples / java / async / dsend / Receiver.java
1 /* Copyright (c) 2006-2007, 2010, 2013-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 async.dsend;
8 import org.simgrid.msg.Msg;
9 import org.simgrid.msg.Comm;
10 import org.simgrid.msg.Host;
11 import org.simgrid.msg.Task;
12 import org.simgrid.msg.Process;
13 import org.simgrid.msg.HostFailureException;
14 import org.simgrid.msg.TaskCancelledException;
15 import org.simgrid.msg.TimeoutException;
16 import org.simgrid.msg.TransferFailureException;
17
18 public class Receiver extends Process {
19   public Receiver (Host host, String name) {
20     super(host,name);
21   }
22
23   public void main(String[] args) throws TransferFailureException, HostFailureException, TimeoutException {
24     Msg.info("Receiving on '"+ getHost().getName() + "'");
25     Task.receive(getHost().getName());
26     Msg.info("Received a task. I'm done. See you!");
27   }
28 }