toolbox.jms
Class JmsManagerImpl

Package class diagram package JmsManagerImpl
java.lang.Object
  extended by toolbox.jms.JmsManagerImpl
All Implemented Interfaces:
javax.jms.ExceptionListener, JmsManager

public class JmsManagerImpl
extends java.lang.Object
implements JmsManager, javax.jms.ExceptionListener

Default implementation of the JmsManager interface that utilises an XML configuration document to initialise.


Constructor Summary
JmsManagerImpl()
          Default constructor.
 
Method Summary
 void destroy()
          Destroy this manager by destroying all managed producers and consumers.
 JmsConsumer getConsumer(java.lang.String name)
          Return the named consumer managed by this manager.
 JmsProducer getProducer(java.lang.String name)
          Return the named producer managed by this manager.
 void init(java.lang.String name, java.lang.String config)
          Initialise this manager with the given name identifier and the location of the it's XML configuration document.
 void onException(javax.jms.JMSException jmse)
          Receive notifications of connection exceptions and reinitialise this manager instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JmsManagerImpl

public JmsManagerImpl()
Default constructor.

Method Detail

init

public void init(java.lang.String name,
                 java.lang.String config)
          throws JmsException
Initialise this manager with the given name identifier and the location of the it's XML configuration document.

Specified by:
init in interface JmsManager
Parameters:
name - String containing a name identifier for this manager.
config - String containing the path to the XML configuration document.
Throws:
JmsException - if the manager cannot be initialised.

getConsumer

public JmsConsumer getConsumer(java.lang.String name)
Return the named consumer managed by this manager.

Specified by:
getConsumer in interface JmsManager
Parameters:
name - String containing the name of the consumer to return.
Returns:
JmsConsumer instance or null if no consumer exists with this name.

getProducer

public JmsProducer getProducer(java.lang.String name)
Return the named producer managed by this manager.

Specified by:
getProducer in interface JmsManager
Parameters:
name - String containing the name of the producer to return.
Returns:
JmsProducer instance of null if no produer exists with this name.

destroy

public void destroy()
Destroy this manager by destroying all managed producers and consumers.

Specified by:
destroy in interface JmsManager

onException

public void onException(javax.jms.JMSException jmse)
Receive notifications of connection exceptions and reinitialise this manager instance.

Specified by:
onException in interface javax.jms.ExceptionListener
Parameters:
jmse - JMSException that occured on the connection.