Mercurial > hg > RemoteEditor > REPSessionManager
diff rep/handler/Editor.java @ 385:1fca50ce3508
first-working-version
author | one@firefly.cr.ie.u-ryukyu.ac.jp |
---|---|
date | Mon, 10 Nov 2008 22:18:14 +0900 |
parents | bcdf5476b8e4 |
children | bba62c4ac323 |
line wrap: on
line diff
--- a/rep/handler/Editor.java Mon Nov 10 22:16:37 2008 +0900 +++ b/rep/handler/Editor.java Mon Nov 10 22:18:14 2008 +0900 @@ -21,8 +21,9 @@ //private REPCommand quit2 = null; private SessionManager manager; private REPCommand quit2=null; + static final boolean doOptimize = true; - public Editor(SessionManager manager,boolean doOptimize,int editorNo){ + public Editor(SessionManager manager,int editorNo){ super(manager); this.manager = manager; eid = editorNo; @@ -34,7 +35,7 @@ } public Editor(SessionManager manager,int editorNo, REPSocketChannel<REPCommand> channel){ - this(manager,false,editorNo); + this(manager,editorNo); this.channel = channel; } @@ -226,7 +227,7 @@ * are handled in the next Editor in a session manager, but * it is forwarded here. */ - public void forwardedCommandManage(REPCommand command, REPNode forwarder) { + public void forwardedCommandManage(REPCommand command) { if (command.cmd==REP.SMCMD_QUIT_2) { // we have to wait next editor's finishing before sending this. // this is odd, but the editor itself does not know it's merging @@ -243,6 +244,14 @@ return; } } - manage(command); + send(command); + } + + @Override + public void send(REPCommand command) { + assert(command!=null); + assert(channel!=null); + REPCommand c = new REPCommand(command); + manager.addWriteQueue(new PacketSet(channel,null, c)); } }