toolbox.jms
Class JmsObject

Package class diagram package JmsObject
java.lang.Object
  extended by toolbox.jms.JmsObject
Direct Known Subclasses:
JmsConsumerImpl, JmsProducerImpl

public class JmsObject
extends java.lang.Object

Convenience base class for deriving other JMS objects from.


Field Summary
protected  boolean m_exposeContext
           
protected  JNDIConfig m_jndiConfig
           
 
Constructor Summary
protected JmsObject()
          Protected constructor.
 
Method Summary
protected  void destroyObject()
          Destroy this object.
protected  javax.jms.Connection getConnection()
          Returns the connection for this object.
protected  javax.jms.Destination getDestination()
          Returns the destination that this object will use for communication.
 java.lang.String getName()
          Returns the name of this JmsObject.
protected  javax.jms.Session getSession()
          Returns the session for this object.
protected  int getType()
          Returns the type of this JmsObject.
protected  void initObject(java.util.Map props, javax.jms.ExceptionListener exLsnr)
          Initialise this object with the given configuration properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_jndiConfig

protected JNDIConfig m_jndiConfig

m_exposeContext

protected boolean m_exposeContext
Constructor Detail

JmsObject

protected JmsObject()
Protected constructor.

Method Detail

initObject

protected void initObject(java.util.Map props,
                          javax.jms.ExceptionListener exLsnr)
                   throws JmsException
Initialise this object with the given configuration properties. This base class will receive the properties as defined in the default implementations of the JmsConsumer and JmsProducer interfaces.

Parameters:
props - Map containing the configuration properties.
exLsnr - Optional ExceptionListener instance to register with the created Connection.
Throws:
JmsException - if the object cannot be intialised.

getName

public java.lang.String getName()
Returns the name of this JmsObject.

Returns:
String containing the name of this object.

getType

protected int getType()
Returns the type of this JmsObject. Can be JmsConstants.POINT_TO_POINT or JmsConstants.PUBLISH_SUBSCRIBE

Returns:
int indicating the type of object.

getDestination

protected javax.jms.Destination getDestination()
Returns the destination that this object will use for communication.

A Topic will be returned if this object is of type JmsConstants.POINT_TO_POINT. a Queue will be returned if this object is of type JmsConstants.PUBLISH_SUBSCRIBE

Returns:
Destination used for communication by this object.

getSession

protected javax.jms.Session getSession()
Returns the session for this object.

Returns:
Session created by this object.

getConnection

protected javax.jms.Connection getConnection()
Returns the connection for this object.

Returns:
Connection created by this object.

destroyObject

protected void destroyObject()
Destroy this object.