Activation of optionally required bundles [message #35079] |
Wed, 11 February 2004 07:04  |
Eclipse User |
|
|
|
Originally posted by: igorf.ca.ibm.com
I have bundle A which optionally requires bundle B. Bundle B is not
available at Eclipse startup but installed using
BundleContext#install(String) before bundle A is activated. I have
expected that when bundle A is activated, bundle B will be activated as
well and packages provided by bundle B will be visible to A. However,
this is not happening and I have to force activation of bundle B before
bundle A gets activated. The problem is, activation of bundle B is very
expensive so I would like to avoid it until it is absolutely necessary.
Any advice?
Regards,
Igor
|
|
|
|
Re: Activation of optionally required bundles [message #35136 is a reply to message #35113] |
Wed, 11 February 2004 21:22  |
Eclipse User |
|
|
|
Originally posted by: jeff_mcaffer_REMOVE.ca.ibm.com
Also, you should really be careful with how much work you do in the startup
code for a plugin. There are many reasons for a plugin to be activated.
For example, if I have a class whose signature references one of yours, it
is very likely that your class will be loaded when mine is verified. I may
actually have no interest in invoking your function but because one of your
classes is loaded, you will be activated. If you do alot of work in
start/startup(), it may well be wasted.
In general anything that you need to do should be done even more lazily.
That is, when the model, data, service, ... (whatever it is you are
initializing) is actually needed.
Jeff
"Pascal Rapicault" <pascal_rapicault@yahoo.fr> wrote in message
news:c0ej5m$26p$1@eclipse.org...
> In OSGi, in order to minimize the perturbation of the running system,
> installing simply means declaring the bundle to the framework.
> Therefore, in order to be considered during classload, installed bundles
> must be refreshed (or started which includes an implicit refresh) which
may
> be a costly operation requiring shutdown and restart of bundles, etc...
>
> So in your case, once B is installed do a refresh on it (there is a code
> snipped doing that in org.eclipse.update.configurator) and A should then
see
> it. Then, let the automatic activation do the rest for you.
>
> PaScaL
>
> "Igor Fedorenko" <igorf@ca.ibm.com> a
|
|
|
Powered by
FUDForum. Page generated in 0.03864 seconds