|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.mockrunner.mock.jms.MockConnection
public class MockConnection
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.
Constructor Summary | |
---|---|
MockConnection(DestinationManager destinationManager,
ConfigurationManager configurationManager)
|
|
MockConnection(DestinationManager destinationManager,
ConfigurationManager configurationManager,
java.lang.String userName,
java.lang.String password)
|
Method Summary | |
---|---|
void |
callExceptionListener()
Calls the ExceptionListener
if an exception is set setJMSException(javax.jms.JMSException) . |
void |
callExceptionListener(javax.jms.JMSException exception)
Calls the ExceptionListener
using the specified exception. |
void |
close()
|
javax.jms.ConnectionConsumer |
createConnectionConsumer(javax.jms.Destination destination,
java.lang.String messageSelector,
javax.jms.ServerSessionPool sessionPool,
int maxMessages)
|
javax.jms.ConnectionConsumer |
createDurableConnectionConsumer(javax.jms.Topic topic,
java.lang.String subscriptionName,
java.lang.String messageSelector,
javax.jms.ServerSessionPool sessionPool,
int maxMessages)
|
javax.jms.Session |
createSession(boolean transacted,
int acknowledgeMode)
|
java.lang.String |
getClientID()
|
ConfigurationManager |
getConfigurationManager()
Returns the ConfigurationManager . |
DestinationManager |
getDestinationManager()
Returns the DestinationManager . |
javax.jms.ExceptionListener |
getExceptionListener()
|
javax.jms.ConnectionMetaData |
getMetaData()
|
java.lang.String |
getPassword()
Returns the password. |
MockSession |
getSession(int index)
Returns a MockSession . |
java.util.List |
getSessionList()
Returns the list of MockSession objects. |
java.lang.String |
getUserName()
Returns the user name. |
boolean |
isClosed()
|
boolean |
isStarted()
|
boolean |
isStopped()
|
protected java.util.List |
sessions()
|
void |
setClientID(java.lang.String clientId)
|
void |
setExceptionListener(javax.jms.ExceptionListener listener)
|
void |
setJMSException(javax.jms.JMSException exception)
Set an exception that will be thrown when calling one of the interface methods. |
void |
setMetaData(javax.jms.ConnectionMetaData metaData)
You can use this to set the ConnectionMetaData . |
void |
start()
|
void |
stop()
|
void |
throwJMSException()
Throws a JMSException if one is set with
setJMSException(javax.jms.JMSException) . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MockConnection(DestinationManager destinationManager, ConfigurationManager configurationManager)
public MockConnection(DestinationManager destinationManager, ConfigurationManager configurationManager, java.lang.String userName, java.lang.String password)
Method Detail |
---|
public java.lang.String getUserName()
public java.lang.String getPassword()
public DestinationManager getDestinationManager()
DestinationManager
.
DestinationManager
public ConfigurationManager getConfigurationManager()
ConfigurationManager
.
ConfigurationManager
public java.util.List getSessionList()
MockSession
objects.
public MockSession getSession(int index)
MockSession
. If there's no such
MockSession
, null
is returned.
index
- the index of the session object
public void setJMSException(javax.jms.JMSException exception)
exception
- the exception to throwpublic void throwJMSException() throws javax.jms.JMSException
JMSException
if one is set with
setJMSException(javax.jms.JMSException)
. Deletes the exception.
javax.jms.JMSException
public void callExceptionListener()
ExceptionListener
if an exception is set setJMSException(javax.jms.JMSException)
.
Deletes the exception after calling the ExceptionListener
.
public void callExceptionListener(javax.jms.JMSException exception)
ExceptionListener
using the specified exception.
exception
- the exceptionpublic void setMetaData(javax.jms.ConnectionMetaData metaData)
ConnectionMetaData
.
Usually this should not be necessary. Per default an instance
of MockConnectionMetaData
is returned when calling
getMetaData()
.
metaData
- the meta datapublic javax.jms.Session createSession(boolean transacted, int acknowledgeMode) throws javax.jms.JMSException
createSession
in interface javax.jms.Connection
javax.jms.JMSException
public javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Destination destination, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages) throws javax.jms.JMSException
createConnectionConsumer
in interface javax.jms.Connection
javax.jms.JMSException
public javax.jms.ConnectionConsumer createDurableConnectionConsumer(javax.jms.Topic topic, java.lang.String subscriptionName, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages) throws javax.jms.JMSException
createDurableConnectionConsumer
in interface javax.jms.Connection
javax.jms.JMSException
public javax.jms.ConnectionMetaData getMetaData() throws javax.jms.JMSException
getMetaData
in interface javax.jms.Connection
javax.jms.JMSException
public java.lang.String getClientID() throws javax.jms.JMSException
getClientID
in interface javax.jms.Connection
javax.jms.JMSException
public void setClientID(java.lang.String clientId) throws javax.jms.JMSException
setClientID
in interface javax.jms.Connection
javax.jms.JMSException
public javax.jms.ExceptionListener getExceptionListener() throws javax.jms.JMSException
getExceptionListener
in interface javax.jms.Connection
javax.jms.JMSException
public void setExceptionListener(javax.jms.ExceptionListener listener) throws javax.jms.JMSException
setExceptionListener
in interface javax.jms.Connection
javax.jms.JMSException
public void start() throws javax.jms.JMSException
start
in interface javax.jms.Connection
javax.jms.JMSException
public void stop() throws javax.jms.JMSException
stop
in interface javax.jms.Connection
javax.jms.JMSException
public void close() throws javax.jms.JMSException
close
in interface javax.jms.Connection
javax.jms.JMSException
public boolean isStarted()
public boolean isStopped()
public boolean isClosed()
protected java.util.List sessions()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |