Mercurial > hg > RemoteEditor > REPSessionManager
view rep/Forwarder.java @ 328:6ceb222570cb
merge is working now.
author | kono |
---|---|
date | Sat, 11 Oct 2008 22:23:45 +0900 |
parents | 7b6dede07f4a |
children | ef4afcae0c92 |
line wrap: on
line source
package rep; import rep.channel.REPLogger; import rep.channel.REPSocketChannel; import rep.handler.PacketSet; public class Forwarder extends EditorPlus { int seq = 0; Forwarder next; // REPCommands we sent to the next editor final int limit=100; REPLogger ns = REPLogger.singleton(); SessionManager manager; public Forwarder(SessionManager manager) { this.manager = manager; } public int seq() { return seq++; } public void send(REPCommand command) { assert(command!=null); REPCommand c = new REPCommand(command); manager.addWriteQueue(new PacketSet(channel,null, c)); } public REPSocketChannel<REPCommand> getChannel() { return channel; } public void setChannel(REPSocketChannel<REPCommand> channel) { this.channel = channel; } public void setQuit2(REPCommand cmd) { send(cmd); } public void setNext(Forwarder next) { this.next = next; } public Forwarder getNextForwarder() { return next; } public boolean manage(REPCommand command) { send(command); return true; } }