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.