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

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.message.MessageAwareListener
All Implemented Interfaces:
java.io.Serializable, java.lang.Runnable, ManagedLifecycle

public class MessageAwareListener
extends AbstractThreadedManagedLifecycle

Esb Message aware transport independent listener.

Relies on the CourierFactory to obtain an appropriate Courier for the EPR this listener will be listening on
Keeps a thread pool to instantiate ActionProcessingPipelines whenever a Message is received

Since:
Version 4.0
Author:
schifest@heuristica.com.ar
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle
PARAM_TERMINATION_PERIOD
 
Constructor Summary
MessageAwareListener(ConfigTree config)
          public constructor
 
Method Summary
protected  void checkMyParms()
          Check for mandatory and optional attributes in parameter tree
protected  void doInitialise()
          Handle the initialisation of the managed instance.
protected  void doRun()
          Execute on the thread.
protected  void doStart()
          Handle the start of the managed instance.
protected  void doThreadedDestroy()
          Handle the threaded destroy of the managed instance.
 void waitForEventAndProcess(long maxWaitMillis)
          We have JMS transactional delivery/work semantics: before pulling a unit of work we start a transaction.
 
Methods inherited from class org.jboss.soa.esb.listeners.lifecycle.AbstractThreadedManagedLifecycle
addManagedLifecycleThreadEventListener, doDestroy, doStop, isRunning, isStopped, isStopping, removeManagedLifecycleThreadEventListener, run, setRunning, waitForRunningStateChange, waitUntilStopped, waitUntilStopped, waitUntilStopping
 
Methods inherited from class org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle
addManagedLifecycleEventListener, changeState, destroy, getConfig, getState, getTerminationPeriod, initialise, removeManagedLifecycleEventListener, start, stop, waitUntilDestroyed, waitUntilDestroyed, waitUntilNotState, waitUntilState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageAwareListener

public MessageAwareListener(ConfigTree config)
                     throws ConfigurationException
public constructor

Parameters:
config - ConfigTree - Containing 'static' configuration for this instance
Throws:
ConfigurationException
Method Detail

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

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.

doStart

protected void doStart()
                throws ManagedLifecycleException
Handle the start of the managed instance.

Overrides:
doStart in class AbstractThreadedManagedLifecycle
Throws:
ManagedLifecycleException - for errors while starting.

doRun

protected void doRun()
Execute on the thread.

Specified by:
doRun in class AbstractThreadedManagedLifecycle

waitForEventAndProcess

public void waitForEventAndProcess(long maxWaitMillis)
We have JMS transactional delivery/work semantics: before pulling a unit of work we start a transaction. If the pipeline completes successfully then we will commit that transaction and the OUW will be deleted. If we have to roll back the transaction then the UOW will be placed back on the input "queue" (assumes that the courier is transactional).

Parameters:
maxWaitMillis -

doThreadedDestroy

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

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