Mercurial > hg > Members > tatsuki > Alice
comparison src/alice/datasegment/Command.java @ 250:38154e695025
Refactor
author | sugi |
---|---|
date | Tue, 11 Jun 2013 16:58:35 +0900 |
parents | b5c642ba998e |
children | 88be2824a989 |
comparison
equal
deleted
inserted
replaced
249:2a8bcf09bd06 | 250:38154e695025 |
---|---|
1 package alice.datasegment; | 1 package alice.datasegment; |
2 | 2 |
3 import java.io.IOException; | |
3 import java.util.concurrent.BlockingQueue; | 4 import java.util.concurrent.BlockingQueue; |
4 import org.msgpack.type.Value; | 5 import org.msgpack.type.Value; |
5 | 6 |
6 import alice.codesegment.CodeSegment; | 7 import alice.codesegment.CodeSegment; |
8 import alice.codesegment.SingletonMessage; | |
9 import alice.daemon.CommandMessage; | |
7 | 10 |
8 public class Command { | 11 public class Command { |
9 public CommandType type; | 12 public CommandType type; |
10 public String key; | 13 public String key; |
11 public Receiver receiver; | 14 public Receiver receiver; |
58 if (cs != null) { | 61 if (cs != null) { |
59 csName = cs.toString(); | 62 csName = cs.toString(); |
60 } | 63 } |
61 return this.type + "\t" + key + "\t" + val + "\tindex=" + index + "\tcs=" + csName; | 64 return this.type + "\t" + key + "\t" + val + "\tindex=" + index + "\tcs=" + csName; |
62 } | 65 } |
66 public CommandMessage convert() { | |
67 if (val==null&&obj!=null){ | |
68 try { | |
69 this.val = SingletonMessage.getInstance().unconvert(obj); | |
70 } catch (IOException e) { | |
71 e.printStackTrace(); | |
72 } | |
73 } | |
74 return new CommandMessage(type.id, index, seq, key, val); | |
75 } | |
63 | 76 |
64 } | 77 } |