Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Improved javadoc (yet not totally corrected). Added Derrick request for a kill (but...
authorLaurent Bobelin <lbobelin@mintcar.lip.ens-lyon.fr>
Tue, 18 Oct 2011 08:36:56 +0000 (10:36 +0200)
committerLaurent Bobelin <lbobelin@mintcar.lip.ens-lyon.fr>
Tue, 18 Oct 2011 08:36:56 +0000 (10:36 +0200)
org/simgrid/msg/ApplicationHandler.java
org/simgrid/msg/Host.java
org/simgrid/msg/Msg.java
org/simgrid/msg/Process.java
org/simgrid/msg/Sem.java
org/simgrid/msg/Task.java

index f983b9a..0b6178d 100644 (file)
@@ -14,6 +14,10 @@ package org.simgrid.msg;
 import java.util.Hashtable;
 import java.util.Vector;
 
 import java.util.Hashtable;
 import java.util.Vector;
 
+/**
+ *
+ * @author lbobelin
+ */
 public final class ApplicationHandler {
 
 
 public final class ApplicationHandler {
 
 
@@ -23,7 +27,10 @@ public final class ApplicationHandler {
                 */
                public  static Vector<String> args;
 
                 */
                public  static Vector<String> args;
 
-               public  static Hashtable<String,String> properties;
+        /**
+         *
+         */
+        public  static Hashtable<String,String> properties;
 
                /**
                 * The name of the host of the process.
 
                /**
                 * The name of the host of the process.
@@ -41,7 +48,9 @@ public final class ApplicationHandler {
                 * and clear the vector containing the arguments of the 
                 * previouse process function if needed.
                 *
                 * and clear the vector containing the arguments of the 
                 * previouse process function if needed.
                 *
-                * @host                                The host of the process to create.
+         * @param hostName_
+         * @param function_
+         * @host                               The host of the process to create.
                 * @function                    The function of the process to create.
                 *
                 */
                 * @function                    The function of the process to create.
                 *
                 */
@@ -60,23 +69,36 @@ public final class ApplicationHandler {
                 * It stores the argument of the function of the next
                 * process to create in the vector of arguments.
                 *
                 * It stores the argument of the function of the next
                 * process to create in the vector of arguments.
                 *
-                * @arg                                 The argument to add.
+         * @param arg
+         * @arg                                        The argument to add.
                 *
                 */ public  static void registerProcessArg(String arg) {
                         args.add(arg);
                 }
 
                 *
                 */ public  static void registerProcessArg(String arg) {
                         args.add(arg);
                 }
 
-                public  static void setProperty(String id, String value)
+         /**
+          *
+          * @param id
+          * @param value
+          */
+         public  static void setProperty(String id, String value)
                 {
                         properties.put(id,value);      
                 }
 
                 {
                         properties.put(id,value);      
                 }
 
-                public  static String getHostName()
+         /**
+          *
+          * @return
+          */
+         public  static String getHostName()
                 {
                         return hostName;
                 }
 
                 {
                         return hostName;
                 }
 
-                @SuppressWarnings("unchecked")
+         /**
+          *
+          */
+         @SuppressWarnings("unchecked")
                 public  static void createProcess() {
                         try {
                                 Class<Process> cls = (Class<Process>) Class.forName(function);
                 public  static void createProcess() {
                         try {
                                 Class<Process> cls = (Class<Process>) Class.forName(function);
@@ -116,29 +138,52 @@ public final class ApplicationHandler {
                 }
        
 
                 }
        
 
-       public  static void onStartDocument() {
+         /**
+          *
+          */
+         public  static void onStartDocument() {
                        args = new Vector<String>();
                        properties = new Hashtable<String,String>();
                        hostName = null;
                        function = null;
        }
 
                        args = new Vector<String>();
                        properties = new Hashtable<String,String>();
                        hostName = null;
                        function = null;
        }
 
-       public  static void onBeginProcess(String hostName, String function) {
+         /**
+          *
+          * @param hostName
+          * @param function
+          */
+         public  static void onBeginProcess(String hostName, String function) {
                setProcessIdentity(hostName, function);
                
        }
                setProcessIdentity(hostName, function);
                
        }
-       public  static void onProperty(String id, String value) {
+    /**
+     *
+     * @param id
+     * @param value
+     */
+    public  static void onProperty(String id, String value) {
                setProperty(id, value);
        }
 
                setProperty(id, value);
        }
 
-       public  static void onProcessArg(String arg) {
+    /**
+     *
+     * @param arg
+     */
+    public  static void onProcessArg(String arg) {
                registerProcessArg(arg);
        }
 
                registerProcessArg(arg);
        }
 
-       public  static void onEndProcess() {
+    /**
+     *
+     */
+    public  static void onEndProcess() {
                createProcess();
        }        
 
                createProcess();
        }        
 
-       public static void onEndDocument() {
+    /**
+     *
+     */
+    public static void onEndDocument() {
        }  
 }
        }  
 }
index de12f11..186a0ab 100644 (file)
@@ -56,7 +56,10 @@ public class Host {
         * User data.
         */ 
        private Object data;
         * User data.
         */ 
        private Object data;
-       protected Host() {
+    /**
+     *
+     */
+    protected Host() {
                this.bind = 0;
                this.data = null;
        };
                this.bind = 0;
                this.data = null;
        };
@@ -67,7 +70,8 @@ public class Host {
         *
         * @param name          The name of the host to get.
         *
         *
         * @param name          The name of the host to get.
         *
-        * @exception           HostNotFoundException if the name of the host is not valid.
+     * @return
+     * @exception              HostNotFoundException if the name of the host is not valid.
         *                                      NativeException if the native version of this method failed.
         */ 
        public static Host getByName(String name) 
         *                                      NativeException if the native version of this method failed.
         */ 
        public static Host getByName(String name) 
@@ -119,20 +123,26 @@ public class Host {
        /**
         * Sets the data of the host.
         *
        /**
         * Sets the data of the host.
         *
-        */ 
+     *
+     * @param data
+     */
        public void setData(Object data) {
                this.data = data;
        } 
        /**
         * Gets the data of the host.
        public void setData(Object data) {
                this.data = data;
        } 
        /**
         * Gets the data of the host.
-        */ 
+     *
+     * @return
+     */
        public Object getData() {
                return this.data;
        }
 
        /**
         * Checks whether a host has data.
        public Object getData() {
                return this.data;
        }
 
        /**
         * Checks whether a host has data.
-        */ 
+     *
+     * @return
+     */
        public boolean hasData() {
                return null != this.data;
        }
        public boolean hasData() {
                return null != this.data;
        }
@@ -158,7 +168,9 @@ public class Host {
                return MsgNative.hostGetSpeed(this);
        }
 
                return MsgNative.hostGetSpeed(this);
        }
 
-       /** This method tests if a host is avail. */
+    /** This method tests if a host is avail.
+     * @return
+     */
        public boolean isAvail() {
                return MsgNative.hostIsAvail(this);
        }
        public boolean isAvail() {
                return MsgNative.hostIsAvail(this);
        }
index da8f553..ef97310 100644 (file)
 
 package org.simgrid.msg;
 
 
 package org.simgrid.msg;
 
+/**
+ *
+ * @author lbobelin
+ */
 public final class Msg {
        /* Statically load the library which contains all native functions used in here */
        static {
 public final class Msg {
        /* Statically load the library which contains all native functions used in here */
        static {
@@ -26,7 +30,9 @@ public final class Msg {
        }
 
        /* FIXME: kill these C crufts */
        }
 
        /* FIXME: kill these C crufts */
-       /** Returns the last error code of the simulation */
+    /** Returns the last error code of the simulation
+     * @return
+     */
        public final static native int getErrCode();
 
        /** Everything is right. Keep on going the way ! */
        public final static native int getErrCode();
 
        /** Everything is right. Keep on going the way ! */
@@ -50,10 +56,14 @@ public final class Msg {
        /** You've done something wrong. You'd better look at it... */
        public static final int FATAL_ERROR = 5;
 
        /** You've done something wrong. You'd better look at it... */
        public static final int FATAL_ERROR = 5;
 
-       /** Retrieve the simulation time */
+    /** Retrieve the simulation time
+     * @return
+     */
        public final static native double getClock();
 
        public final static native double getClock();
 
-       /** Issue an information logging message */
+    /** Issue an information logging message
+     * @param s
+     */
        public final static native void info(String s);
 
        /*********************************************************************************
        public final static native void info(String s);
 
        /*********************************************************************************
@@ -90,11 +100,15 @@ public final class Msg {
        /**
         * The method to deploy the simulation.
         *
        /**
         * The method to deploy the simulation.
         *
-        * @param platformFile    The XML file which contains the description of the application to deploy.
-        */
+     *
+     * @param deploymentFile
+     */
        public final static native void deployApplication(String deploymentFile);
 
        public final static native void deployApplication(String deploymentFile);
 
-       /** Example launcher. You can use it or provide your own launcher, as you wish */
+    /** Example launcher. You can use it or provide your own launcher, as you wish
+     * @param args
+     * @throws MsgException
+     */
        static public void main(String[]args) throws MsgException {
                /* initialize the MSG simulation. Must be done before anything else (even logging). */
                Msg.init(args);
        static public void main(String[]args) throws MsgException {
                /* initialize the MSG simulation. Must be done before anything else (even logging). */
                Msg.init(args);
index 1c85cf0..c4fca95 100644 (file)
@@ -67,20 +67,33 @@ public abstract class Process extends Thread {
         */
        public long id;
 
         */
        public long id;
 
-       public Hashtable<String,String> properties;
+    /**
+     *
+     */
+    public Hashtable<String,String> properties;
 
        /**
         * The name of the process.                                                     
         */
        protected String name;
 
        /**
         * The name of the process.                                                     
         */
        protected String name;
-       public String msgName() {
+    /**
+     *
+     * @return
+     */
+    public String msgName() {
                return this.name;
        }
        /** The arguments of the method function of the process. */     
        public Vector<String> args;
 
        /* process synchronization tools */
                return this.name;
        }
        /** The arguments of the method function of the process. */     
        public Vector<String> args;
 
        /* process synchronization tools */
-       protected Sem schedBegin, schedEnd;
+    /**
+     *
+     */
+    /**
+     *
+     */
+    protected Sem schedBegin, schedEnd;
 
        /**
         * Default constructor (used in ApplicationHandler to initialize it)
 
        /**
         * Default constructor (used in ApplicationHandler to initialize it)
@@ -120,7 +133,8 @@ public abstract class Process extends Thread {
         * @param args                  The arguments of the main function of the process.
         *
         * @exception                   HostNotFoundException  if no host with this name exists.
         * @param args                  The arguments of the main function of the process.
         *
         * @exception                   HostNotFoundException  if no host with this name exists.
-        *                      NativeException
+     *                      NativeException
+     * @throws NativeException
         *
         */ 
        public Process(String hostname, String name, String args[]) throws HostNotFoundException, NativeException {
         *
         */ 
        public Process(String hostname, String name, String args[]) throws HostNotFoundException, NativeException {
@@ -176,12 +190,23 @@ public abstract class Process extends Thread {
                return MsgNative.processKillAll(resetPID);
        }
 
                return MsgNative.processKillAll(resetPID);
        }
 
+
+       /**
+        * This method kill the current process.
+        * @param process  the process to be killed.
+        *
+        */
+       public static void kill(Process process) {
+                MsgNative.processKill(process);
+       }
        /**
         * This method adds an argument in the list of the arguments of the main function
         * of the process. 
         *
         * @param arg                   The argument to add.
        /**
         * This method adds an argument in the list of the arguments of the main function
         * of the process. 
         *
         * @param arg                   The argument to add.
-        */
+     *
+     * @deprecated
+     */
        @Deprecated
        protected void addArg(String arg) {
                args.add(arg);
        @Deprecated
        protected void addArg(String arg) {
                args.add(arg);
@@ -218,7 +243,6 @@ public abstract class Process extends Thread {
         *
         * @return                              The host instance of the process.
         *
         *
         * @return                              The host instance of the process.
         *
-        * @exception                   NativeException on error in the native SimGrid code
         *
         */ 
        public Host getHost() {
         *
         */ 
        public Host getHost() {
@@ -283,7 +307,10 @@ public abstract class Process extends Thread {
        public static void waitFor(double seconds) throws HostFailureException {
                MsgNative.processWaitFor(seconds);
        } 
        public static void waitFor(double seconds) throws HostFailureException {
                MsgNative.processWaitFor(seconds);
        } 
-       public void showArgs() {
+    /**
+     *
+     */
+    public void showArgs() {
                Msg.info("[" + this.name + "/" + this.getHost().getName() + "] argc=" +
                                this.args.size());
                for (int i = 0; i < this.args.size(); i++)
                Msg.info("[" + this.name + "/" + this.getHost().getName() + "] argc=" +
                                this.args.size());
                for (int i = 0; i < this.args.size(); i++)
@@ -323,11 +350,17 @@ public abstract class Process extends Thread {
 
        /**
         * The main function of the process (to implement).
 
        /**
         * The main function of the process (to implement).
-        */
+     *
+     * @param args
+     * @throws MsgException
+     */
        public abstract void main(String[]args) throws MsgException;
 
 
        public abstract void main(String[]args) throws MsgException;
 
 
-       public void unschedule() {
+    /**
+     *
+     */
+    public void unschedule() {
                try {
                        schedEnd.release();
                        schedBegin.acquire();
                try {
                        schedEnd.release();
                        schedBegin.acquire();
@@ -335,7 +368,10 @@ public abstract class Process extends Thread {
                }
        }
 
                }
        }
 
-       public void schedule() {
+    /**
+     *
+     */
+    public void schedule() {
           //System.err.println("Scheduling process in Java");
                try {
                        schedBegin.release();
           //System.err.println("Scheduling process in Java");
                try {
                        schedBegin.release();
@@ -347,7 +383,10 @@ public abstract class Process extends Thread {
        }
 
        /** Send the given task in the mailbox associated with the specified alias  (waiting at most given time) 
        }
 
        /** Send the given task in the mailbox associated with the specified alias  (waiting at most given time) 
-        * @throws TimeoutException 
+     * @param mailbox
+     * @param task 
+     * @param timeout
+     * @throws TimeoutException
         * @throws HostFailureException 
         * @throws TransferFailureException */
        public void taskSend(String mailbox, Task task, double timeout) throws TransferFailureException, HostFailureException, TimeoutException {
         * @throws HostFailureException 
         * @throws TransferFailureException */
        public void taskSend(String mailbox, Task task, double timeout) throws TransferFailureException, HostFailureException, TimeoutException {
@@ -355,29 +394,59 @@ public abstract class Process extends Thread {
        }
 
        /** Send the given task in the mailbox associated with the specified alias
        }
 
        /** Send the given task in the mailbox associated with the specified alias
-        * @throws TimeoutException 
+     * @param mailbox
+     * @param task
+     * @throws TimeoutException
         * @throws HostFailureException 
         * @throws TransferFailureException */
        public void taskSend(String mailbox, Task task) throws  TransferFailureException, HostFailureException, TimeoutException {
                MsgNative.taskSend(mailbox, task, -1);
        }
 
         * @throws HostFailureException 
         * @throws TransferFailureException */
        public void taskSend(String mailbox, Task task) throws  TransferFailureException, HostFailureException, TimeoutException {
                MsgNative.taskSend(mailbox, task, -1);
        }
 
-       /** Receive a task on mailbox associated with the specified mailbox */
+    /** Receive a task on mailbox associated with the specified mailbox
+     * @param mailbox
+     * @return
+     * @throws TransferFailureException
+     * @throws HostFailureException
+     * @throws TimeoutException
+     */
        public Task taskReceive(String mailbox) throws TransferFailureException, HostFailureException, TimeoutException {
                return MsgNative.taskReceive(mailbox, -1.0, null);
        }
 
        public Task taskReceive(String mailbox) throws TransferFailureException, HostFailureException, TimeoutException {
                return MsgNative.taskReceive(mailbox, -1.0, null);
        }
 
-       /** Receive a task on mailbox associated with the specified alias (waiting at most given time) */
+    /** Receive a task on mailbox associated with the specified alias (waiting at most given time)
+     * @param mailbox
+     * @param timeout
+     * @return
+     * @throws TransferFailureException
+     * @throws HostFailureException
+     * @throws TimeoutException
+     */
        public Task taskReceive(String mailbox, double timeout) throws  TransferFailureException, HostFailureException, TimeoutException {
                return MsgNative.taskReceive(mailbox, timeout, null);
        }
 
        public Task taskReceive(String mailbox, double timeout) throws  TransferFailureException, HostFailureException, TimeoutException {
                return MsgNative.taskReceive(mailbox, timeout, null);
        }
 
-       /** Receive a task on mailbox associated with the specified alias from given sender */
+    /** Receive a task on mailbox associated with the specified alias from given sender
+     * @param mailbox
+     * @param host
+     * @param timeout
+     * @return
+     * @throws TransferFailureException
+     * @throws HostFailureException
+     * @throws TimeoutException
+     */
        public Task taskReceive(String mailbox, double timeout, Host host) throws  TransferFailureException, HostFailureException, TimeoutException {
                return MsgNative.taskReceive(mailbox, timeout, host);
        }
 
        public Task taskReceive(String mailbox, double timeout, Host host) throws  TransferFailureException, HostFailureException, TimeoutException {
                return MsgNative.taskReceive(mailbox, timeout, host);
        }
 
-       /** Receive a task on mailbox associated with the specified alias from given sender*/
+    /** Receive a task on mailbox associated with the specified alias from given sender
+     * @param mailbox
+     * @param host
+     * @return
+     * @throws TransferFailureException
+     * @throws HostFailureException
+     * @throws TimeoutException
+     */
        public Task taskReceive(String mailbox, Host host) throws  TransferFailureException, HostFailureException, TimeoutException {
                return MsgNative.taskReceive(mailbox, -1.0, host);
        }
        public Task taskReceive(String mailbox, Host host) throws  TransferFailureException, HostFailureException, TimeoutException {
                return MsgNative.taskReceive(mailbox, -1.0, host);
        }
index 84ab9f2..56f2368 100644 (file)
@@ -8,28 +8,54 @@
  * it and/or modify it under the terms of the license \r
  *(GNU LGPL) which comes with this package. \r
  */  \r
  * it and/or modify it under the terms of the license \r
  *(GNU LGPL) which comes with this package. \r
  */  \r
-\rpackage org.simgrid.msg;
-\r\rpublic class Sem {\r
+\r
+package org.simgrid.msg;\r
+\r
+\r
+/**\r
+ *\r
+ * @author lbobelin\r
+ */\r
+public class Sem {\r
        /******************************************************************/ \r
        /* Simple semaphore implementation, from Doug Lea (public domain) */ \r
        /******************************************************************/ \r
        /******************************************************************/ \r
        /* Simple semaphore implementation, from Doug Lea (public domain) */ \r
        /******************************************************************/ \r
-       private int permits_;
-\r      public Sem(int i) {\r            permits_ = i;\r  } \r\r    public void acquire() throws InterruptedException {
-               if (Thread.interrupted())
-                       throw new InterruptedException();
-\r              synchronized(this) {
-                       try {
-                               while (permits_ <= 0)
-                                       wait();
-                               --permits_;
-                       }
-                       catch(InterruptedException ex) {
-                               notify();
-                               throw ex;
-                       }
-               }
-       }
-\r      public synchronized void release() {
-               ++(this.permits_);
-               notify();
-       } \r\r
+       private int permits_;\r
+\r
+    /**\r
+     *\r
+     * @param i\r
+     */\r
+    public Sem(int i) {\r
+               permits_ = i;\r
+       } \r
+\r
+    /**\r
+     *\r
+     * @throws java.lang.InterruptedException\r
+     */\r
+    public void acquire() throws InterruptedException {\r
+               if (Thread.interrupted())\r
+                       throw new InterruptedException();\r
+\r
+               synchronized(this) {\r
+                       try {\r
+                               while (permits_ <= 0)\r
+                                       wait();\r
+                               --permits_;\r
+                       }\r
+                       catch(InterruptedException ex) {\r
+                               notify();\r
+                               throw ex;\r
+                       }\r
+               }\r
+       }\r
+\r
+    /**\r
+     *\r
+     */\r
+    public synchronized void release() {\r
+               ++(this.permits_);\r
+               notify();\r
+       } \r
+} \r
index 25fbe79..830805e 100644 (file)
@@ -64,7 +64,9 @@ public class Task {
        /* *                   * *
         * * Getters / Setters * *
         * *                   * */
        /* *                   * *
         * * Getters / Setters * *
         * *                   * */
-       /** Gets the name of a task */ 
+    /** Gets the name of a task
+     * @return
+     */
        public String getName() {
                return MsgNative.taskGetName(this);
        }
        public String getName() {
                return MsgNative.taskGetName(this);
        }
@@ -72,15 +74,21 @@ public class Task {
        Process getSender() {
                return MsgNative.taskGetSender(this);
        }
        Process getSender() {
                return MsgNative.taskGetSender(this);
        }
-       /** Gets the source of the task */ 
+    /** Gets the source of the task
+     * @return
+     */
        public Host getSource()  {
                return MsgNative.taskGetSource(this);
        }
        public Host getSource()  {
                return MsgNative.taskGetSource(this);
        }
-       /** Gets the computing amount of the task */ 
+    /** Gets the computing amount of the task
+     * @return
+     */
        public double getComputeDuration() {
                return MsgNative.taskGetComputeDuration(this);
        }
        public double getComputeDuration() {
                return MsgNative.taskGetComputeDuration(this);
        }
-       /** Gets the remaining computation of the task */ 
+    /** Gets the remaining computation of the task
+     * @return
+     */
        public double getRemainingDuration() {
                return MsgNative.taskGetRemainingDuration(this);
        }
        public double getRemainingDuration() {
                return MsgNative.taskGetRemainingDuration(this);
        }
@@ -106,15 +114,16 @@ public class Task {
        /**
         * Executes a task on the location on which the process is running.
         *
        /**
         * Executes a task on the location on which the process is running.
         *
-        * @exception HostFailureException,TaskCancelledException 
-        */ 
+     *
+     * @throws HostFailureException
+     * @throws TaskCancelledException
+     */
        public void execute() throws HostFailureException,TaskCancelledException {
                MsgNative.taskExecute(this);
        }
        /**
         * Cancels a task.
         *
        public void execute() throws HostFailureException,TaskCancelledException {
                MsgNative.taskExecute(this);
        }
        /**
         * Cancels a task.
         *
-        * @exception NativeException if the cancellation failed.
         */ 
        public void cancel()  {
                MsgNative.taskCancel(this);
         */ 
        public void cancel()  {
                MsgNative.taskCancel(this);
@@ -131,7 +140,8 @@ public class Task {
        /**
         * Sends the task on the mailbox identified by the specified name 
         *
        /**
         * Sends the task on the mailbox identified by the specified name 
         *
-        * @throws TimeoutException 
+     * @param mailbox
+     * @throws TimeoutException
         * @throws HostFailureException 
         * @throws TransferFailureException 
         */
         * @throws HostFailureException 
         * @throws TransferFailureException 
         */
@@ -142,7 +152,9 @@ public class Task {
        /**
         * Sends the task on the mailbox identified by the specified name (wait at most \a timeout seconds)
         *
        /**
         * Sends the task on the mailbox identified by the specified name (wait at most \a timeout seconds)
         *
-        * @exception  NativeException if the retrieval fails.
+     * @param mailbox
+     * @param timeout
+     * @exception  NativeException if the retrieval fails.
         * @throws TimeoutException 
         * @throws HostFailureException 
         * @throws TransferFailureException 
         * @throws TimeoutException 
         * @throws HostFailureException 
         * @throws TransferFailureException 
@@ -154,7 +166,11 @@ public class Task {
        /**
         * Sends the task on the mailbox identified by the specified alias  (capping the sending rate to \a maxrate) 
         *
        /**
         * Sends the task on the mailbox identified by the specified alias  (capping the sending rate to \a maxrate) 
         *
-        * @exception  TransferFailureException, HostFailureException, TimeoutException.
+     * @param alias
+     * @param maxrate 
+     * @throws TransferFailureException
+     * @throws HostFailureException
+     * @throws TimeoutException
         */
        public void sendBounded(String alias, double maxrate) throws TransferFailureException, HostFailureException, TimeoutException {
                MsgNative.taskSendBounded(alias, this, maxrate);
         */
        public void sendBounded(String alias, double maxrate) throws TransferFailureException, HostFailureException, TimeoutException {
                MsgNative.taskSendBounded(alias, this, maxrate);
@@ -163,7 +179,11 @@ public class Task {
        /**
         * Retrieves next task from the mailbox identified by the specified name
         *
        /**
         * Retrieves next task from the mailbox identified by the specified name
         *
-        * @exception  TransferFailureException, HostFailureException, TimeoutException if the retrieval fails.
+     * @param mailbox
+     * @return
+     * @throws TransferFailureException
+     * @throws HostFailureException
+     * @throws TimeoutException
         */
 
        public static Task receive(String mailbox) throws TransferFailureException, HostFailureException, TimeoutException {
         */
 
        public static Task receive(String mailbox) throws TransferFailureException, HostFailureException, TimeoutException {
@@ -173,7 +193,12 @@ public class Task {
        /**
         * Retrieves next task on the mailbox identified by the specified name (wait at most \a timeout seconds)
         *
        /**
         * Retrieves next task on the mailbox identified by the specified name (wait at most \a timeout seconds)
         *
-        * @exception  TransferFailureException, HostFailureException, TimeoutException if the retrieval fails.
+     * @param mailbox
+     * @param timeout
+     * @return 
+     * @throws TransferFailureException
+     * @throws HostFailureException
+     * @throws TimeoutException
         */
        public static Task receive(String mailbox, double timeout) throws  TransferFailureException, HostFailureException, TimeoutException {
                return MsgNative.taskReceive(mailbox, timeout, null);
         */
        public static Task receive(String mailbox, double timeout) throws  TransferFailureException, HostFailureException, TimeoutException {
                return MsgNative.taskReceive(mailbox, timeout, null);
@@ -182,7 +207,12 @@ public class Task {
        /**
         * Retrieves next task sent by a given host on the mailbox identified by the specified alias 
         *
        /**
         * Retrieves next task sent by a given host on the mailbox identified by the specified alias 
         *
-        * @exception  TransferFailureException, HostFailureException, TimeoutException if the retrieval fails.
+     * @param mailbox
+     * @param host
+     * @return
+     * @throws TransferFailureException
+     * @throws TimeoutException
+     * @throws HostFailureException
         */
 
        public static Task receive(String mailbox, Host host) throws TransferFailureException, HostFailureException, TimeoutException {
         */
 
        public static Task receive(String mailbox, Host host) throws TransferFailureException, HostFailureException, TimeoutException {
@@ -192,7 +222,13 @@ public class Task {
        /**
         * Retrieves next task sent by a given host on the mailbox identified by the specified alias (wait at most \a timeout seconds)
         *
        /**
         * Retrieves next task sent by a given host on the mailbox identified by the specified alias (wait at most \a timeout seconds)
         *
-        * @exception  TransferFailureException, HostFailureException, TimeoutException if the retrieval fails.
+     * @param mailbox
+     * @param timeout 
+     * @param host
+     * @return 
+     * @throws TransferFailureException
+     * @throws HostFailureException
+     * @throws TimeoutException
         */
        public static Task receive(String mailbox, double timeout, Host host) throws TransferFailureException, HostFailureException, TimeoutException {
                return MsgNative.taskReceive(mailbox, timeout, host);
         */
        public static Task receive(String mailbox, double timeout, Host host) throws TransferFailureException, HostFailureException, TimeoutException {
                return MsgNative.taskReceive(mailbox, timeout, host);
@@ -201,14 +237,20 @@ public class Task {
        /**
         * Tests whether there is a pending communication on the mailbox identified by the specified alias, and who sent it
         *
        /**
         * Tests whether there is a pending communication on the mailbox identified by the specified alias, and who sent it
         *
-        */ 
+     *
+     * @param mailbox
+     * @return
+     */
        public static int listenFrom(String mailbox)  {
                return MsgNative.taskListenFrom(mailbox);
        }
        /**
         * Listen whether there is a waiting task on the mailbox identified by the specified alias
         *
        public static int listenFrom(String mailbox)  {
                return MsgNative.taskListenFrom(mailbox);
        }
        /**
         * Listen whether there is a waiting task on the mailbox identified by the specified alias
         *
-        */ 
+     *
+     * @param mailbox
+     * @return
+     */
        public static boolean listen(String mailbox)   {
                return MsgNative.taskListen(mailbox);
        }
        public static boolean listen(String mailbox)   {
                return MsgNative.taskListen(mailbox);
        }
@@ -216,7 +258,11 @@ public class Task {
        /**
         * Counts the number of tasks waiting to be received on the \a mailbox identified by the specified alia and sended by the specified \a host.
         *
        /**
         * Counts the number of tasks waiting to be received on the \a mailbox identified by the specified alia and sended by the specified \a host.
         *
-        */ 
+     *
+     * @param alias
+     * @param host
+     * @return
+     */
        public static int listenFromHost(String alias, Host host)   {
                return MsgNative.taskListenFromHost(alias, host);
        }
        public static int listenFromHost(String alias, Host host)   {
                return MsgNative.taskListenFromHost(alias, host);
        }