[jboss-jira] [JBoss JIRA] Commented: (JBESB-256) An explicit Thread.sleep should not be required between starting the message aware listeners, and starting the gateway listeners
Tom Fennelly (JIRA)
jira-events at jboss.com
Fri Dec 1 07:26:55 EST 2006
[ http://jira.jboss.com/jira/browse/JBESB-256?page=comments#action_12348022 ]
Tom Fennelly commented on JBESB-256:
------------------------------------
listeners:org.jboss.soa.esb.listeners.message.EsbListenerController must be up and running fully (in its own thread) before listeners:org.jboss.soa.esb.listeners.gateway.GatewayListenerController.
Currently it's Runnable and has an internal state property that can be accessed via a getState method. I'd suggest 2 mods to EsbListenerController for this (can be ignored of course :-) ):
1. Less Important:
Add an additional state of something like "Ready" and set the state to this before line 316. At this point the listeners under its control are all up and running.
2. More Important:
I'd suggest making the Runability of EsbListenerController hidden internally and forcing its constrution into a static factory method (make all constructors private). From in there, you can construct the instance, start your thread, and block returning from the factory method until the internal (hidden) Runnable is in a state of "Ready". This will stop anyone launching an instance of this class and continuing on before it is "ready".
Just a suggestion - of course there are other ways of doing it I'm sure.
> An explicit Thread.sleep should not be required between starting the message aware listeners, and starting the gateway listeners
> --------------------------------------------------------------------------------------------------------------------------------
>
> Key: JBESB-256
> URL: http://jira.jboss.com/jira/browse/JBESB-256
> Project: JBoss ESB
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: ESB Core
> Affects Versions: 4.0 RC1
> Reporter: Tom Fennelly
> Assigned To: Mark Little
> Priority: Critical
> Fix For: 4.0
>
>
> You have to manually enter a Thread.sleep between launching EsbListenerController in a thread and launching GatewayListenerController. I spent ages trying to work out an error until I was let in on the little secret. If EsbListenerController is this scencitive, it should manage it's startup such that the caller blocks until EsbListenerController is fully up and ready. This would be a piece of * to do.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list