Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines with new year.
[simgrid.git] / examples / java / async / dsend / Receiver.java
1 /* Copyright (c) 2006-2019. 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.Host;
10 import org.simgrid.msg.Task;
11 import org.simgrid.msg.Process;
12 import org.simgrid.msg.HostFailureException;
13 import org.simgrid.msg.TimeoutException;
14 import org.simgrid.msg.TransferFailureException;
15
16 public class Receiver extends Process {
17   public Receiver (Host host, String name) {
18     super(host,name);
19   }
20
21   @Override
22   public void main(String[] args) throws TransferFailureException, HostFailureException, TimeoutException {
23     Msg.info("Receiving on '"+ getHost().getName() + "'");
24     Task.receive(getHost().getName());
25     Msg.info("Received a task. I'm done. See you!");
26   }
27 }