X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/dc3c3416c4cca30fef7c29422d45094687f59893..f06041cf2c450457a0b47a49b66b19cb9133c18e:/examples/java/cloud/Slave.java diff --git a/examples/java/cloud/Slave.java b/examples/java/cloud/Slave.java index 01e646ff89..d97b0be612 100644 --- a/examples/java/cloud/Slave.java +++ b/examples/java/cloud/Slave.java @@ -1,9 +1,9 @@ -/* - * Copyright 2012. The SimGrid Team. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the license (GNU LGPL) which comes with this package. - */ +/* Copyright (c) 2012-2014. The SimGrid Team. + * All rights reserved. */ + +/* This program is free software; you can redistribute it and/or modify it + * under the terms of the license (GNU LGPL) which comes with this package. */ + package cloud; import org.simgrid.msg.Host; @@ -15,15 +15,15 @@ import org.simgrid.msg.Task; public class Slave extends Process { private int number; public Slave(Host host, int number) { - super(host,"Slave " + number,null); + super(host,"WRK0" + number,null); this.number = number; } public void main(String[] args) throws MsgException { + Msg.info(this.getName() +" is listenning on MBOX:WRK0"+ number); while(true) { - Msg.info("Receiving on " + "slave_" + number); Task task; try { - task = Task.receive("slave_"+number); + task = Task.receive("MBOX:WRK0"+number); } catch (MsgException e) { Msg.debug("Received failed. I'm done. See you!"); break; @@ -38,9 +38,9 @@ public class Slave extends Process { } catch (MsgException e) { } - Msg.info("\"" + task.getName() + "\" done "); + Msg.info(this.getName() +" executed task (" + task.getName()+")"); } } -} \ No newline at end of file +}