Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Typo in Task javadoc
[simgrid.git] / src / bindings / java / org / simgrid / msg / Task.java
index 16e54ef..615630f 100644 (file)
@@ -35,25 +35,25 @@ public class Task {
         * * Constructors * *
         * *              * */
        /**
-        * Construct an new task with the specified processing amount and amount
+        * Construct a new task with the specified processing amount and amount
         * of data needed.
         *
         * @param name  Task's name
         *
         * @param flopsAmount   A value of the processing amount (in flop) needed to process the task. 
         *                              If 0, then it cannot be executed with the execute() method.
-        *                              This value has to be >= 0.
+        *                              This value has to be ≥ 0.
         *
         * @param bytesAmount           A value of amount of data (in bytes) needed to transfert this task.
         *                              If 0, then it cannot be transfered with the get() and put() methods.
-        *                              This value has to be >= 0.
+        *                              This value has to be ≥ 0.
         */ 
        public Task(String name, double flopsAmount, double bytesAmount) {
                create(name, flopsAmount, bytesAmount);
                this.messageSize = bytesAmount;
        }
        /**
-        * Construct an new parallel task with the specified processing amount and amount for each host
+        * Construct a new parallel task with the specified processing amount and amount for each host
         * implied.
         *
         * @param name          The name of the parallel task.
@@ -68,7 +68,7 @@ public class Task {
        /**
         * The natively implemented method to create a MSG task.
         *
-        * @param name            The name of th task.
+        * @param name            The name of the task.
         * @param flopsAmount    A value of the processing amount (in flop) needed 
         *                        to process the task. If 0, then it cannot be executed
         *                        with the execute() method. This value has to be >= 0.
@@ -100,7 +100,7 @@ public class Task {
        /* *                   * *
         * * Getters / Setters * *
         * *                   * */
-       /** Gets the name of a task */
+       /** Gets the name of the task */
        public String getName() {
                return name;
        }
@@ -167,13 +167,13 @@ public class Task {
                try {
                        // Exceptions in finalizers lead to bad situations:
                        // http://stackoverflow.com/questions/7644556/troubleshooting-a-java-memory-leak-finalization
-                       doFinalize();
+                       nativeFinalize();
                        bind=0; // to avoid segfaults if the impossible happens yet again making this task surviving its finalize()
-               } catch (Exception e) {
+               } catch (Throwable e) {
                        e.printStackTrace();
                }
        }
-       protected native void doFinalize();
+       protected native void nativeFinalize();
        /* *                       * *
         * * Communication-related * *
         * *                       * */
@@ -199,7 +199,7 @@ public class Task {
         * @throws HostFailureException 
         * @throws TransferFailureException 
         */
-       public void send(String mailbox) throws TransferFailureException, HostFailureException, TimeoutException {
+       public void send(String mailbox) throws TransferFailureException, HostFailureException, TimeoutException, NativeException {
                send(mailbox, -1);
        } 
 
@@ -213,7 +213,7 @@ public class Task {
         * @throws HostFailureException 
         * @throws TransferFailureException 
         */
-       public native void send(String mailbox, double timeout) throws TransferFailureException, HostFailureException, TimeoutException;
+       public native void send(String mailbox, double timeout) throws TransferFailureException, HostFailureException, TimeoutException, NativeException;
 
        /** Sends the task on the specified mailbox (capping the sending rate to \a maxrate) 
         *
@@ -349,7 +349,7 @@ public class Task {
         */
        public native static int listenFrom(String mailbox);
        /**
-        * Listen whether there is a waiting task on the mailbox identified by the specified alias
+        * Listen whether there is a task waiting (either for a send or a recv) on the mailbox identified by the specified alias
         */
        public native static boolean listen(String mailbox);
 
@@ -363,7 +363,7 @@ public class Task {
         */
        public static native void nativeInit();
        static {
-               Msg.nativeInit();
+               org.simgrid.NativeLib.nativeInit();
                nativeInit();
        }