I know that we can use WovenClass.getBundleWiring().getClassLoader() to get the CLassLoader of the Bundle, and then use the good old reflection tricks to call the defineClass() method, but is there any other way (cleaner) to add new class into the OSGi classloader ?
--G 2012/1/10 Guillaume Sauthier (OW2) <[email protected]> > Hi all > > I'm working on an EJB3 container (EasyBeans) that is using ASM to generate > and modify class files of the EJBs. > It is also working in an OSGi environment, with EjbJars having OSGi > metadatas in the Manifest. At the moment, we still have to pre-define the > list of additionally imported packages (consequence of the ASM bytecode > enhancement). > > We want to take advantage of the WeavingHook service that looks like to be > designed for that kind of use case. > Nevertheless, looking at the API, it seems that it is designed to only > allow byte code modification. > Is there a way to introduce in the classloader the newly created (from > scratch) bytecode of a class ? > > Thanks > --G >
_______________________________________________ OSGi Developer Mail List [email protected] https://mail.osgi.org/mailman/listinfo/osgi-dev
