X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/344426b96f30e5362d99218279f21bd9966ab497..ac1f31a10a723b385c6e4df346fe5ac2b18cda1b:/org/simgrid/msg/VM.java diff --git a/org/simgrid/msg/VM.java b/org/simgrid/msg/VM.java index 137fa17249..cdbcdd4830 100644 --- a/org/simgrid/msg/VM.java +++ b/org/simgrid/msg/VM.java @@ -29,18 +29,21 @@ public class VM { */ public VM(Host host, int coreAmount) { this.coreAmount = coreAmount; + start(host,coreAmount); } + protected void finalize() { + destroy(); + } + /** + * Destroy the VM + */ + protected native void destroy(); /** * Natively implemented method starting the VM. * @param coreAmount */ private native void start(Host host, int coreAmount); - - /** - * @brief Returns a new array containing all existing VMs. - */ - public static native VM[] all(); - + /** @brief Returns whether the given VM is currently suspended */ public native boolean isSuspended(); @@ -76,5 +79,10 @@ public class VM { * of VM resume to you. */ public native void resume(); + /** + * @brief Immediately kills all processes within the given VM. Any memory that they allocated will be leaked. + * No extra delay occurs. If you want to simulate this too, you want to use a MSG_process_sleep() or something + */ + public native void shutdown(); } \ No newline at end of file