The bundle that registers the service could create this custom class loader with its bundle class loader as its parent, and with appropriate imports for that bundle the custom class loader would be able to resolve external references in your bag of class bytes. This would include the import of the package that holds your service interface. The life cycle of the class loader and the service registration would be tied to the life cycle of this implementation bundle.
In this way your creation of a custom class loader is "simply" an implementation detail of your bundle. If you're going to be materializing a bag of bytes into a class, you're going to need a class loader *somewhere*, so you're not *adding* any additional smell. ;-) /djk On Mar 19, 2012, at 5:02 AM, <[email protected]> wrote: > Hm, that doesn't smell too good (creating custom ClassLoaders in an OSGi > system), but it might work. Need to examine that more closely. _______________________________________________ OSGi Developer Mail List [email protected] https://mail.osgi.org/mailman/listinfo/osgi-dev
