com.mockrunner.jms
Class TopicTransmissionManager

java.lang.Object
  extended by com.mockrunner.jms.TopicTransmissionManager
All Implemented Interfaces:
java.io.Serializable

public class TopicTransmissionManager
extends java.lang.Object
implements java.io.Serializable

This class is used to create topic publishers and subscribers. It can be also used to access all created classes in tests.

See Also:
Serialized Form

Constructor Summary
TopicTransmissionManager(MockConnection connection, MockSession session)
           
 
Method Summary
 void closeAll()
          Closes all senders, receivers, browsers, publishers and subscribers.
 void closeAllTopicDurableSubscribers()
          Closes all durable topic subscribers.
 void closeAllTopicPublishers()
          Closes all topic publishers.
 void closeAllTopicSubscribers()
          Closes all topic subscribers.
 MockTopicSubscriber createDurableTopicSubscriber(MockTopic topic, java.lang.String name, java.lang.String messageSelector, boolean noLocal)
          Creates a new durable TopicSubscriber for the specified Topic.
 MockTopicPublisher createTopicPublisher(MockTopic topic)
          Creates a new TopicPublisher for the specified Topic.
 MockTopicSubscriber createTopicSubscriber(MockTopic topic, java.lang.String messageSelector, boolean noLocal)
          Creates a new TopicSubscriber for the specified Topic.
 MockTopicSubscriber getDurableTopicSubscriber(java.lang.String name)
          Returns a durable TopicSubscriber by its name or null, if no such durable TopicSubscriber is present.
 java.util.Map getDurableTopicSubscriberMap()
          Returns the map of all durable TopicSubscriber objects.
 java.util.Map getDurableTopicSubscriberMap(java.lang.String topicName)
          Returns the map of all durable TopicSubscriber objects for a specific Topic.
 MockTopicPublisher getTopicPublisher(int index)
          Returns a TopicPublisher by its index or null, if no such TopicPublisher is present.
 MockTopicPublisher getTopicPublisher(java.lang.String topicName)
          Returns a TopicPublisher by the name of its corresponding Topic.
 java.util.List getTopicPublisherList()
          Returns the list of all TopicPublisher objects.
 java.util.List getTopicPublisherList(java.lang.String topicName)
          Returns the list of the TopicPublisher objects for a specific Topic.
 MockTopicSubscriber getTopicSubscriber(int index)
          Returns a TopicSubscriber by its index or null, if no such TopicSubscriber is present.
 MockTopicSubscriber getTopicSubscriber(java.lang.String topicName)
          Returns a TopicSubscriber by the name of its corresponding Topic.
 java.util.List getTopicSubscriberList()
          Returns the list of all TopicSubscriber objects.
 java.util.List getTopicSubscriberList(java.lang.String topicName)
          Returns the list of the TopicSubscriber objects for a specific Topic.
 void removeTopicDurableSubscriber(java.lang.String name)
          Deletes a durable TopicSubscriber.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TopicTransmissionManager

public TopicTransmissionManager(MockConnection connection,
                                MockSession session)
Method Detail

closeAll

public void closeAll()
Closes all senders, receivers, browsers, publishers and subscribers.


closeAllTopicPublishers

public void closeAllTopicPublishers()
Closes all topic publishers.


closeAllTopicSubscribers

public void closeAllTopicSubscribers()
Closes all topic subscribers.


closeAllTopicDurableSubscribers

public void closeAllTopicDurableSubscribers()
Closes all durable topic subscribers.


createTopicPublisher

public MockTopicPublisher createTopicPublisher(MockTopic topic)
Creates a new TopicPublisher for the specified Topic. Usually this method is called by MockTopicSession.createPublisher(javax.jms.Topic).

Parameters:
topic - the Topic
Returns:
the created TopicPublisher

getTopicPublisher

public MockTopicPublisher getTopicPublisher(int index)
Returns a TopicPublisher by its index or null, if no such TopicPublisher is present.

Parameters:
index - the index of the TopicPublisher
Returns:
the TopicPublisher

getTopicPublisher

public MockTopicPublisher getTopicPublisher(java.lang.String topicName)
Returns a TopicPublisher by the name of its corresponding Topic. If there's more than one TopicPublisher object for the specified name, the first one will be returned.

Parameters:
topicName - the name of the Topic
Returns:
the TopicPublisher

getTopicPublisherList

public java.util.List getTopicPublisherList(java.lang.String topicName)
Returns the list of the TopicPublisher objects for a specific Topic.

Parameters:
topicName - the name of the Topic
Returns:
the list of TopicPublisher objects

getTopicPublisherList

public java.util.List getTopicPublisherList()
Returns the list of all TopicPublisher objects.

Returns:
the list of TopicPublisher objects

createTopicSubscriber

public MockTopicSubscriber createTopicSubscriber(MockTopic topic,
                                                 java.lang.String messageSelector,
                                                 boolean noLocal)
Creates a new TopicSubscriber for the specified Topic. Usually this method is called by MockTopicSession.createSubscriber(javax.jms.Topic).

Parameters:
topic - the Topic
messageSelector - the message selector
noLocal - the no local flag
Returns:
the created TopicSubscriber

getTopicSubscriber

public MockTopicSubscriber getTopicSubscriber(int index)
Returns a TopicSubscriber by its index or null, if no such TopicSubscriber is present.

Parameters:
index - the index of the TopicSubscriber
Returns:
the TopicSubscriber

getTopicSubscriber

public MockTopicSubscriber getTopicSubscriber(java.lang.String topicName)
Returns a TopicSubscriber by the name of its corresponding Topic. If there's more than one TopicSubscriber object for the specified name, the first one will be returned.

Parameters:
topicName - the name of the Topic
Returns:
the TopicSubscriber

getTopicSubscriberList

public java.util.List getTopicSubscriberList(java.lang.String topicName)
Returns the list of the TopicSubscriber objects for a specific Topic.

Parameters:
topicName - the name of the Topic
Returns:
the list of TopicSubscriber objects

getTopicSubscriberList

public java.util.List getTopicSubscriberList()
Returns the list of all TopicSubscriber objects.

Returns:
the list of TopicSubscriber objects

createDurableTopicSubscriber

public MockTopicSubscriber createDurableTopicSubscriber(MockTopic topic,
                                                        java.lang.String name,
                                                        java.lang.String messageSelector,
                                                        boolean noLocal)
Creates a new durable TopicSubscriber for the specified Topic. Usually this method is called by MockSession.createDurableSubscriber(javax.jms.Topic, java.lang.String).

Parameters:
topic - the Topic
name - the name of the subscription
messageSelector - the message selector
noLocal - the no local flag
Returns:
the created TopicSubscriber

getDurableTopicSubscriber

public MockTopicSubscriber getDurableTopicSubscriber(java.lang.String name)
Returns a durable TopicSubscriber by its name or null, if no such durable TopicSubscriber is present.

Parameters:
name - the name of the subscription
Returns:
the TopicSubscriber

removeTopicDurableSubscriber

public void removeTopicDurableSubscriber(java.lang.String name)
Deletes a durable TopicSubscriber.

Parameters:
name - the name of the subscription

getDurableTopicSubscriberMap

public java.util.Map getDurableTopicSubscriberMap(java.lang.String topicName)
Returns the map of all durable TopicSubscriber objects for a specific Topic.

Parameters:
topicName - the name of the Topic
Returns:
the map of TopicSubscriber objects

getDurableTopicSubscriberMap

public java.util.Map getDurableTopicSubscriberMap()
Returns the map of all durable TopicSubscriber objects.

Returns:
the map of TopicSubscriber objects