com.mockrunner.mock.jms
Class MockTopicSubscriber

java.lang.Object
  extended by com.mockrunner.mock.jms.MockMessageConsumer
      extended by com.mockrunner.mock.jms.MockTopicSubscriber
All Implemented Interfaces:
java.io.Serializable, javax.jms.MessageConsumer, javax.jms.TopicSubscriber

public class MockTopicSubscriber
extends MockMessageConsumer
implements javax.jms.TopicSubscriber

Mock implementation of JMS TopicSubscriber.

See Also:
Serialized Form

Constructor Summary
MockTopicSubscriber(MockConnection connection, MockSession session, MockTopic topic)
           
MockTopicSubscriber(MockConnection connection, MockSession session, MockTopic topic, java.lang.String messageSelector, boolean noLocal)
           
 
Method Summary
 java.lang.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 receive()
           
 void setDurable(boolean isDurable)
          Set if this subscriber is durable.
 void setName(java.lang.String name)
          Set the name of the subscription.
 
Methods inherited from class com.mockrunner.mock.jms.MockMessageConsumer
canConsume, close, getConnection, getMessageFilter, getMessageListener, getMessageSelector, isClosed, receive, receiveMessage, 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, getMessageSelector, receive, receiveNoWait, setMessageListener
 

Constructor Detail

MockTopicSubscriber

public MockTopicSubscriber(MockConnection connection,
                           MockSession session,
                           MockTopic topic)

MockTopicSubscriber

public MockTopicSubscriber(MockConnection connection,
                           MockSession session,
                           MockTopic topic,
                           java.lang.String messageSelector,
                           boolean noLocal)
Method Detail

isDurable

public boolean isDurable()
Returns if this subscriber is durable.

Returns:
true if this subscriber is durable

setDurable

public void setDurable(boolean isDurable)
Set if this subscriber is durable. This is automatically done when creating the subscriber.

Parameters:
isDurable - is this a durable subscriber?

getName

public java.lang.String getName()
Returns the name of the subscription if the subscription is durable. Otherwise, this method returns null.

Returns:
the name of this subscriber

setName

public void setName(java.lang.String name)
Set the name of the subscription.

Parameters:
name - the name of this subscriber

getTopic

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

getNoLocal

public boolean getNoLocal()
                   throws javax.jms.JMSException
Specified by:
getNoLocal in interface javax.jms.TopicSubscriber
Throws:
javax.jms.JMSException

receive

public javax.jms.Message receive()
                          throws javax.jms.JMSException
Specified by:
receive in interface javax.jms.MessageConsumer
Throws:
javax.jms.JMSException