+ public VM(Host host, String name, int coreAmount, int ramSize, int migNetSpeed, int dpIntensity){
+ super();
+ super.name = name;
+ this.currentHost = host;
+ this.coreAmount = coreAmount;
+ create(host, name, coreAmount, ramSize, migNetSpeed, dpIntensity);
+ }
+
+ /** Retrieve the list of all existing VMs */
+ public static native VM[] all();
+
+ /** Retrieve a VM from its name */
+ public static native VM getVMByName(String name);
+
+ /* Make sure that the GC also destroys the C object */
+ protected void finalize() throws Throwable {
+ nativeFinalize();
+ }
+ private native void nativeFinalize();
+
+ /** Returns whether the given VM is currently suspended */
+ public native int isCreated();
+
+ /** Returns whether the given VM is currently running */
+ public native int isRunning();
+
+ /** Returns whether the given VM is currently running */
+ public native int isMigrating();
+
+ /** Returns whether the given VM is currently suspended */
+ public native int isSuspended();
+
+ /** Returns the amount of virtual CPUs provided */
+ public int getCoreAmount() {
+ return coreAmount;
+ }
+