annotate rep/handler/REPHandlerImpl.java @ 238:6589b148dd13

*** empty log message ***
author kono
date Sun, 31 Aug 2008 19:39:12 +0900
parents c52e0e831d91
children c513cf1ce9cc
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
155
bbd2801d8ce0 *** empty log message ***
pin
parents: 148
diff changeset
3 import java.io.IOException;
144
0bf7f8d0f5f7 *** empty log message ***
pin
parents:
diff changeset
4 import rep.REPCommand;
0bf7f8d0f5f7 *** empty log message ***
pin
parents:
diff changeset
5 import rep.SessionManager;
213
4d9b32666ed2 *** empty log message ***
pin
parents: 178
diff changeset
6 import rep.channel.REPSelectionKey;
144
0bf7f8d0f5f7 *** empty log message ***
pin
parents:
diff changeset
7 import rep.channel.REPSocketChannel;
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
170
30cf7747d134 *** empty log message ***
pin
parents: 155
diff changeset
14 public REPHandlerImpl(int sid, SessionManager manager) {
144
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
178
a097b1d619a1 *** empty log message ***
pin
parents: 170
diff changeset
18 @SuppressWarnings("unchecked")
213
4d9b32666ed2 *** empty log message ***
pin
parents: 178
diff changeset
19 public void handle(REPSelectionKey<REPCommand> key) throws IOException {
238
6589b148dd13 *** empty log message ***
kono
parents: 237
diff changeset
20 REPSocketChannel<REPCommand> channel = (REPSocketChannel<REPCommand>) key.channel();
237
c52e0e831d91 *** empty log message ***
pin
parents: 233
diff changeset
21 System.out.println("REPHandlerImpl.handle() : channel = " + channel);
c52e0e831d91 *** empty log message ***
pin
parents: 233
diff changeset
22
178
a097b1d619a1 *** empty log message ***
pin
parents: 170
diff changeset
23 REPCommand command = channel.read();
233
dae90ded1bcd *** empty log message ***
pin
parents: 218
diff changeset
24 System.out.println("REPHandlerImpl.handle() : command = " + command);
178
a097b1d619a1 *** empty log message ***
pin
parents: 170
diff changeset
25
144
0bf7f8d0f5f7 *** empty log message ***
pin
parents:
diff changeset
26 manager.manage(channel, command);
0bf7f8d0f5f7 *** empty log message ***
pin
parents:
diff changeset
27 }
0bf7f8d0f5f7 *** empty log message ***
pin
parents:
diff changeset
28
0bf7f8d0f5f7 *** empty log message ***
pin
parents:
diff changeset
29 }