X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ec855b2eab2825f3870232ef7e0a804963231b0e..886b7085ea26ae9500f57e065cd6c1cbc2b5a4ec:/src/bindings/java/org/simgrid/msg/Process.java diff --git a/src/bindings/java/org/simgrid/msg/Process.java b/src/bindings/java/org/simgrid/msg/Process.java index 29a69ca6ce..291ab60818 100644 --- a/src/bindings/java/org/simgrid/msg/Process.java +++ b/src/bindings/java/org/simgrid/msg/Process.java @@ -47,9 +47,7 @@ public abstract class Process implements Runnable { * access to it. It is set automatically during the build of the object. */ private long bind; - /** - * Indicates if the process is started - */ + /** Indicates if the process is started */ boolean started; /** * Even if this attribute is public you must never access to it. @@ -66,8 +64,7 @@ public abstract class Process implements Runnable { /** Time at which the process should be created */ protected double startTime = 0; - /** Time at which th - * Kill time of the process + /** Time at which the process should be killed. * * Set at creation, and used internally by SimGrid */ @@ -83,9 +80,7 @@ public abstract class Process implements Runnable { public Vector args; - /** - * Default constructor - */ + /** Default constructor */ protected Process() { this.id = nextProcessId++; this.name = null; @@ -146,6 +141,8 @@ public abstract class Process implements Runnable { public Process(Host host, String name, String[]args) { this(); this.host = host; + if (host == null) + throw new NullPointerException("Process name cannot be NULL"); if (name == null) throw new NullPointerException("Process name cannot be NULL"); this.name = name; @@ -168,6 +165,8 @@ public abstract class Process implements Runnable { public Process(Host host, String name, String[]args, double startTime, double killTime) { this(); this.host = host; + if (host == null) + throw new NullPointerException("Process name cannot be NULL"); if (name == null) throw new NullPointerException("Process name cannot be NULL"); this.name = name; @@ -208,8 +207,9 @@ public abstract class Process implements Runnable { public native void resume(); /** Tests if a process is suspended. * - * @see {@link #suspend()} and {@link #resume()} - */ + * @see #suspend() + * @see #resume() + */ public native boolean isSuspended(); /** @@ -323,13 +323,11 @@ public abstract class Process implements Runnable { } } - /** - * This method runs the process. Il calls the method function that you must overwrite. - */ + /** This method runs the process. Il calls the method function that you must overwrite. */ + @Override public void run() { String[] args = null; /* do not fill it before the signal or this.args will be empty */ - //waitSignal(); /* wait for other people to fill the process in */ try { args = new String[this.args.size()]; @@ -356,13 +354,13 @@ public abstract class Process implements Runnable { */ public abstract void main(String[]args) throws MsgException; - public native void exit(); + public native void exit(); /** * Class initializer, to initialize various JNI stuff */ private static native void nativeInit(); static { - Msg.nativeInit(); + org.simgrid.NativeLib.nativeInit(); nativeInit(); } /**