diff src/alice/datasegment/Command.java @ 251:88be2824a989

no use Queue
author sugi
date Mon, 17 Jun 2013 18:56:54 +0900
parents 38154e695025
children b78f52865b8d
line wrap: on
line diff
--- a/src/alice/datasegment/Command.java	Tue Jun 11 16:58:35 2013 +0900
+++ b/src/alice/datasegment/Command.java	Mon Jun 17 18:56:54 2013 +0900
@@ -7,6 +7,7 @@
 import alice.codesegment.CodeSegment;
 import alice.codesegment.SingletonMessage;
 import alice.daemon.CommandMessage;
+import alice.daemon.Connection;
 
 public class Command {
 	public CommandType type;
@@ -15,10 +16,12 @@
 	public Value val;
 	public int index;
 	public int seq;
+	public Connection connection; // for remote
 	public BlockingQueue<Command> replyQueue;
 	public CodeSegment cs;
 	public String reverseKey;
 	public Object obj;
+	public boolean flag;
 
 	public Command(CommandType cmdType, Receiver receiver, String key, Value val, int index, int seq, BlockingQueue<Command> replyQueue, CodeSegment cs, String reverseKey) {
 		this.type = cmdType;
@@ -30,7 +33,22 @@
 		this.replyQueue = replyQueue;
 		this.cs = cs;
 		this.reverseKey = reverseKey;
+		this.flag = false;
 	}
+	
+	public Command(CommandType cmdType, Receiver receiver, String key, Value val, int index, int seq, Connection connection, CodeSegment cs, String reverseKey, boolean flag) {
+		this.type = cmdType;
+		this.receiver = receiver;
+		this.key = key;
+		this.val = val;
+		this.index = index;
+		this.seq = seq;
+		this.connection = connection;
+		this.cs = cs;
+		this.reverseKey = reverseKey;
+		this.flag = flag;
+	}
+	
 	public Command(CommandType cmdType, Receiver receiver, String key, Object obj, int index, int seq, BlockingQueue<Command> replyQueue, CodeSegment cs, String reverseKey) {
 		this.type = cmdType;
 		this.receiver = receiver;
@@ -41,6 +59,7 @@
 		this.replyQueue = replyQueue;
 		this.cs = cs;
 		this.reverseKey = reverseKey;
+		this.flag = false;
 	}
 	
 	public Command(CommandType cmdType, Receiver receiver, String key, Value val, Object obj, int index, int seq, BlockingQueue<Command> replyQueue, CodeSegment cs, String reverseKey) {
@@ -54,6 +73,7 @@
 		this.replyQueue = replyQueue;
 		this.cs = cs;
 		this.reverseKey = reverseKey;
+		this.flag = false;
 	}
 	
 	public String getCommandString() {
@@ -71,7 +91,7 @@
 				e.printStackTrace();
 			}
 		}
-		return new CommandMessage(type.id, index, seq, key, val);
+		return new CommandMessage(type.id, index, seq, key, val, flag);
 	}
 	
 }