org.jboss.soa.esb.listeners.message
Class JmsQueueListener

java.lang.Object
  extended by org.jboss.soa.esb.listeners.message.AbstractListener
      extended by org.jboss.soa.esb.listeners.message.JmsQueueListener
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
CbrJmsQueueListener

public class JmsQueueListener
extends AbstractListener

Esb Message aware JMS queue listener.

Expects an Object message whose getObject() method returns an org.jboss.soa.esb.message.Message
Clones the 'static' ConfigTree with which this listener was created, and stores the cloned tree inside the Message (to enable all actions in the chain to use the configuration)
Instantiates and runs a new ActionProcessingPipeline on the received esb Message (augmented with ConfigTree) that will in turn instantiate and run all action classes in the chain

Since:
Version 4.0
Author:
schifest@heuristica.com.ar

Field Summary
protected  boolean _bError
           
protected  JMSEpr _epr
           
protected  java.lang.String _eprCategoryName
           
protected  java.lang.String _eprName
           
protected  int _iSleepForRetry
           
protected  java.lang.String _jmsFactoryClass
           
protected  javax.naming.Context _jndiCtx
           
protected  java.lang.String _jndiType
           
protected  java.lang.String _jndiURL
           
protected static org.apache.log4j.Logger _logger
           
protected  javax.jms.QueueConnection _oQconn
           
protected  javax.jms.QueueSession _oQsess
           
protected  javax.jms.Queue _oQueue
           
protected  java.lang.String _queueName
           
protected  javax.jms.MessageConsumer _receiver
           
protected  java.lang.String _sSelector
           
 
Fields inherited from class org.jboss.soa.esb.listeners.message.AbstractListener
_config, _controller, logger, m_iMaxThr, m_iUpperThreadLimit, PARM_MAX_THREADS, pipelineExecutorPool
 
Constructor Summary
JmsQueueListener(EsbListenerController controller, ConfigTree config)
          public constructor
 
Method Summary
protected  void checkMyParms()
          Check for mandatory and optional attributes in parameter tree
protected  void cleanup()
           
protected  java.lang.String obtainAttribute(java.lang.String p_sAtt, java.lang.String p_sDefault)
           
protected  Message receiveEsbMessage(long millis)
           
 void run()
          Loops until controlling process determines
Waits for JMS Object messages containing ESB messages
When one is received, instantiates an action processing pipeline to process it
Pipeline is started in new Thread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_eprCategoryName

protected java.lang.String _eprCategoryName

_eprName

protected java.lang.String _eprName

_epr

protected JMSEpr _epr

_receiver

protected javax.jms.MessageConsumer _receiver

_bError

protected boolean _bError

_oQconn

protected javax.jms.QueueConnection _oQconn

_oQsess

protected javax.jms.QueueSession _oQsess

_oQueue

protected javax.jms.Queue _oQueue

_queueName

protected java.lang.String _queueName

_sSelector

protected java.lang.String _sSelector

_jndiType

protected java.lang.String _jndiType

_jndiURL

protected java.lang.String _jndiURL

_jmsFactoryClass

protected java.lang.String _jmsFactoryClass

_jndiCtx

protected javax.naming.Context _jndiCtx

_iSleepForRetry

protected int _iSleepForRetry

_logger

protected static transient org.apache.log4j.Logger _logger
Constructor Detail

JmsQueueListener

public JmsQueueListener(EsbListenerController controller,
                        ConfigTree config)
                 throws ConfigurationException
public constructor

Parameters:
controller - EsbListenerController - the controlling process
config - ConfigTree - Containing 'static' configuration for this instance
Throws:
java.lang.Exception
ConfigurationException
Method Detail

run

public void run()
Loops until controlling process determines
Waits for JMS Object messages containing ESB messages
When one is received, instantiates an action processing pipeline to process it
Pipeline is started in new Thread


checkMyParms

protected void checkMyParms()
                     throws ConfigurationException
Check for mandatory and optional attributes in parameter tree

Throws:
java.lang.Exception - - if mandatory atts are not right or actionClass not in classpath
ConfigurationException

receiveEsbMessage

protected Message receiveEsbMessage(long millis)

cleanup

protected void cleanup()

obtainAttribute

protected java.lang.String obtainAttribute(java.lang.String p_sAtt,
                                           java.lang.String p_sDefault)
                                    throws ConfigurationException
Throws:
ConfigurationException