KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > ubermq > jms > client > impl > LocalTopic


1 package com.ubermq.jms.client.impl;
2
3 /**
4  * A simple Topic representation that encapsulates a String topic name.
5  */

6 public final class LocalTopic
7     extends LocalDestination
8     implements javax.jms.TemporaryTopic JavaDoc,
9     java.io.Serializable JavaDoc
10 {
11     private String JavaDoc name;
12
13     LocalTopic(String JavaDoc name)
14     {
15         if (name == null)
16             throw new IllegalArgumentException JavaDoc();
17         this.name = name;
18     }
19
20     public String JavaDoc getTopicName()
21     {
22         return name;
23     }
24
25     public void delete()
26     {
27         // nothing needs to happen to delete a temp. topic
28
}
29
30     /**
31      * Returns the UberMQ topic name that is used internally.
32      */

33     String JavaDoc getInternalTopicName()
34     {
35         return name;
36     }
37
38     public boolean equals(Object JavaDoc o)
39     {
40         if (o instanceof LocalTopic) {
41             return (((LocalTopic)o).name.equals(name));
42         } else {
43             return false;
44         }
45     }
46     public int hashCode() {return name.hashCode();}
47     public String JavaDoc toString() {return name;}
48 }
49
50
Popular Tags