| java.lang.Object com.mockrunner.mock.jms.MockConnection
All known Subclasses: com.mockrunner.mock.jms.MockTopicConnection, com.mockrunner.mock.jms.MockQueueConnection,
MockConnection | public class MockConnection implements Connection(Code) | | Mock implementation of JMS Connection .
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.
|
callExceptionListener | public void callExceptionListener()(Code) | | Calls the ExceptionListener
if an exception is set
MockConnection.setJMSException .
Deletes the exception after calling the ExceptionListener .
|
callExceptionListener | public void callExceptionListener(JMSException exception)(Code) | | Calls the ExceptionListener
using the specified exception.
Parameters: exception - the exception |
close | public void close() throws JMSException(Code) | | |
createConnectionConsumer | public ConnectionConsumer createConnectionConsumer(Destination destination, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException(Code) | | |
createDurableConnectionConsumer | public ConnectionConsumer createDurableConnectionConsumer(Topic topic, String subscriptionName, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException(Code) | | |
createSession | public Session createSession(boolean transacted, int acknowledgeMode) throws JMSException(Code) | | |
getClientID | public String getClientID() throws JMSException(Code) | | |
getExceptionListener | public ExceptionListener getExceptionListener() throws JMSException(Code) | | |
getMetaData | public ConnectionMetaData getMetaData() throws JMSException(Code) | | |
getSession | public MockSession getSession(int index)(Code) | | Returns a
MockSession . If there's no such
MockSession , null is returned.
Parameters: index - the index of the session object the session object |
isClosed | public boolean isClosed()(Code) | | |
isStarted | public boolean isStarted()(Code) | | |
isStopped | public boolean isStopped()(Code) | | |
setClientID | public void setClientID(String clientId) throws JMSException(Code) | | |
setExceptionListener | public void setExceptionListener(ExceptionListener listener) throws JMSException(Code) | | |
setJMSException | public void setJMSException(JMSException exception)(Code) | | Set an exception that will be thrown when calling one
of the interface methods. Since the mock implementation
cannot fail like a full blown message server you can use
this method to simulate server errors. After the exception
was thrown it will be deleted.
Parameters: exception - the exception to throw |
setMetaData | public void setMetaData(ConnectionMetaData metaData)(Code) | | You can use this to set the ConnectionMetaData .
Usually this should not be necessary. Per default an instance
of
MockConnectionMetaData is returned when calling
MockConnection.getMetaData .
Parameters: metaData - the meta data |
start | public void start() throws JMSException(Code) | | |
stop | public void stop() throws JMSException(Code) | | |
|
|