Well, if you use resolution:=optional then either your bundle is wired
to a provider on start or it isn't -- hence, you only need to check
when the bundle is started whether a class from that package is
available to you or not and if it is then just register you service.

In case what you want to do is to allow your bundle to get wired to
the package of a bundle installed after your bundle has been already
started you will have to use a DynamicImport-Package. In that case you
can then do the same check on bundle startup and everytime a bundle
gets installed (using a BundleListener) until you get wired to a
provider. Then make your service available.

regards,

Karl

On Thu, Oct 30, 2008 at 7:42 AM, Martin Thelian <[EMAIL PROTECTED]> wrote:
> Hi,
>
> in my project I have some bundles providing mandatory and optional services,
> whereas the optional services are depending on java-packages imported with
> resolution:=optional. E.g. a servlet capable to generate charts if a bundle
> containing JFreeChart is installed.
>
> What is the best way to register such a service once a required class
> appears in the bundle classpath?
>
> Thanks.
> Regards,
> Martin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
Karl Pauls
[EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to