Hi,
What I can suggest is still the listener thing, but you needn't ad
listener everywhere, you only need add it in the bundle which need
trigger message process start.
If the waiting bundle use spring-dm for the application context, then
the bundle which need trigger message process start implements an
org
.springframework
.osgi.context.event.OsgiBundleApplicationContextListener,
In public void
onOsgiApplicationEvent(OsgiBundleApplicationContextEvent event) method,
if the event instanceof OsgiBundleContextRefreshedEvent, then the
application context is actually started.
If the waiting bundle use blueprint for the application contex, then
the bundle which need trigger message process start implements
org.osgi.service.blueprint.container.BlueprintListener,
In public void blueprintEvent(BlueprintEvent blueprintEvent) method,
if the BlueprintEvent type is BlueprintEvent.CREATE, then the
application context is actually started.
Freeman
On 2011-12-30, at 上午10:28, ascheffe wrote:
So, I'm not sure if this is answered elsewhere but I'm having trouble
Googling a solution.
I'm noticing that just because a bundle is registered as active, it
might
not exactly be active, and its application context may still be
loading.
I was looking for an easy way to determine when a bundle had finished
loading its application context.
Little detail why:
I have a bundle that is waiting for an osgi service to become
available.
The bundle waiting will change to active even though the application
context
has not fully loaded (still waiting for the service).
This is all an issue because I have camel routes in the waiting
bundle that
I need to know are active before I can start processing messages in
the
system. I was looking for an easier way than registering listeners
on each
of the routes or some kind of special route policy, then
coordinating all of
it.
Any help or redirects you could give me would be great. I'm not having
massive amounts of luck figuring out a good way to do this on my own.
--
View this message in context:
http://servicemix.396122.n5.nabble.com/Active-Bundle-Not-exactly-Active-tp5109090p5109090.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
---------------------------------------------
Freeman Fang
FuseSource
Email:ff...@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com