com.mockrunner.jms
Class QueueTransmissionManager

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

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

This class is used to create queue senders and receivers. It can be also used to access all created classes in tests.

See Also:
Serialized Form

Constructor Summary
QueueTransmissionManager(MockConnection connection, MockSession session)
           
 
Method Summary
 void closeAll()
          Closes all senders, receivers, browsers, publishers and subscribers.
 void closeAllQueueBrowsers()
          Closes all queue browsers.
 void closeAllQueueReceivers()
          Closes all queue receivers.
 void closeAllQueueSenders()
          Closes all queue senders.
 MockQueueBrowser createQueueBrowser(MockQueue queue, java.lang.String messageSelector)
          Creates a new QueueBrowser for the specified Queue.
 MockQueueReceiver createQueueReceiver(MockQueue queue, java.lang.String messageSelector)
          Creates a new QueueReceiver for the specified Queue.
 MockQueueSender createQueueSender(MockQueue queue)
          Creates a new QueueSender for the specified Queue.
 MockQueueBrowser getQueueBrowser(int index)
          Returns a QueueBrowser by its index or null, if no such QueueBrowser is present.
 MockQueueBrowser getQueueBrowser(java.lang.String queueName)
          Returns a QueueBrowser by the name of its corresponding Queue.
 java.util.List getQueueBrowserList()
          Returns the list of QueueBrowser objects.
 java.util.List getQueueBrowserList(java.lang.String queueName)
          Returns the list of the QueueBrowser objects for a specific Queue.
 MockQueueReceiver getQueueReceiver(int index)
          Returns a QueueReceiver by its index or null, if no such QueueReceiver is present.
 MockQueueReceiver getQueueReceiver(java.lang.String queueName)
          Returns a QueueReceiver by the name of its corresponding Queue.
 java.util.List getQueueReceiverList()
          Returns the list of QueueReceiver objects.
 java.util.List getQueueReceiverList(java.lang.String queueName)
          Returns the list of the QueueReceiver objects for a specific Queue.
 MockQueueSender getQueueSender(int index)
          Returns a QueueSender by its index or null, if no such QueueSender is present.
 MockQueueSender getQueueSender(java.lang.String queueName)
          Returns a QueueSender by the name of its corresponding Queue.
 java.util.List getQueueSenderList()
          Returns the list of all QueueSender objects.
 java.util.List getQueueSenderList(java.lang.String queueName)
          Returns the list of the QueueSender objects for a specific Queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueueTransmissionManager

public QueueTransmissionManager(MockConnection connection,
                                MockSession session)
Method Detail

closeAll

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


closeAllQueueSenders

public void closeAllQueueSenders()
Closes all queue senders.


closeAllQueueReceivers

public void closeAllQueueReceivers()
Closes all queue receivers.


closeAllQueueBrowsers

public void closeAllQueueBrowsers()
Closes all queue browsers.


createQueueSender

public MockQueueSender createQueueSender(MockQueue queue)
Creates a new QueueSender for the specified Queue. Usually this method is called by MockQueueSession.createSender(javax.jms.Queue).

Parameters:
queue - the Queue
Returns:
the created QueueSender

getQueueSender

public MockQueueSender getQueueSender(int index)
Returns a QueueSender by its index or null, if no such QueueSender is present.

Parameters:
index - the index of the QueueSender
Returns:
the QueueSender

getQueueSender

public MockQueueSender getQueueSender(java.lang.String queueName)
Returns a QueueSender by the name of its corresponding Queue. If there's more than one QueueSender object for the specified name, the first one will be returned.

Parameters:
queueName - the name of the Queue
Returns:
the QueueSender

getQueueSenderList

public java.util.List getQueueSenderList(java.lang.String queueName)
Returns the list of the QueueSender objects for a specific Queue.

Parameters:
queueName - the name of the Queue
Returns:
the list of QueueSender objects

getQueueSenderList

public java.util.List getQueueSenderList()
Returns the list of all QueueSender objects.

Returns:
the list of QueueSender objects

createQueueReceiver

public MockQueueReceiver createQueueReceiver(MockQueue queue,
                                             java.lang.String messageSelector)
Creates a new QueueReceiver for the specified Queue. Usually this method is called by MockQueueSession.createReceiver(javax.jms.Queue).

Parameters:
queue - the Queue
messageSelector - the message selector
Returns:
the created QueueReceiver

getQueueReceiver

public MockQueueReceiver getQueueReceiver(int index)
Returns a QueueReceiver by its index or null, if no such QueueReceiver is present.

Parameters:
index - the index of the QueueReceiver
Returns:
the QueueReceiver

getQueueReceiver

public MockQueueReceiver getQueueReceiver(java.lang.String queueName)
Returns a QueueReceiver by the name of its corresponding Queue. If there's more than one QueueReceiver object for the specified name, the first one will be returned.

Parameters:
queueName - the name of the Queue
Returns:
the QueueReceiver

getQueueReceiverList

public java.util.List getQueueReceiverList(java.lang.String queueName)
Returns the list of the QueueReceiver objects for a specific Queue.

Parameters:
queueName - the name of the Queue
Returns:
the list of QueueReceiver objects

getQueueReceiverList

public java.util.List getQueueReceiverList()
Returns the list of QueueReceiver objects.

Returns:
the QueueReceiver list

createQueueBrowser

public MockQueueBrowser createQueueBrowser(MockQueue queue,
                                           java.lang.String messageSelector)
Creates a new QueueBrowser for the specified Queue. Usually this method is called by MockSession.createBrowser(javax.jms.Queue).

Parameters:
queue - the Queue
messageSelector - the message selector
Returns:
the created QueueBrowser

getQueueBrowser

public MockQueueBrowser getQueueBrowser(int index)
Returns a QueueBrowser by its index or null, if no such QueueBrowser is present.

Parameters:
index - the index of the QueueBrowser
Returns:
the QueueBrowser

getQueueBrowser

public MockQueueBrowser getQueueBrowser(java.lang.String queueName)
Returns a QueueBrowser by the name of its corresponding Queue. If there's more than one QueueBrowser object for the specified name, the first one will be returned.

Parameters:
queueName - the name of the Queue
Returns:
the QueueBrowser

getQueueBrowserList

public java.util.List getQueueBrowserList(java.lang.String queueName)
Returns the list of the QueueBrowser objects for a specific Queue.

Parameters:
queueName - the name of the Queue
Returns:
the list of QueueBrowser objects

getQueueBrowserList

public java.util.List getQueueBrowserList()
Returns the list of QueueBrowser objects.

Returns:
the QueueBrowser list