Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix the examples now that they can throw potentially more exception types
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 17 Mar 2010 11:22:47 +0000 (11:22 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 17 Mar 2010 11:22:47 +0000 (11:22 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7264 48e7efb5-ca39-0410-a469-dd3cf9ba447f

examples/java/basic/Forwarder.java
examples/java/basic/Master.java
examples/java/comm_time/Master.java
examples/java/ping_pong/Sender.java
src/java/simgrid/msg/Process.java
src/java/simgrid/msg/Task.java

index 46d1186..741133f 100644 (file)
@@ -9,7 +9,7 @@ import simgrid.msg.*;
 
 public class Forwarder extends simgrid.msg.Process {
     
-   public void main(String[] args) throws NativeException {
+   public void main(String[] args) throws MsgException {
       if (args.length < 3) {    
         Msg.info("Forwarder needs 3 arguments (input mailbox, first output mailbox, last one)");
         Msg.info("Got "+args.length+" instead");
index 90e55dc..eab3bf5 100644 (file)
@@ -10,7 +10,7 @@
 import simgrid.msg.*;
 
 public class Master extends simgrid.msg.Process {
-   public void main(String[] args) throws NativeException {
+   public void main(String[] args) throws MsgException {
       if (args.length < 4) {
         Msg.info("Master needs 4 arguments");
         System.exit(1);
index 38ca35b..c2bbc5c 100644 (file)
@@ -10,7 +10,7 @@
 import simgrid.msg.*;
 
 public class Master extends simgrid.msg.Process {
-   public void main(String[] args) throws NativeException {
+   public void main(String[] args) throws MsgException {
       if (args.length < 4) {
         Msg.info("Master needs 4 arguments");
         System.exit(1);
index eca3688..17f2dfd 100644 (file)
@@ -14,7 +14,7 @@ public class Sender extends simgrid.msg.Process {
     private final double commSizeLat = 1;
     final double commSizeBw = 100000000;
    
-    public void main(String[] args) throws NativeException {
+    public void main(String[] args) throws MsgException {
        
        Msg.info("hello!");
         
index 5a0fafc..f1e8049 100644 (file)
@@ -334,7 +334,7 @@ public abstract class Process extends Thread {
        /**
         * The main function of the process (to implement).
         */
-       public abstract void main(String[]args) throws NativeException;
+       public abstract void main(String[]args) throws MsgException;
 
 
        public void unschedule() {
@@ -353,13 +353,19 @@ public abstract class Process extends Thread {
                }
        }
 
-       /** Send the given task in the mailbox associated with the specified alias  (waiting at most given time) */
-       public void taskSend(String mailbox, Task task, double timeout) throws NativeException {
+       /** Send the given task in the mailbox associated with the specified alias  (waiting at most given time) 
+        * @throws TimeoutException 
+        * @throws HostFailureException 
+        * @throws TransferFailureException */
+       public void taskSend(String mailbox, Task task, double timeout) throws NativeException, TransferFailureException, HostFailureException, TimeoutException {
                MsgNative.taskSend(mailbox, task, timeout);
        }
 
-       /** Send the given task in the mailbox associated with the specified alias*/
-       public void taskSend(String mailbox, Task task) throws NativeException {
+       /** Send the given task in the mailbox associated with the specified alias
+        * @throws TimeoutException 
+        * @throws HostFailureException 
+        * @throws TransferFailureException */
+       public void taskSend(String mailbox, Task task) throws NativeException, TransferFailureException, HostFailureException, TimeoutException {
                MsgNative.taskSend(mailbox, task, -1);
        }
 
index 52f48b4..3c54be4 100644 (file)
@@ -132,8 +132,11 @@ public class Task {
         * Sends the task on the mailbox identified by the specified name 
         *
         * @exception  NativeException if the retrieval fails.
+        * @throws TimeoutException 
+        * @throws HostFailureException 
+        * @throws TransferFailureException 
         */
-       public void send(String mailbox) throws NativeException {
+       public void send(String mailbox) throws NativeException, TransferFailureException, HostFailureException, TimeoutException {
                MsgNative.taskSend(mailbox, this, -1);
        } 
 
@@ -141,8 +144,11 @@ public class Task {
         * Sends the task on the mailbox identified by the specified name (wait at most \a timeout seconds)
         *
         * @exception  NativeException if the retrieval fails.
+        * @throws TimeoutException 
+        * @throws HostFailureException 
+        * @throws TransferFailureException 
         */
-       public void send(String mailbox, double timeout) throws NativeException {
+       public void send(String mailbox, double timeout) throws NativeException, TransferFailureException, HostFailureException, TimeoutException {
                MsgNative.taskSend(mailbox, this, timeout);
        }