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

*** empty log message ***
author pin
date Wed, 27 Aug 2008 22:55:43 +0900
parents
children 6a5fe529b192
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
144
0bf7f8d0f5f7 *** empty log message ***
pin
parents:
diff changeset
1 package rep.handler;
0bf7f8d0f5f7 *** empty log message ***
pin
parents:
diff changeset
2
0bf7f8d0f5f7 *** empty log message ***
pin
parents:
diff changeset
3 import rep.REPCommand;
0bf7f8d0f5f7 *** empty log message ***
pin
parents:
diff changeset
4 import rep.SessionManager;
0bf7f8d0f5f7 *** empty log message ***
pin
parents:
diff changeset
5 import rep.channel.ChannelSimulator;
0bf7f8d0f5f7 *** empty log message ***
pin
parents:
diff changeset
6 import rep.channel.REPSocketChannel;
0bf7f8d0f5f7 *** empty log message ***
pin
parents:
diff changeset
7 import rep.channel.SelectionKeySimulator;
0bf7f8d0f5f7 *** empty log message ***
pin
parents:
diff changeset
8
0bf7f8d0f5f7 *** empty log message ***
pin
parents:
diff changeset
9 public class REPHandlerImpl implements REPHandler {
0bf7f8d0f5f7 *** empty log message ***
pin
parents:
diff changeset
10
0bf7f8d0f5f7 *** empty log message ***
pin
parents:
diff changeset
11 private SessionManager manager;
0bf7f8d0f5f7 *** empty log message ***
pin
parents:
diff changeset
12
0bf7f8d0f5f7 *** empty log message ***
pin
parents:
diff changeset
13
0bf7f8d0f5f7 *** empty log message ***
pin
parents:
diff changeset
14 public REPHandlerImpl(SessionManager manager) {
0bf7f8d0f5f7 *** empty log message ***
pin
parents:
diff changeset
15 this.manager = manager;
0bf7f8d0f5f7 *** empty log message ***
pin
parents:
diff changeset
16 }
0bf7f8d0f5f7 *** empty log message ***
pin
parents:
diff changeset
17
0bf7f8d0f5f7 *** empty log message ***
pin
parents:
diff changeset
18 public void handle(SelectionKeySimulator key) {
0bf7f8d0f5f7 *** empty log message ***
pin
parents:
diff changeset
19 REPSocketChannel<REPCommand> channel = (REPSocketChannel<REPCommand>) key.channel();
0bf7f8d0f5f7 *** empty log message ***
pin
parents:
diff changeset
20 REPCommand packet = channel.read();
0bf7f8d0f5f7 *** empty log message ***
pin
parents:
diff changeset
21 REPCommand command = packet;
0bf7f8d0f5f7 *** empty log message ***
pin
parents:
diff changeset
22 manager.manage(channel, command);
0bf7f8d0f5f7 *** empty log message ***
pin
parents:
diff changeset
23 }
0bf7f8d0f5f7 *** empty log message ***
pin
parents:
diff changeset
24
0bf7f8d0f5f7 *** empty log message ***
pin
parents:
diff changeset
25 }