public class MockTopicSubscriber extends MockMessageConsumer implements javax.jms.TopicSubscriber
TopicSubscriber.| Constructor and Description |
|---|
MockTopicSubscriber(MockConnection connection,
MockSession session,
MockTopic topic) |
MockTopicSubscriber(MockConnection connection,
MockSession session,
MockTopic topic,
String messageSelector,
boolean noLocal) |
| Modifier and Type | Method and Description |
|---|---|
String |
getName()
Returns the name of the subscription if the subscription
is durable.
|
boolean |
getNoLocal() |
javax.jms.Topic |
getTopic() |
boolean |
isDurable()
Returns if this subscriber is durable.
|
javax.jms.Message |
receiveNoWait() |
void |
setDurable(boolean isDurable)
Set if this subscriber is durable.
|
void |
setName(String name)
Set the name of the subscription.
|
protected void |
waitOnMessage(long timeout)
wait until:
* a message is ready
* the timeout elapses
* some other event happens (@see Object.wait)
if the timeout is 0, the function will not timeout.
|
canConsume, close, getConnection, getMessageFilter, getMessageListener, getMessageSelector, isClosed, receive, receive, receiveMessage, setMessageListenerpublic MockTopicSubscriber(MockConnection connection, MockSession session, MockTopic topic)
public MockTopicSubscriber(MockConnection connection, MockSession session, MockTopic topic, String messageSelector, boolean noLocal)
public boolean isDurable()
true if this subscriber is durablepublic void setDurable(boolean isDurable)
isDurable - is this a durable subscriber?public String getName()
null.public void setName(String name)
name - the name of this subscriberpublic javax.jms.Topic getTopic()
throws javax.jms.JMSException
getTopic in interface javax.jms.TopicSubscriberjavax.jms.JMSExceptionpublic boolean getNoLocal()
throws javax.jms.JMSException
getNoLocal in interface javax.jms.TopicSubscriberjavax.jms.JMSExceptionpublic javax.jms.Message receiveNoWait()
throws javax.jms.JMSException
receiveNoWait in interface javax.jms.MessageConsumerjavax.jms.JMSExceptionprotected void waitOnMessage(long timeout)
MockMessageConsumerwaitOnMessage in class MockMessageConsumertimeout - - max milliseconds to wait.Copyright © 2003–2020. All rights reserved.