Mercurial > hg > RemoteEditor > REPSessionManager
view rep/handler/REPHandlerInMerge.java @ 273:d6a33e295d47
*** empty log message ***
author | kono |
---|---|
date | Mon, 22 Sep 2008 18:21:35 +0900 |
parents | c513cf1ce9cc |
children | ad487e63e3c8 |
line wrap: on
line source
package rep.handler; import java.io.IOException; import rep.Editor; import rep.REPCommand; import rep.REPCommandPacker; import rep.SessionManager; import rep.channel.REPSelectionKey; import rep.channel.REPSocketChannel; public class REPHandlerInMerge implements REPHandler { private SessionManager manager; private int sid; public REPHandlerInMerge(SessionManager manager) { this.manager = manager; } public REPHandlerInMerge(int sid, SessionManager manager2) { this.manager = manager2; this.sid = sid; } @SuppressWarnings("unchecked") public void handle(REPSelectionKey<REPCommand> key) throws IOException { //マージ中のエディタの前のエディタのコマンドをWaitingListに追加する REPSocketChannel<REPCommand> channel = (REPSocketChannel<REPCommand>) key.channel(); REPCommand command = channel.read(); if(command.sid == sid){ Editor editor = manager.getEditor(channel); manager.addWaitingCommand(new PacketSet(channel, editor, command)); }else{ manager.manage(channel, command); } } public void cancel() { // TODO Auto-generated method stub } }