@Override
	public void messageReceived(IoSession session, Object message) throws Exception {
		String text = UTFCoder.decode(message);
		System.out.printf("Recieved : %s \n", text);
		String[] parameter = parse(text);
		if(parameter.length>=1){
			if (parameter[0].equalsIgnoreCase("prepared")) {
				this.sendAccept(key, value);
			} else if (parameter[0].equalsIgnoreCase("accepted")) {
				try {
					this.write(queue.take());
				} catch (InterruptedException e) {
					System.out.println("Queue Empty");
					_transactionComplete = true;
				}
			}  else {
				try {
					this.write(queue.take());
				} catch (InterruptedException e) {
					System.out.println("Queue Empty");
					_transactionComplete = true;
				}
			}
		}
	}