01: package example;
02:
03: import com.caucho.util.L10N;
04: import java.util.logging.Logger;
05: import java.util.logging.Level;
06:
07: import com.caucho.server.connection.Connection;
08: import com.caucho.server.port.Protocol;
09: import com.caucho.server.port.ServerRequest;
10:
11: /**
12: *
13: */
14: public class Magic8BallProtocol extends Protocol {
15: static protected final Logger log = Logger
16: .getLogger(Magic8BallProtocol.class.getName());
17: static final L10N L = new L10N(Magic8BallProtocol.class);
18:
19: private String _protocolName = "magic8ball";
20:
21: /**
22: * Construct.
23: */
24: public Magic8BallProtocol() {
25: }
26:
27: /**
28: * Returns the protocol name.
29: */
30: public String getProtocolName() {
31: return _protocolName;
32: }
33:
34: /**
35: * Sets the protocol name.
36: */
37: public void setProtocolName(String name) {
38: _protocolName = name;
39: }
40:
41: /**
42: * Create a Magic8BallRequest object for the new thread.
43: */
44: public ServerRequest createRequest(Connection conn) {
45: return new Magic8BallRequest(this, conn);
46: }
47: }
|