Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
[simgrid.git] / src / bindings / java / org / simgrid / msg / VM.java
index 5efe9f2..6752b0b 100644 (file)
@@ -73,9 +73,15 @@ public class VM extends Host{
                }
                return null; 
        }
-       protected void finalize() {
-               destroy();
+       @Override
+       public void finalize() {
+               try {
+                       nativeFinalize();
+               } catch (Throwable e) {
+                       e.printStackTrace();
+               }
        }
+       private native void nativeFinalize();
 
 
        /* JNI / Native code */
@@ -125,10 +131,10 @@ public class VM extends Host{
 
 
        /**
-        * Bound the VM to a certain % of its vcpu capability (e.g. 75% of vm.getSpeed())
-        * @param load percentage (between [0,100]
+        * Set a CPU bound for a given VM.
+        * @param bound in flops/s
         */
-       public native void setBound(int load);
+       public native void setBound(double bound);
 
        /**
         * start the VM
@@ -156,8 +162,8 @@ public class VM extends Host{
                try {
                        this.internalmig(destination);
                } catch (Exception e){
-                       Msg.info("an exception occurs during the migration of VM "+this.getName());
-                       throw new HostFailureException();
+                 Msg.info("Migration of VM "+this.getName()+" to "+destination.getName()+" is impossible ("+e.getMessage()+")");
+                 throw new HostFailureException();
                }
                // If the migration correcly returned, then we should change the currentHost value. 
                this.currentHost = destination; 
@@ -199,13 +205,6 @@ public class VM extends Host{
        public native void restore();
 
 
-       /**
-        * Destroy the VM
-        */
-       public native void destroy();
-
-
-
        /**
         * Class initializer, to initialize various JNI stuff
         */