com.mockrunner.mock.jms
Class MockTopicConnection

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

public class MockTopicConnection
extends MockConnection
implements javax.jms.TopicConnection

Mock implementation of JMS TopicConnection. 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
MockTopicConnection(DestinationManager destinationManager, ConfigurationManager configurationManager)
           
MockTopicConnection(DestinationManager destinationManager, ConfigurationManager configurationManager, java.lang.String userName, java.lang.String password)
           
 
Method Summary
 javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Topic topic, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages)
           
 javax.jms.Session createSession(boolean transacted, int acknowledgeMode)
           
 javax.jms.TopicSession createTopicSession(boolean transacted, int acknowledgeMode)
           
 MockTopicSession getTopicSession(int index)
          Returns a MockTopicSession that was created with createTopicSession(boolean, int).
 java.util.List getTopicSessionList()
          Returns the list of MockTopicSession objects that were created with createTopicSession(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.TopicConnection
createDurableConnectionConsumer
 
Methods inherited from interface javax.jms.Connection
close, createConnectionConsumer, getClientID, getExceptionListener, getMetaData, setClientID, setExceptionListener, start, stop
 

Constructor Detail

MockTopicConnection

public MockTopicConnection(DestinationManager destinationManager,
                           ConfigurationManager configurationManager)

MockTopicConnection

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

getTopicSessionList

public java.util.List getTopicSessionList()
Returns the list of MockTopicSession objects that were created with createTopicSession(boolean, int).

Returns:
the list

getTopicSession

public MockTopicSession getTopicSession(int index)
Returns a MockTopicSession that was created with createTopicSession(boolean, int). If there's no such MockTopicSession, 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

createTopicSession

public javax.jms.TopicSession createTopicSession(boolean transacted,
                                                 int acknowledgeMode)
                                          throws javax.jms.JMSException
Specified by:
createTopicSession in interface javax.jms.TopicConnection
Throws:
javax.jms.JMSException

createConnectionConsumer

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