KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jfox > ejb > meta > Protocol


1 /* JFox, the OpenSource J2EE Application Server
2  *
3  * Distributable under GNU LGPL license by gun.org
4  * more details please visit http://www.huihoo.org/jfox
5  */

6 package org.jfox.ejb.meta;
7
8 import java.io.Serializable JavaDoc;
9
10 /**
11  * @author <a HREF="mailto:young_yy@hotmail.com">Young Yang</a>
12  */

13
14 public class Protocol implements Serializable JavaDoc {
15
16     public static final Protocol JRMP = new Protocol("jrmp");
17     public static final Protocol JRMP_SSL = new Protocol("jrmp_ssl");
18     public static final Protocol SOAP = new Protocol("soap");
19     public static final Protocol LOCAL = new Protocol("soap");
20
21     private String JavaDoc protocol = "jrmp";
22
23     private Protocol(String JavaDoc protocol) {
24         this.protocol = protocol;
25     }
26
27     public String JavaDoc getProtocol() {
28         return protocol.toLowerCase();
29     }
30
31     public String JavaDoc toString() {
32         return protocol.toLowerCase();
33     }
34
35     public boolean equals(Object JavaDoc o) {
36         if(this == o) return true;
37         if(!(o instanceof Protocol)) return false;
38
39         final Protocol prot = (Protocol) o;
40
41         if(!protocol.equals(prot.protocol)) return false;
42
43         return true;
44     }
45
46     public int hashCode() {
47         return protocol.hashCode();
48     }
49
50     public static void main(String JavaDoc[] args) {
51
52     }
53 }
54
55
Popular Tags