view rep/handler/REPEditorHandler.java @ 347:86935b872385

*** empty log message ***
author kono
date Tue, 14 Oct 2008 09:33:31 +0900
parents 5ba5b7a9761b
children
line wrap: on
line source

package rep.handler;

import rep.REPCommand;
import rep.SessionManager;
import rep.channel.REPSelectionKey;
import rep.channel.REPSocketChannel;

public class REPEditorHandler implements REPHandler {

	private SessionManager manager;


	public REPEditorHandler(SessionManager manager) {
		this.manager = manager;
	}

	public void handle(REPSelectionKey<REPCommand> key) throws Exception {
		REPSocketChannel<REPCommand> channel = key.channel1();
		REPCommand command = channel.read();
		SessionManager.logger.writeLog("REPHandlerImpl.handle() read : command = " + command +" from "+channel);

		manager.manage(channel, command);
	}

	public void cancel(REPSocketChannel<REPCommand> socketChannel) {
		manager.remove(socketChannel);
	}


}