KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > example > Magic8BallProtocol


1 package example;
2
3 import com.caucho.util.L10N;
4 import java.util.logging.Logger JavaDoc;
5 import java.util.logging.Level JavaDoc;
6
7 import com.caucho.server.connection.Connection;
8 import com.caucho.server.port.Protocol;
9 import com.caucho.server.port.ServerRequest;
10
11 /**
12  *
13  */

14 public class Magic8BallProtocol extends Protocol {
15   static protected final Logger JavaDoc log =
16     Logger.getLogger(Magic8BallProtocol.class.getName());
17   static final L10N L = new L10N(Magic8BallProtocol.class);
18
19   private String JavaDoc _protocolName = "magic8ball";
20
21   /**
22    * Construct.
23    */

24   public Magic8BallProtocol()
25   {
26   }
27
28   /**
29    * Returns the protocol name.
30    */

31   public String JavaDoc getProtocolName()
32   {
33     return _protocolName;
34   }
35   
36   /**
37    * Sets the protocol name.
38    */

39   public void setProtocolName(String JavaDoc name)
40   {
41     _protocolName = name;
42   }
43
44   /**
45    * Create a Magic8BallRequest object for the new thread.
46    */

47   public ServerRequest createRequest(Connection conn)
48   {
49     return new Magic8BallRequest(this, conn);
50   }
51 }
52
53
Popular Tags