diff rep/handler/REPHandlerImpl.java @ 144:0bf7f8d0f5f7

*** empty log message ***
author pin
date Wed, 27 Aug 2008 22:55:43 +0900
parents
children 6a5fe529b192
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rep/handler/REPHandlerImpl.java	Wed Aug 27 22:55:43 2008 +0900
@@ -0,0 +1,25 @@
+package rep.handler;
+
+import rep.REPCommand;
+import rep.SessionManager;
+import rep.channel.ChannelSimulator;
+import rep.channel.REPSocketChannel;
+import rep.channel.SelectionKeySimulator;
+
+public class REPHandlerImpl implements REPHandler {
+
+	private SessionManager manager;
+
+
+	public REPHandlerImpl(SessionManager manager) {
+		this.manager = manager;
+	}
+
+	public void handle(SelectionKeySimulator key) {
+		REPSocketChannel<REPCommand> channel = (REPSocketChannel<REPCommand>) key.channel();
+		REPCommand packet = channel.read();
+		REPCommand command = packet;
+		manager.manage(channel, command);
+	}
+
+}