/*
* 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
private long bind = 0;
private int coreAmount;
+
+ private String name;
/**
* @brief Create a new empty VM.
* @bug it is expected that in the future, the coreAmount parameter will be used
* to add extra constraints on the execution, but the argument is ignored for now.
*/
- public VM(Host host, int coreAmount) {
+ public VM(Host host, String name, int coreAmount) {
this.coreAmount = coreAmount;
- start(host,coreAmount);
+ this.name = name;
+ start(host,name,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);
+ private native void start(Host host, String name, int coreAmount);
/** @brief Returns whether the given VM is currently suspended
*/
* 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
+ /**
+ * @brief Reboot the VM, restarting all the processes in it.
+ */
+ public native void reboot();
+
+ public String getName() {
+ return name;
+ }
+}