Any way to know when bundles are started? [message #543863] |
Wed, 30 June 2010 17:31  |
Eclipse User |
|
|
|
My bundle activator schedules a background job for 5 seconds in the future. The job should only run after "startup" has completed, and since this is a server, all bundles are activated at startup.
Instead of waiting 5 seconds, how can I wait for "startup" (StartLevelManager#resumeBundles) to complete? Do I use EventHook, or the EventDispatcher service?
|
|
|
|
|
|
Re: Any way to know when bundles are started? [message #545496 is a reply to message #545430] |
Thu, 08 July 2010 00:22  |
Eclipse User |
|
|
|
Andrew Niefer wrote on Wed, 07 July 2010 13:45 | You can probably check StartLevel#getStartLevel() and compare it to
BundleContext.getProperty("osgi.startLevel")
|
When my bundle is starting,
getStartLevel() returns 4,
context.getProperty("osgi.bundles.defaultStartLevel") returns 4 too.
But, when the event type STARTED is fired, getStartLevel() returns 6, (as set by EclipseStarter). It seems like getStartLevel() returns the current level obtained, not the target level. "osgi.startLevel" is on FrameworkProperties, but that's an eclipse internal class.
|
|
|
Powered by
FUDForum. Page generated in 0.10641 seconds