com.mockrunner.jms
Class DestinationManager

java.lang.Object
  extended by com.mockrunner.jms.DestinationManager
All Implemented Interfaces:
java.io.Serializable

public class DestinationManager
extends java.lang.Object
implements java.io.Serializable

The DestinationManager can be used to create queues and topics, which is normally an administrative act. Since queues and topics are ususally acquired using JNDI in a J2EE environment, you can bind the created objects to the mock context with the help of EJBTestModule.bindToContext(java.lang.String, java.lang.Object).

See Also:
Serialized Form

Constructor Summary
DestinationManager()
           
 
Method Summary
 MockQueue createQueue(java.lang.String name)
          Creates a new Queue that is available for MockSession.createQueue(java.lang.String) calls.
 MockTopic createTopic(java.lang.String name)
          Creates a new Topic that is available for MockSession.createTopic(java.lang.String) calls.
 MockQueue getQueue(java.lang.String name)
          Returns a Queue that was created with createQueue(java.lang.String) or null if no such Queue is present.
 MockTopic getTopic(java.lang.String name)
          Returns a Topic that was created with createTopic(java.lang.String) or null if no such Topic is present.
 void removeQueue(java.lang.String name)
          Removes a formerly created Queue.
 void removeTopic(java.lang.String name)
          Removes a formerly created Topic.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DestinationManager

public DestinationManager()
Method Detail

createQueue

public MockQueue createQueue(java.lang.String name)
Creates a new Queue that is available for MockSession.createQueue(java.lang.String) calls. Creating queues is an administrative act. Before MockSession.createQueue(java.lang.String) can be sucessfully called, you have to create a Queue with this method. You can also bind the created queue to the mock JNDI context using EJBTestModule.bindToContext(java.lang.String, java.lang.Object).

Parameters:
name - the name of the Queue
Returns:
the created Queue

removeQueue

public void removeQueue(java.lang.String name)
Removes a formerly created Queue.

Parameters:
name - the name of the Queue

getQueue

public MockQueue getQueue(java.lang.String name)
Returns a Queue that was created with createQueue(java.lang.String) or null if no such Queue is present.

Parameters:
name - the name of the Queue
Returns:
the Queue

createTopic

public MockTopic createTopic(java.lang.String name)
Creates a new Topic that is available for MockSession.createTopic(java.lang.String) calls. Creating topics is an administrative act. Before MockSession.createTopic(java.lang.String) can be sucessfully called, you have to create a Topic with this method. You can also bind the created topic to the mock JNDI context using EJBTestModule.bindToContext(java.lang.String, java.lang.Object).

Parameters:
name - the name of the Topic
Returns:
the created Topic

removeTopic

public void removeTopic(java.lang.String name)
Removes a formerly created Topic.

Parameters:
name - the name of the Topic

getTopic

public MockTopic getTopic(java.lang.String name)
Returns a Topic that was created with createTopic(java.lang.String) or null if no such Topic is present.

Parameters:
name - the name of the Topic
Returns:
the Topic