|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.exolab.jms.message.DestinationImpl
org.exolab.jms.client.JmsDestination
org.exolab.jms.client.JmsTopic
public class JmsTopic
A topic is a destination specific for the puiblish-subscribe messaging model. OpenJMS also supports topic hierarchy and wild carding.
JmsDestination,
Serialized Form| Field Summary | |
|---|---|
static java.lang.String |
ALL_WILDCARD
|
static java.lang.String |
SEPARATOR
|
static java.lang.String |
WILDCARD
|
| Constructor Summary | |
|---|---|
JmsTopic()
Need a default constructor for the serialization |
|
JmsTopic(java.lang.String name)
Instantiate an instance of this object with the specified string |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object object)
|
javax.naming.Reference |
getReference()
|
java.lang.String |
getTopicName()
Return the name of the topic |
int |
hashCode()
|
boolean |
isWildCard()
Check whether this topic represents a wildcard expression. |
static boolean |
isWildCard(java.lang.String topic)
A static method which checks a topic to determine whether or not it complies to a wildcard definition. |
boolean |
match(JmsTopic destination)
If it is a wildcard check to see that it matches the specified topic. |
void |
readExternal(java.io.ObjectInput stream)
|
void |
writeExternal(java.io.ObjectOutput stream)
|
| Methods inherited from class org.exolab.jms.client.JmsDestination |
|---|
getName, getPersistent, isTemporaryDestination, isTemporaryDestination, setPersistent, toString |
| Methods inherited from class org.exolab.jms.message.DestinationImpl |
|---|
clone, getDestination, isEqual |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.jms.Topic |
|---|
toString |
| Field Detail |
|---|
public static final java.lang.String WILDCARD
public static final java.lang.String ALL_WILDCARD
public static final java.lang.String SEPARATOR
| Constructor Detail |
|---|
public JmsTopic()
public JmsTopic(java.lang.String name)
name - name of the queue| Method Detail |
|---|
public java.lang.String getTopicName()
throws javax.jms.JMSException
getTopicName in interface javax.jms.Topicjavax.jms.JMSExceptionpublic boolean equals(java.lang.Object object)
equals in class java.lang.Object
public void writeExternal(java.io.ObjectOutput stream)
throws java.io.IOException
writeExternal in interface java.io.ExternalizablewriteExternal in class JmsDestinationjava.io.IOException
public void readExternal(java.io.ObjectInput stream)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.ExternalizablereadExternal in class JmsDestinationjava.io.IOException
java.lang.ClassNotFoundExceptionpublic int hashCode()
hashCode in class JmsDestinationpublic boolean isWildCard()
public static boolean isWildCard(java.lang.String topic)
topic - - the topic to check
public boolean match(JmsTopic destination)
Note we treat "a.b.c.*.*" and "a.b.c" as not a match at this stage, since the wildcard is attempting to match more levels than exist in the topic. if this proves to be unpopular with the masses, its a very trivial change below to fix this problem.
Tokens are compared and must either be identical or the wildcard token must be a "*" to match at this level. Once a mismatch is detected the comparison is stopped and a false returned.
NOTE: This check assumes both the topic and wildcard topic have both already been validated. if the topics are inavlid this test can return arbitrary results.
destination - The specific topic to match to
public javax.naming.Reference getReference()
getReference in interface javax.naming.Referenceable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||