SonicMQ API

progress.message.jclient
Class Topic

java.lang.Object
  extended by progress.message.jclient.Topic
All Implemented Interfaces:
java.io.Serializable, Destination, Topic, javax.naming.Referenceable

public class Topic
extends java.lang.Object
implements Topic, javax.naming.Referenceable, java.io.Serializable

A Topic object encapsulates a provider-specific topic name. It is the way a client specifies the identity of a topic to JMS methods.

Many Pub/Sub providers group topics into hierarchies and provide various options for subscribing to parts of the hierarchy. JMS places no restriction on what a Topic object represents. It might be a leaf in a topic hierarchy or it might be a larger part of the hierarchy.

The organization of topics and the granularity of subscriptions to them is an important part of a Pub/Sub application's architecture. JMS does not specify a policy for how this should be done. If an application takes advantage of a provider-specific topic grouping mechanism, it should document this. If the application is installed using a different provider, it is the job of the administrator to construct an equivalent topic architecture and create equivalent Topic objects.

Version:
1.0 - December 1998
Author:
Bill Collins
See Also:
Topic, Serialized Form

Constructor Summary
Topic()
          Contruct a Topic.
Topic(java.lang.String topicName)
          Construct a Topic.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getName()
           
 javax.naming.Reference getReference()
          Return a javax.naming.Reference object which contains the reference information necessary to create an object of the proper type.
 java.lang.String getTopicName()
          Get the name of this topic.
 int hashCode()
           
 void setName(java.lang.String name)
           
 void setTopicName(java.lang.String name)
          Set the topic name.
 java.lang.String toString()
          Return a pretty printed version of the topic name.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Topic

public Topic(java.lang.String topicName)
      throws JMSException
Construct a Topic.

Parameters:
topicName - the name of this topic
Throws:
JMSException - if a session fails to create a topic due to some JMS error.

Topic

public Topic()
Contruct a Topic. This contructor is provided to be used in conjunction with the setter setTopicName. A Topic object that does not refer to a particular topic will generate an error if it used in messaging.

See Also:
setTopicName(java.lang.String)
Method Detail

getTopicName

public java.lang.String getTopicName()
                              throws JMSException
Get the name of this topic.

Clients that depend upon the name, are not portable.

Specified by:
getTopicName in interface Topic
Returns:
the topic name
Throws:
JMSException - if JMS implementation for Topic fails to to return topic name due to some internal error.

setTopicName

public void setTopicName(java.lang.String name)
                  throws JMSException
Set the topic name.

Parameters:
name - The topic name
Throws:
JMSException

toString

public java.lang.String toString()
Return a pretty printed version of the topic name.

Specified by:
toString in interface Topic
Overrides:
toString in class java.lang.Object
Returns:
the provider specific identity values for this topic.

getReference

public javax.naming.Reference getReference()
                                    throws javax.naming.NamingException
Return a javax.naming.Reference object which contains the reference information necessary to create an object of the proper type.

Specified by:
getReference in interface javax.naming.Referenceable
Returns:
the Reference object, which contains information to create the desired object.
Throws:
javax.naming.NamingException - if the object naming is invalid.

setName

public void setName(java.lang.String name)
             throws JMSException
Throws:
JMSException

getName

public java.lang.String getName()
                         throws JMSException
Throws:
JMSException

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

SonicMQ API

Copyright © 1999-2012 Progress Software Corporation. All Rights Reserved.
HTML formatted on 13-March-2012.