Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add VM.reboot
[simgrid.git] / org / simgrid / msg / VM.java
index c084163..3de79f9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * JNI interface to Cloud interface in Simgrid
  * 
- * Copyright 2006,2007,2010,2012 The SimGrid Team.           
+ * Copyright 2006-2012 The SimGrid Team.           
  * All right reserved. 
  *
  * This program is free software; you can redistribute 
@@ -31,17 +31,19 @@ public class VM {
                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();
@@ -77,7 +79,14 @@ 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();
+       /**
+        * @brief Reboot the VM, restarting all the processes in it.
+        */
+       public native void reboot();
                
 }
\ No newline at end of file