private int ui() {
		final BufferedReader in = new BufferedReader(new InputStreamReader(
				System.in));
		int retValue = 0;
		String cmd;

		while (!terminate && status != Status.TERMINATED) {
			try {
				System.out.print(getThreadName());
				System.out.print("> ");
				cmd = in.readLine().trim();
				switch (cmd) {
				case "quit":
				case "exit":
				case "q":
					terminate = true;
					break;
				default:
					perform(cmd);
				}
			} catch (IOException | NullPointerException e) {
				retValue = -1;
				break;
			}
		}
		try {
			close();
			in.close();
		} catch (IOException e) {
		}
		return retValue;
	}