cgl.narada.jms
Class JmsTopicSubscriber

java.lang.Object
  extended by cgl.narada.jms.JmsMessageConsumer
      extended by cgl.narada.jms.JmsTopicSubscriber
All Implemented Interfaces:
JmsDebugFlags, MessageConsumer, TopicSubscriber

public class JmsTopicSubscriber
extends JmsMessageConsumer
implements TopicSubscriber, JmsDebugFlags

A client uses a TopicSubscriber object to receive messages that have been published to a topic. A TopicSubscriber object is the publish/subscribe form of a message consumer. A TopicSession allows the creation of multiple TopicSubscriber objects per topic. It will deliver each message for a topic to each subscriber eligible to receive it. Each copy of the message is treated as a completely separate message. Work done on one copy has no effect on the others; acknowledging one does not acknowledge the others; one message may be delivered immediately, while another waits for its subscriber to process messages ahead of it. Regular TopicSubscriber objects are not durable. They receive only messages that are published while they are active. Messages filtered out by a subscriber's message selector will never be delivered to the subscriber. From the subscriber's perspective, they do not exist. In some cases, a connection may both publish and subscribe to a topic. The subscriber NoLocal attribute allows a subscriber to inhibit the delivery of messages published by its own connection.


Field Summary
 
Fields inherited from interface cgl.narada.jms.JmsDebugFlags
JmsConnection_Debug, JmsDestination_Debug, JmsHeader_Debug, JmsLogger_Debug, JmsMessage_Debug, JmsObjectMessage_Debug, JmsProperties_Debug, JmsTextMessage_Debug, JmsTopic_Debug, JmsTopicAndSelectorVerifier_Debug, JmsTopicConnection_Debug, JmsTopicConnectionFactory_Debug, JmsTopicPublisher_Debug, JmsTopicSession_Debug, JmsTopicSubscriber_Debug
 
Constructor Summary
JmsTopicSubscriber(JmsTopicSession jmsTopicSession, Topic topic, String name, String msgSelector, boolean noLocal)
          Created in JmsTopicSession
 
Method Summary
 JmsSelector getJmsSelector()
           
 String getMessageSelector()
          Gets this message consumer's message selector expression.
 boolean getNoLocal()
          Gets the NoLocal attribute for this subscriber.
 Topic getTopic()
           
 void propagateSubscriptionToBroker()
          What we need to propagate is simply the JMS Topic Name
 void unSubscribe()
           
 
Methods inherited from class cgl.narada.jms.JmsMessageConsumer
close, getMessageListener, receive, receive, receiveNoWait, setMessageListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.jms.MessageConsumer
close, getMessageListener, receive, receive, receiveNoWait, setMessageListener
 

Constructor Detail

JmsTopicSubscriber

public JmsTopicSubscriber(JmsTopicSession jmsTopicSession,
                          Topic topic,
                          String name,
                          String msgSelector,
                          boolean noLocal)
                   throws JMSException
Created in JmsTopicSession

Throws:
JMSException
Method Detail

propagateSubscriptionToBroker

public void propagateSubscriptionToBroker()
                                   throws JMSException
What we need to propagate is simply the JMS Topic Name

Throws:
JMSException

unSubscribe

public void unSubscribe()
                 throws JMSException
Throws:
JMSException

getTopic

public Topic getTopic()
               throws JMSException
Specified by:
getTopic in interface TopicSubscriber
Throws:
JMSException

getMessageSelector

public String getMessageSelector()
Description copied from class: JmsMessageConsumer
Gets this message consumer's message selector expression.

Specified by:
getMessageSelector in interface MessageConsumer
Overrides:
getMessageSelector in class JmsMessageConsumer

getJmsSelector

public JmsSelector getJmsSelector()

getNoLocal

public boolean getNoLocal()
                   throws JMSException
Gets the NoLocal attribute for this subscriber. The default value for this attribute is false.

Specified by:
getNoLocal in interface TopicSubscriber
Returns:
true if locally published messages are being inhibited
Throws:
JMSException - if the JMS provider fails to get the NoLocal attribute for this topic subscriber due to some internal error.


For comments and suggestions please send e-mail to The NaradaBrokering Project