|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.mockrunner.mock.jms.MockConnectionFactory
public class MockConnectionFactory
Mock implementation of JMS ConnectionFactory
.
Can be used as generic factory for JMS 1.1.
Also implements QueueConnectionFactory
and
TopicConnectionFactory
and can be used to
create queue and topic connections as well as generic
JMS 1.1 connections. It is recommended to use
MockQueueConnectionFactory
if you only use queues and
MockTopicConnectionFactory
if you only use topics.
This implementation is primary for generic JMS 1.1 connections
but can also be used, if a server provides one implementation
for both domains (which is not portable).
Constructor Summary | |
---|---|
MockConnectionFactory(DestinationManager destinationManager,
ConfigurationManager configurationManager)
|
Method Summary | |
---|---|
void |
clearConnections()
Clears the list of connections |
protected ConfigurationManager |
configurationManager()
|
protected java.util.List |
connections()
|
javax.jms.Connection |
createConnection()
|
javax.jms.Connection |
createConnection(java.lang.String name,
java.lang.String password)
|
javax.jms.QueueConnection |
createQueueConnection()
|
javax.jms.QueueConnection |
createQueueConnection(java.lang.String name,
java.lang.String password)
|
javax.jms.TopicConnection |
createTopicConnection()
|
javax.jms.TopicConnection |
createTopicConnection(java.lang.String name,
java.lang.String password)
|
protected DestinationManager |
destinationManager()
|
protected javax.jms.JMSException |
exception()
|
MockConnection |
getConnection(int index)
Returns the connection with the specified index or null if no such connection
exists. |
MockConnection |
getLatestConnection()
Returns the latest created connection or null if no such connection
exists. |
void |
setJMSException(javax.jms.JMSException exception)
Set an exception that will be passed to all created connections. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MockConnectionFactory(DestinationManager destinationManager, ConfigurationManager configurationManager)
Method Detail |
---|
public javax.jms.Connection createConnection() throws javax.jms.JMSException
createConnection
in interface javax.jms.ConnectionFactory
javax.jms.JMSException
public javax.jms.Connection createConnection(java.lang.String name, java.lang.String password) throws javax.jms.JMSException
createConnection
in interface javax.jms.ConnectionFactory
javax.jms.JMSException
public javax.jms.QueueConnection createQueueConnection() throws javax.jms.JMSException
createQueueConnection
in interface javax.jms.QueueConnectionFactory
javax.jms.JMSException
public javax.jms.QueueConnection createQueueConnection(java.lang.String name, java.lang.String password) throws javax.jms.JMSException
createQueueConnection
in interface javax.jms.QueueConnectionFactory
javax.jms.JMSException
public javax.jms.TopicConnection createTopicConnection() throws javax.jms.JMSException
createTopicConnection
in interface javax.jms.TopicConnectionFactory
javax.jms.JMSException
public javax.jms.TopicConnection createTopicConnection(java.lang.String name, java.lang.String password) throws javax.jms.JMSException
createTopicConnection
in interface javax.jms.TopicConnectionFactory
javax.jms.JMSException
public void setJMSException(javax.jms.JMSException exception)
MockConnection.setJMSException(javax.jms.JMSException)
for details.
exception
- the exceptionpublic void clearConnections()
public MockConnection getConnection(int index)
null
if no such connection
exists.
index
- the index
public MockConnection getLatestConnection()
null
if no such connection
exists.
protected DestinationManager destinationManager()
protected ConfigurationManager configurationManager()
protected java.util.List connections()
protected javax.jms.JMSException exception()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |