org.jboss.soa.esb.listeners.old
Class AbstractListener

java.lang.Object
  extended by org.jboss.soa.esb.listeners.old.AbstractListener
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
AbstractPassiveListener, AbstractPoller, JmsQueueListener

public abstract class AbstractListener
extends java.lang.Object
implements java.lang.Runnable

Base abstract listener implementation.

Since:
Version 4.0
Author:
tom.fennelly@jboss.com

Nested Class Summary
protected  class AbstractListener.ActionProcessingPipeline
          Action Processing Pipeline.
 
Field Summary
protected  ConfigTree listenerConfig
           
protected  org.apache.log4j.Logger logger
           
protected  int m_iMaxThr
           
protected  int m_iQthr
           
protected  int m_iSleepForThreads
           
protected  int m_iUpperThreadLimit
           
protected  ActionDefinitionFactory m_oActionDefinitionFactory
           
protected  java.lang.String[] m_oActions
           
protected  GpListener m_oDad
           
protected  MessageFactory m_oMsgFactory
           
protected  java.lang.ThreadGroup m_oThrGrp
           
static java.lang.String MESSAGE_PROCESSING_ACTIONS_LIST
          Name constant def for the Message attachemnt carrying the list of actions to be applied to the incomming message.
 
Constructor Summary
protected AbstractListener(GpListener p_oDad, ConfigTree p_oParms, ActionDefinitionFactory actionDefinitionFactory)
           
 
Method Summary
protected abstract  void close()
          Close the listener implemenation.
protected abstract  void processingComplete(java.lang.Object initialMsg)
          Called on the listener implementation when pipeline processing of a message is complete.
protected abstract  void processingError(java.lang.Object initialMsg, ActionProcessor processor, java.lang.Throwable error)
          Called on the listener implementation when pipeline processing error has occured.
protected abstract  java.lang.Object[] receive()
          Receive message from underlying channel implementation.
 void run()
          Implement run method for this Runnable

Will continue to run until controlling class (ref in m_oDad) indicates no more looping allowed for all child classes

This condition will not prevent child processes to finish normally

 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MESSAGE_PROCESSING_ACTIONS_LIST

public static final java.lang.String MESSAGE_PROCESSING_ACTIONS_LIST
Name constant def for the Message attachemnt carrying the list of actions to be applied to the incomming message. This allows the configured processing pipeline to be overridden by the Message producer.

See Also:
Constant Field Values

m_iSleepForThreads

protected int m_iSleepForThreads

m_iUpperThreadLimit

protected int m_iUpperThreadLimit

m_iQthr

protected int m_iQthr

m_iMaxThr

protected int m_iMaxThr

m_oThrGrp

protected java.lang.ThreadGroup m_oThrGrp

logger

protected org.apache.log4j.Logger logger

m_oDad

protected GpListener m_oDad

listenerConfig

protected ConfigTree listenerConfig

m_oActions

protected java.lang.String[] m_oActions

m_oActionDefinitionFactory

protected ActionDefinitionFactory m_oActionDefinitionFactory

m_oMsgFactory

protected MessageFactory m_oMsgFactory
Constructor Detail

AbstractListener

protected AbstractListener(GpListener p_oDad,
                           ConfigTree p_oParms,
                           ActionDefinitionFactory actionDefinitionFactory)
                    throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

run

public void run()
Implement run method for this Runnable

Will continue to run until controlling class (ref in m_oDad) indicates no more looping allowed for all child classes

This condition will not prevent child processes to finish normally

Specified by:
run in interface java.lang.Runnable

receive

protected abstract java.lang.Object[] receive()
Receive message from underlying channel implementation.

Implementations must perform a blocking receive.

Returns:
An array of Objects received on the channel.

processingError

protected abstract void processingError(java.lang.Object initialMsg,
                                        ActionProcessor processor,
                                        java.lang.Throwable error)
Called on the listener implementation when pipeline processing error has occured.

Parameters:
initialMsg - The message that was initialy supplied to the pipeline.
processor - The processor that raised the error. Can be null where the error was raised before pipeline processing of the message.
error - The error. Can be null.

processingComplete

protected abstract void processingComplete(java.lang.Object initialMsg)
Called on the listener implementation when pipeline processing of a message is complete.

Parameters:
initialMsg - The message that was initialy supplied to the pipeline.

close

protected abstract void close()
Close the listener implemenation.

Allows the listener to perform relevant close/cleanup tasks.