org.jboss.soa.esb.listeners
Class AbstractManagedListener
java.lang.Object
java.util.Observable
org.jboss.soa.esb.listeners.AbstractManagedListener
- All Implemented Interfaces:
- java.lang.Runnable, java.util.Observer
- Direct Known Subclasses:
- HttpListener, MessageAwareListener
public abstract class AbstractManagedListener
- extends java.util.Observable
- implements java.lang.Runnable, java.util.Observer
All ESB 'managed' listeners (gateways and message) should extend this class.
Responsibility as an Observable is to notify Observers when it is ready
to run (Boolean.TRUE) and when it's not (Boolean.FALSE)
It must be a Runnable that will be started in a thread forked and
controlled by a ListenerManager (the _controller)
It is supposed to manage it's own thread pool of 'actions' (the
_execService)
- Since:
- Version 4.0
- Author:
- schifest@heuristica.com.ar
Methods inherited from class java.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_config
protected ConfigTree _config
_controller
protected ListenerManager _controller
_bRegistered
protected boolean _bRegistered
_eprCategoryName
protected java.lang.String _eprCategoryName
_eprName
protected java.lang.String _eprName
_epr
protected EPR _epr
_maxThreads
protected int _maxThreads
_defaultMaxThreads
protected int _defaultMaxThreads
_pauseLapseInMillis
protected long _pauseLapseInMillis
_execService
protected java.util.concurrent.ExecutorService _execService
_logger
protected org.apache.log4j.Logger _logger
AbstractManagedListener
protected AbstractManagedListener(ListenerManager controller,
ConfigTree config)
throws ConfigurationException
- public constructor
- Parameters:
controller
- ListenerManager - the controlling processconfig
- ConfigTree - Containing 'static' configuration for this
instance
- Throws:
java.lang.Exception
ConfigurationException
isMessageAware
public abstract boolean isMessageAware()
initializeRun
public abstract boolean initializeRun()
finalizeRun
public abstract boolean finalizeRun()
waitForEventAndProcess
public abstract void waitForEventAndProcess(long maxWaitMillis)
checkMyParms
protected void checkMyParms()
throws ConfigurationException
- Throws:
ConfigurationException
registerProcess
protected void registerProcess()
throws RegistryException
- Throws:
RegistryException
unregisterProcess
protected void unregisterProcess()
throws RegistryException
- Throws:
RegistryException
waitUntilReady
public void waitUntilReady()
- Wait until the registration process finished, a PickupCourier was
obtained , and the pool thread is instantiated
update
public void update(java.util.Observable o,
java.lang.Object arg)
- Specified by:
update
in interface java.util.Observer
hasActiveTreads
public boolean hasActiveTreads()
resetThreadCount
protected void resetThreadCount()
updateThreadCount
protected void updateThreadCount(java.lang.Integer i)
obtainAttribute
protected java.lang.String obtainAttribute(java.lang.String p_sAtt,
java.lang.String p_sDefault)
throws ConfigurationException
- Throws:
ConfigurationException
run
public void run()
- Loops until controlling process determines
Invokes appropriate
Courier to obtain incoming ESB Messages
When one is received,
instantiates an action processing pipeline to process it
- Specified by:
run
in interface java.lang.Runnable