//File: VMachine.java //CS 471 - Operating Systems Project //Dennis Pereira, Ely Soto, John Cavalieri //This class is the wrapper for the virtual machine programs. //It provides the api pointer, name of user owner, argument array, a parent pointer, //and its input and output handles. //When a virtual machine is released it calls FinalizeVM() to perform necessary cleanup. import java.util.Vector; public class VMachine extends Thread { public Handle IN; public Handle OUT; public Handle vmh; // Currently using the handle as the threadID public String owner; public String[] args; public VMachine Parent; public Vector child; public int undone; protected Sysapi sysapi; public VMachine() {//Only 0 parm constructor because .CreateInstance() method used } public void prepareVM(Handle newIN,Handle newOUT,Handle newvmh,String newowner,String[] newargs,VMachine newParent, Vector newchild,int newundone, Sysapi newsysapi) { IN = newIN; OUT = newOUT; vmh = newvmh; owner = newowner; args = newargs; Parent = newParent; if(newchild == null) { child = new Vector(5,1); } else { child = newchild; } undone = newundone; sysapi = newsysapi; } public void finalize() { sysapi.FinalizeVM(vmh); } }