>
> [osgi-dev] Discovery Mechanism in OSGi bundles
>
> Hi,
> I would like to know whether there is any way to implement
> discovery mechanism between the OSGi bundles or not.
> In precise,is there any mechanism for the client OSGi bundle to find
> the currently available server OSGi bundle (among many instances
> of server bundles).
Without knowing the specifics of your particular situation, if your
concern is simply finding a particular Bundle object, you have the
BundleListener, the BundleTracker, or manually querying
BundleContext.getBundles() then examining their properties. The
BundleTracker has a state mask that can make your job easier.
If your concern is getting access to some type of functionality, you might
be better off using the service registry and having the "server" bundle
register a service which the "client" bundle would then find via a
ServiceListener or ServiceTracker. That way, you're coupled to a more
generic service interface rather than a particular bundle. Filters can be
used to distinguish between similar services.
If your concern is how your dependencies are getting wired together, you
have the Require-Bundle header, the "uses" directive, or the new bundle
hooks.
John
_______________________________________________
> OSGi Developer Mail List
> [email protected]
> https://mail.osgi.org/mailman/listinfo/osgi-dev
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev