X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f2df13795e01302813a6aef10825ec7e922ce530..c80ea3788d692dc92728cefdd199e83a93a6fa25:/src/bindings/java/org/simgrid/msg/Msg.java?ds=sidebyside diff --git a/src/bindings/java/org/simgrid/msg/Msg.java b/src/bindings/java/org/simgrid/msg/Msg.java index ec212a7d8e..b324db8aa4 100644 --- a/src/bindings/java/org/simgrid/msg/Msg.java +++ b/src/bindings/java/org/simgrid/msg/Msg.java @@ -9,31 +9,12 @@ package org.simgrid.msg; import org.simgrid.NativeLib; -import java.io.FileOutputStream; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.File; - public final class Msg { - /* Statically load the library which contains all native functions used in here */ - static private boolean isNativeInited = false; - public static void nativeInit() { - if (isNativeInited) - return; - NativeLib.nativeInit("simgrid"); - NativeLib.nativeInit("simgrid-java"); - isNativeInited = true; - - } - static { - nativeInit(); - } - - /** Retrieve the simulation time - * @return The simulation time. - */ + /** Retrieve the simulation time + * @return The simulation time. + */ public final static native double getClock(); /** * Issue a debug logging message. @@ -47,8 +28,8 @@ public final class Msg { public final static native void verb(String s); /** Issue an information logging message - * @param s - */ + * @param s + */ public final static native void info(String s); /** * Issue an warning logging message. @@ -86,7 +67,7 @@ public final class Msg { * of a process or the current date is perfectly ok. */ public final static native void run() ; - + /** This function is useless nowadays, just stop calling it. */ @Deprecated public final static void clean(){} @@ -104,15 +85,15 @@ public final class Msg { /** * The method to deploy the simulation. * - * - * @param deploymentFile - */ + * + * @param deploymentFile + */ public final static native void deployApplication(String deploymentFile); - /** Example launcher. You can use it or provide your own launcher, as you wish - * @param args - * @throws MsgException - */ + /** 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); @@ -128,4 +109,9 @@ public final class Msg { /* Execute the simulation */ Msg.run(); } + + /* Class initializer, to initialize various JNI stuff */ + static { + org.simgrid.NativeLib.nativeInit(); + } }