view rep/handler/REPHandlerImpl.java @ 178:a097b1d619a1

*** empty log message ***
author pin
date Thu, 28 Aug 2008 22:04:48 +0900
parents 30cf7747d134
children 4d9b32666ed2
line wrap: on
line source

package rep.handler;

import java.io.IOException;
import java.nio.channels.SelectionKey;

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

public class REPHandlerImpl implements REPHandler {

	private SessionManager manager;


	public REPHandlerImpl(int sid, SessionManager manager) {
		this.manager = manager;
	}

	@SuppressWarnings("unchecked")
	public void handle(SelectionKey key) throws IOException {
		REPSocketChannel<REPCommand> channel = (REPSocketChannel<REPCommand>) key.channel();
		REPCommand command = channel.read();

		manager.manage(channel, command);
	}

}