com.mockrunner.mock.jms
Class MockQueueConnection

java.lang.Object
  extended by com.mockrunner.mock.jms.MockConnection
      extended by com.mockrunner.mock.jms.MockQueueConnection
All Implemented Interfaces:
java.io.Serializable, javax.jms.Connection, javax.jms.QueueConnection

public class MockQueueConnection
extends MockConnection
implements javax.jms.QueueConnection

Mock implementation of JMS QueueConnection. Please note: The interfaces ConnectionConsumer, ServerSessionPool and ServerSession are not meant for application use. Mockrunner provides very simple mock implementations but usually you won't need them.

See Also:
Serialized Form

Constructor Summary
MockQueueConnection(DestinationManager destinationManager, ConfigurationManager configurationManager)
           
MockQueueConnection(DestinationManager destinationManager, ConfigurationManager configurationManager, java.lang.String userName, java.lang.String password)
           
 
Method Summary
 javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Queue queue, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages)
           
 javax.jms.QueueSession createQueueSession(boolean transacted, int acknowledgeMode)
           
 javax.jms.Session createSession(boolean transacted, int acknowledgeMode)
           
 MockQueueSession getQueueSession(int index)
          Returns a MockQueueSession that was created with createQueueSession(boolean, int).
 java.util.List getQueueSessionList()
          Returns the list of MockQueueSession objects that were created with createQueueSession(boolean, int).
 
Methods inherited from class com.mockrunner.mock.jms.MockConnection
callExceptionListener, callExceptionListener, close, createConnectionConsumer, createDurableConnectionConsumer, getClientID, getConfigurationManager, getDestinationManager, getExceptionListener, getMetaData, getPassword, getSession, getSessionList, getUserName, isClosed, isStarted, isStopped, sessions, setClientID, setExceptionListener, setJMSException, setMetaData, start, stop, throwJMSException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.jms.Connection
close, createConnectionConsumer, createDurableConnectionConsumer, getClientID, getExceptionListener, getMetaData, setClientID, setExceptionListener, start, stop
 

Constructor Detail

MockQueueConnection

public MockQueueConnection(DestinationManager destinationManager,
                           ConfigurationManager configurationManager)

MockQueueConnection

public MockQueueConnection(DestinationManager destinationManager,
                           ConfigurationManager configurationManager,
                           java.lang.String userName,
                           java.lang.String password)
Method Detail

getQueueSessionList

public java.util.List getQueueSessionList()
Returns the list of MockQueueSession objects that were created with createQueueSession(boolean, int).

Returns:
the list

getQueueSession

public MockQueueSession getQueueSession(int index)
Returns a MockQueueSession that was created with createQueueSession(boolean, int). If there's no such MockQueueSession, null is returned.

Parameters:
index - the index of the session object
Returns:
the session object

createSession

public javax.jms.Session createSession(boolean transacted,
                                       int acknowledgeMode)
                                throws javax.jms.JMSException
Specified by:
createSession in interface javax.jms.Connection
Overrides:
createSession in class MockConnection
Throws:
javax.jms.JMSException

createQueueSession

public javax.jms.QueueSession createQueueSession(boolean transacted,
                                                 int acknowledgeMode)
                                          throws javax.jms.JMSException
Specified by:
createQueueSession in interface javax.jms.QueueConnection
Throws:
javax.jms.JMSException

createConnectionConsumer

public javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Queue queue,
                                                             java.lang.String messageSelector,
                                                             javax.jms.ServerSessionPool sessionPool,
                                                             int maxMessages)
                                                      throws javax.jms.JMSException
Specified by:
createConnectionConsumer in interface javax.jms.QueueConnection
Throws:
javax.jms.JMSException