KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jfox > jms > JMSDestination


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
7 package org.jfox.jms;
8
9 import java.io.Serializable JavaDoc;
10 import javax.jms.Destination JavaDoc;
11
12 /**
13  * @author <a HREF="mailto:young_yy@hotmail.com">Young Yang</a>
14  */

15
16 abstract class JMSDestination implements Destination JavaDoc, Serializable JavaDoc {
17     private String JavaDoc name;
18
19     public JMSDestination(String JavaDoc name) {
20         this.name = name;
21     }
22
23     public String JavaDoc toString() {
24         return "JMSDestination [" + (isTopic() ? "Topic" : "Queue") + "] " + getName();
25     }
26
27     protected String JavaDoc getName() {
28         return name;
29     }
30
31     public boolean equals(Object JavaDoc pObject) {
32         if (this == pObject) return true;
33         if (!(pObject instanceof JMSDestination)) return false;
34
35         final JMSDestination jmsDestination = (JMSDestination) pObject;
36
37         if (name != null ? !name.equals(jmsDestination.name) : jmsDestination.name != null) return false;
38
39         return true;
40     }
41
42     public int hashCode() {
43         return (name != null ? name.hashCode() : 0);
44     }
45
46     protected abstract boolean isTopic();
47
48
49     public static void main(String JavaDoc[] args) {
50
51     }
52 }
53
Popular Tags