|
Re: How to prevent bundle resume on restart [message #780492 is a reply to message #780478] |
Wed, 18 January 2012 10:06 |
|
Am 18.01.2012 09:44, schrieb Jan Mauersberger:
> However, after a restart the framework is resuming all bundles that were
> active on shutdown, among others also my bundle. Thus the
> activator.start() method is called rather early in the startup phase
> before(!) anything as application or product or eve even workspace is
> known. Since my startup code depends on that I would like to know
> whether it is possible to prevent suspension/resumption by any means or
> whether someone had similar problems and a solution.
Relying on startup order and lazy start behavior is nearly impossible.
You may set explicit set start levels to ensure a specific start order
but then you won't have lazy activation.
I think it could work if you defer your processing until the bundles are
available. For example, in your start method check if everything is
available and if not register a bundle listener. The listener will be
notified about bundle changes and you could attach fragments more
dynamically (eventually also supporting detaching when a dependency is
stopped). Doesn't make the implementation easier, though.
-Gunnar
--
Gunnar Wagenknecht
gunnar@wagenknecht.org
http://wagenknecht.org/
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03869 seconds