ObjectWeb Consortium
Search ObjectWeb Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | oscar List | December 2005 Index

<--  Date Index  --> <--  Thread Index  -->

Re: [oscar] Using services from unstarted bundles


On Wednesday 07 December 2005 01:25, Nick_Hofstede@xxxxxxxxxxxxxxxxxxxxxx 
wrote:
> Another obious solution is starting all bundles in order to get
> BundleContexts, but this is something everyone is trying to avoid due to
> large startup costs.

The start-up cost can be minimal, depending on how you write your code. If 
the 
bundle activator does not trigger a "chain loading" of classes, the start-up 
time is very fast.

IMHO, you should really embrace the service thinking, and view services as 
active (instead of passive) components, and place those under OSGi's 
lifecycle. It will do you good in the long run.

> In short, what is the OSGi-answer if you have bundles that don't need/want
> to be started but still need to access services (for logging for example)?

If you have services that are slow to initialize, but you want them to be 
available on-demand, I suggest that you look into the service factory system, 
which allows you to register a small factory, instead of the service instance 
itself.

Cheers
Niclas



<--  Date Index  --> <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster.