On 26/12/2007, David Leangen <[EMAIL PROTECTED]> wrote: > > > Hiya, > > Is there a way to import a class into a bundle at runtime when the > imported class is not declared as imported in the manifest? > > I want to be able to use and work with certain classes without knowing > what they are at build time.
have you looked at using DynamicImport-Package? (section 3.8.2 of R4 spec) you can use wildcards, so you can load classes without knowing the details in advance (ie. they are resolved when needed, not when the bundle is resolved) note that once a package has been resolved using DynamicImport-Package, it won't be changed until the importing bundle is re-resolved (ie. it acts like a standard Import-Package from this point onwards) if a package fails to resolve (ie. no bundle exports a matching package) then the load will fail, and the framework will check again the next time it's needed (ie. failed dynamic imports are not cached) HTH Thank you! > David > > > > _______________________________________________ > OSGi Developer Mail List > [email protected] > http://www2.osgi.org/mailman/listinfo/osgi-dev > -- Cheers, Stuart
_______________________________________________ OSGi Developer Mail List [email protected] http://www2.osgi.org/mailman/listinfo/osgi-dev
