Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge scm.gforge.inria.fr:/gitroot/simgrid/simgrid-java
[simgrid.git] / org / simgrid / msg / Process.java
index 5e1b4e6..f9572c5 100644 (file)
@@ -224,7 +224,6 @@ public abstract class Process implements Runnable {
 
        /**
         * This method kill a process.
-        * @param process  the process to be killed.
         *
         */
        public native void kill();
@@ -289,6 +288,12 @@ public abstract class Process implements Runnable {
        public int getPPID()  {
                return ppid;
        }
+       /**
+        * Set the kill time of the process
+        * @param killTime the time when the process is killed
+        */
+       public native void setKillTime(double killTime);
+       
        /**
         * This static method returns the currently running process.
         *
@@ -310,7 +315,7 @@ public abstract class Process implements Runnable {
         * FIXME: Not optimal, maybe we should have two native functions.
         * @param millis the length of time to sleep in milliseconds.
         */
-       public static void sleep(long millis)  {
+       public static void sleep(long millis) throws HostFailureException  {
                sleep(millis,0);
        }
        /**
@@ -321,12 +326,12 @@ public abstract class Process implements Runnable {
         * @param millis the length of time to sleep in milliseconds.
         * @param nanos additionnal nanoseconds to sleep.
         */
-       public native static void sleep(long millis, int nanos);
+       public native static void sleep(long millis, int nanos) throws HostFailureException;
        /**
         * Makes the current process sleep until time seconds have elapsed.
         * @param seconds               The time the current process must sleep.
         */ 
-       public native void waitFor(double seconds);    
+       public native void waitFor(double seconds) throws HostFailureException;    
        /**
      *
      */
@@ -372,6 +377,7 @@ public abstract class Process implements Runnable {
                 catch(ProcessKilledError pk) {
                         
                 }      
+               exit();
        }
 
        /**
@@ -382,7 +388,7 @@ public abstract class Process implements Runnable {
      */
        public abstract void main(String[]args) throws MsgException;
 
-    
+       public native void exit();    
        /**
         * Class initializer, to initialize various JNI stuff
         */