|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.soa.esb.listeners.message.EsbListenerController
public class EsbListenerController
Controlling class that will launch 'message aware' listener child threads for supported transport listener classes, as indicated in the configuration XML tree used in the constructor If you use the 'main' method, configuration file is expected in arg[0]
Can be launched as uppermost controller (it has a main(args) method) Also implements Runnable, and can thus be launched in a child thread from an upper controlling process Listens on a JMS queue (with an optional message selector) for commands (e.g. Quiesce, Reload Parameters, Set End Time, etc.) Parameter reloading can also be set using the PARM_RELOAD_SECS attribute End time for this instance can also be set using the PARM_END_TIME attribute
Nested Class Summary | |
---|---|
static class |
EsbListenerController.State
|
Field Summary | |
---|---|
protected int |
m_iDfltReloadMillis
|
static java.lang.String |
PARM_END_TIME
|
static java.lang.String |
PARM_LISTENER_CLASS
|
static java.lang.String |
PARM_RELOAD_SECS
|
static java.text.SimpleDateFormat |
s_oDateParse
|
Constructor Summary | |
---|---|
protected |
EsbListenerController()
No default constructor - only for child classes |
|
EsbListenerController(ConfigTree config)
Construct a Listener Controller using the specified listener configuration. |
|
EsbListenerController(java.lang.String p_sParameterName)
Construct a Listener Manager from the named repository based configuration. |
Method Summary | |
---|---|
void |
checkParms(ConfigTree p_oP)
Check to see if all needed parameters are there, and assign default values to some of them |
boolean |
continueLooping()
Helper accessor for child processes that provides info to determine if they can continue with yet another execution cycle |
boolean |
endNotRequested()
Accessor to determine if execution time is not expired, and no shutdown request received |
boolean |
endRequested()
Accessor to determine if execution time is expired or shutdown requested |
java.util.Map<java.lang.String,java.lang.Object> |
getControllerAttributes()
Obtain a shallow copy of needed atributes in this object's last loaded parameter tree The local bject is cloned so child threads can use it as they choose to without interfering with the environment Listener processes controlled by this object should keep a reference to this object at construction time, and not call this method again unless they specifically need updated values. |
static EPRManager |
getEprManager()
|
EsbListenerController.State |
getState()
|
static void |
main(java.lang.String[] args)
|
void |
register(ConfigTree config,
EPR epr)
Register an EPR in the registry. |
void |
register(java.lang.String name,
EPR address)
Deprecated. use register (ConfigTree config, EPR address) instead. |
void |
requestEnd()
|
void |
run()
Main execution loop Will continue to run until either a) run time is expired b) quiesce command is received in command queue For every child element that contains a PARM_LISTENER_CLASS attribute, this method will try to launch a child thread instantiating an object of that class, and will call it's run() method Once all child processes are trigered, the main thread will either 1) wait for a message in the command queue (if one was configured) until next reload or end of run period expired or 2) Just sleep if there's no command queue to listen on |
static void |
setDefaultCommandQueue(org.jboss.internal.soa.esb.command.CommandQueue defaultCommandQueue)
Allows a default command queue to be set statically for all EsbListenerController instances. |
boolean |
timeToReload()
Provide a common accessor to determine if parameters have to be reloaded For child threads this means thread execution has to end |
void |
unRegister(java.lang.String name)
Deprecated. use unRegister (String serviceCategoryName, String serviceName, EPR epr) instead. |
void |
unRegister(java.lang.String serviceCategoryName,
java.lang.String serviceName,
EPR epr)
Unregister the EPR from the registry. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int m_iDfltReloadMillis
public static final java.lang.String PARM_RELOAD_SECS
public static final java.lang.String PARM_END_TIME
public static final java.lang.String PARM_LISTENER_CLASS
public static final java.text.SimpleDateFormat s_oDateParse
Constructor Detail |
---|
protected EsbListenerController()
public EsbListenerController(java.lang.String p_sParameterName) throws java.lang.Exception
p_sParameterName
- Name of the Repository entry containing the configuration.
java.lang.Exception
- Unable to load/use the named configuration.public EsbListenerController(ConfigTree config) throws java.lang.Exception
config
- The configuration.
java.lang.Exception
- Unable to load/use the supplied configuration.Method Detail |
---|
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
public java.util.Map<java.lang.String,java.lang.Object> getControllerAttributes()
public EsbListenerController.State getState()
public void checkParms(ConfigTree p_oP) throws java.lang.Exception
p_oP
- ConfigTree - Where to look for the mandatory/optional
configuration attributes
java.lang.Exception
- -
If attributes are wrong or not enough for a proper runtime
configurationpublic static void setDefaultCommandQueue(org.jboss.internal.soa.esb.command.CommandQueue defaultCommandQueue)
defaultCommandQueue
- The defaultCommandQueue to set.public void run()
run
in interface java.lang.Runnable
public void requestEnd()
public boolean endRequested()
public boolean endNotRequested()
public boolean timeToReload()
public boolean continueLooping()
public static EPRManager getEprManager()
public void register(java.lang.String name, EPR address)
name
- address
- public void unRegister(java.lang.String name)
name
- public void register(ConfigTree config, EPR epr) throws RegistryException
config
- - a config tree containing the deployment-configuration of the service.epr
- - the epr (EndPoint Reference) of the service.
RegistryException
public void unRegister(java.lang.String serviceCategoryName, java.lang.String serviceName, EPR epr) throws RegistryException
serviceCategoryName
- - name of the category of the service ('Content Based Routing')serviceName
- - name of the service ("epr
-
RegistryException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |