org.jboss.soa.esb.listeners.gateway
Class JmsGatewayListener

java.lang.Object
  extended by org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle
      extended by org.jboss.soa.esb.listeners.lifecycle.AbstractThreadedManagedLifecycle
          extended by org.jboss.soa.esb.listeners.gateway.JmsGatewayListener
All Implemented Interfaces:
java.io.Serializable, java.lang.Runnable, ManagedLifecycle

public class JmsGatewayListener
extends AbstractThreadedManagedLifecycle

See Also:
Serialized Form

Field Summary
protected  java.lang.Object _composer
           
protected  java.lang.Class _composerClass
           
protected  java.lang.String _composerName
           
protected  ConfigTree _config
           
protected  Courier _courier
           
protected static org.apache.log4j.Logger _logger
           
protected  javax.jms.MessageConsumer _messageReceiver
           
protected  java.lang.String _messageSelector
           
protected  EPR _myEpr
           
protected  java.lang.reflect.Method _processMethod
           
protected  javax.jms.Queue _queue
           
protected  javax.jms.QueueConnection _queueConnection
           
protected  java.lang.String _queueName
           
protected  javax.jms.QueueSession _queueSession
           
protected  java.lang.String _serviceCategory
           
protected  java.lang.String _serviceName
           
protected  long _sleepForRetries
           
protected  java.util.Collection<EPR> _targetEprs
           
protected  java.lang.String _targetServiceCategory
           
protected  java.lang.String _targetServiceName
           
 
Fields inherited from class org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle
PARAM_TERMINATION_PERIOD
 
Constructor Summary
JmsGatewayListener(ConfigTree listenerConfig)
           
 
Method Summary
protected  void checkMyParms()
          Check for mandatory and optional attributes in parameter tree
protected  void doDestroy()
          Handle the destroy of the managed instance.
protected  void doInitialise()
          Handle the initialisation of the managed instance.
protected  void doRun()
          Execute on the thread.
protected  javax.jms.Message receiveOne()
          Receive one message and retry if connection
protected  void resolveComposerClass()
           
 
Methods inherited from class org.jboss.soa.esb.listeners.lifecycle.AbstractThreadedManagedLifecycle
addManagedLifecycleThreadEventListener, doStart, doStop, isRunning, isStopped, isStopping, removeManagedLifecycleThreadEventListener, run, setRunning, waitForRunningStateChange, waitUntilStopped, waitUntilStopped
 
Methods inherited from class org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle
addManagedLifecycleEventListener, changeState, destroy, getState, getTerminationPeriod, initialise, removeManagedLifecycleEventListener, start, stop, waitForStateChange, waitUntilDestroyed, waitUntilDestroyed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_logger

protected static final org.apache.log4j.Logger _logger

_queueName

protected java.lang.String _queueName

_queueConnection

protected javax.jms.QueueConnection _queueConnection

_queueSession

protected javax.jms.QueueSession _queueSession

_queue

protected javax.jms.Queue _queue

_messageReceiver

protected javax.jms.MessageConsumer _messageReceiver

_messageSelector

protected java.lang.String _messageSelector

_config

protected ConfigTree _config

_sleepForRetries

protected final long _sleepForRetries

_serviceCategory

protected java.lang.String _serviceCategory

_serviceName

protected java.lang.String _serviceName

_targetServiceCategory

protected java.lang.String _targetServiceCategory

_targetServiceName

protected java.lang.String _targetServiceName

_myEpr

protected EPR _myEpr

_targetEprs

protected java.util.Collection<EPR> _targetEprs

_composerName

protected java.lang.String _composerName

_composerClass

protected java.lang.Class _composerClass

_composer

protected java.lang.Object _composer

_processMethod

protected java.lang.reflect.Method _processMethod

_courier

protected Courier _courier
Constructor Detail

JmsGatewayListener

public JmsGatewayListener(ConfigTree listenerConfig)
                   throws ConfigurationException
Throws:
ConfigurationException
Method Detail

doInitialise

protected void doInitialise()
                     throws ManagedLifecycleException
Handle the initialisation of the managed instance.

Specified by:
doInitialise in class AbstractManagedLifecycle
Throws:
ManagedLifecycleException - for errors while initialisation.

doRun

protected void doRun()
Execute on the thread.

Specified by:
doRun in class AbstractThreadedManagedLifecycle

doDestroy

protected void doDestroy()
                  throws ManagedLifecycleException
Handle the destroy of the managed instance.

Overrides:
doDestroy in class AbstractThreadedManagedLifecycle
Throws:
ManagedLifecycleException - for errors while destroying.

checkMyParms

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

Throws:
ConfigurationException - - if mandatory atts are not right or actionClass not in classpath

resolveComposerClass

protected void resolveComposerClass()
                             throws ConfigurationException
Throws:
ConfigurationException

receiveOne

protected javax.jms.Message receiveOne()
Receive one message and retry if connection

Returns:
javax.jms.Message - One input message, or null