public static void main(String[] args) throws Exception {

		// Create ProcessManager object to handle different commands 
		ProcessManager mManager = new ProcessManager();

		while (true) {
			// listen to the system in
			String command = mManager.readCommand();
			String[] commandArr = command.split(" ");
			String[] argsArr = Arrays.copyOfRange(commandArr, 1, commandArr.length);

			if (commandArr[0].equals("migrate")) {// run migrate method
				mManager.migrate();
			} else if (commandArr[0].equals("exit")) {
				System.exit(0);
			} else if (commandArr[0].equals("ps")) {
				mManager.printStatus();
			} else {
				//TODO need to handle exception?
				// instantiate an object, using reflection in JAVA
				try {
					Class<?> myClass = Class.forName(commandArr[0]);
					Constructor<?> myCons = myClass.getConstructor(String[].class);
					Object object = myCons.newInstance((Object) argsArr);
					mManager.launch((MigratableProcess) object);
				} catch (ClassNotFoundException e) {
					System.out.println("Class Not Found!");
				} catch (Exception e) {
					System.out.println("Wrong Argument");
				}
				
				
			}
		}
	}