@Override
	public void run() {
		while (true) {
			try {
				// wait and receive an incoming message
				Socket socket = serverSocket.accept();
				ObjectInputStream in = new ObjectInputStream(
						socket.getInputStream());
				ObjectOutputStream out = new ObjectOutputStream(
						socket.getOutputStream());
				Message input = (Message) in.readObject();
				switch (input.getContent()) {
					case "fail":
						System.out.println("Job Fail");
						break;
					default:
						// parse the message and generate output
						System.out.println("Generated output path:");
						System.out.println(input.getContent());
						break;
				}
				out.writeObject("ACK");
				out.flush();
				out.close();
				in.close();
				System.exit(0);
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (ClassNotFoundException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}