On 2/20/2011 6:14 PM, BJ Hargrave wrote:
<stuff deleted>
You could use dynamic import package but that has some drawbacks.
First you would need to actually load the type(s) to force the
framework to establish the wires before you register the service.
Second, you could only support one version of the package could be a
big limitation.
Yes, I see how supporting only one version of a package could be a big
limitation.
This is why I previously suggested dynamically creating, installing
and starting a bundle which has the proper import package statement.
This bundle does not need any classes in it. You just need an "anchor"
to use for its class loader to access the types and for its context to
register the service. The actual work can be done by your bundle. Make
sure to properly uninstall this bundle when no longer necessary. There
can be many of these bundles for different service types.
Forgive me, but this approach seems kind of clumsy and complex to manage
to me...as it could be necessary to create, install, start and
manage/uninstall a lot of these dynamic bundles...i.e. one for each
distinct imported remote service.
Are there any viable approaches other than this? e.g. can the wiring
of the RSA (or TopologyManager) bundle be dynamically manipulated...to
allow the RSA or TM itself to register the proxy service factory?
Thanks,
Scott
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev