public class TopicSubscriber extends MessageConsumer implements TopicSubscriber
javax.jms.TopicSubscriber
interface.MessageConsumer.Closer
dest, noLocal, queueMode, selector, sess, targetName
Constructor and Description |
---|
TopicSubscriber(Session sess,
Destination topic,
String name,
String selector,
boolean noLocal,
boolean durableSubscriber)
Constructs a subscriber.
|
Modifier and Type | Method and Description |
---|---|
boolean |
getNoLocal()
API method.
|
Topic |
getTopic()
API method.
|
String |
toString()
Returns a string view of this receiver.
|
checkClosed, close, doClose, getDest, getMessageListener, getMessageSelector, getQueueMode, getTargetName, isOpen, isQueueMode, receive, receive, receiveNoWait, setMessageListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
close, getMessageListener, getMessageSelector, receive, receive, receiveNoWait, setMessageListener
TopicSubscriber(Session sess, Destination topic, String name, String selector, boolean noLocal, boolean durableSubscriber) throws JMSException
sess
- The session the subscriber belongs to.topic
- The topic the subscriber subscribes to.name
- The subscription name, for durable subs only.selector
- The selector for filtering messages.noLocal
- true
if the subscriber does not wish to
consume messages published through the same connection.durableSubscriber
- true if durableInvalidDestinationException
- if an invalid destination is specified.IllegalStateException
- If the connection is broken.JMSException
- If the creation fails for any other reason.public String toString()
toString
in class MessageConsumer
public boolean getNoLocal() throws JMSException
getNoLocal
in interface TopicSubscriber
IllegalStateException
- If the subscriber is closed.JMSException
public Topic getTopic() throws JMSException
getTopic
in interface TopicSubscriber
IllegalStateException
- If the subscriber is closed.JMSException
Copyright © 2019 ScalAgent D.T.. All rights reserved.