Leo:
Have not had a chance to dig into what your doing just yet - but in the meantime, have you taken a look at the curent approach in Merlin. Basically the jar file is scanned for meta-info entires (no classloading involved) and the meta info is loaded into a type repository. This eliminates any need for a custom classloader. Also, the seperate type repository provides the directory of available components - so you go to the type repository to locate a component that provides a service, and once located, you then worry about classloader via usual channels.
Stephen.
Leo Sutic wrote:
OK, I have added some code to scan ClassLoaders:
URLClassLoader cl1 = new URLClassLoader (new URL[]{new File ("api/target/cl1/").toURL ()}, getClass().getClassLoader ()); URLClassLoader cl2 = new URLClassLoader (new URL[]{new File ("api/target/cl2/cl2.jar").toURL ()}, getClass().getClassLoader ());
ClassLoaderUtil clUtil = ClassLoaderUtil.getClassLoaderUtil ();
Collection cl1Classes = clUtil.getClasses (cl1); Collection cl2Classes = clUtil.getClasses (cl2);
System.out.println (cl1Classes); System.out.println (cl2Classes);
Its in avalon-sandbox/attributes.
In addition, there's an: public static Collection getClassesWithAttributeType (Collection classes, Class attributeClass)
in Attributes.
Will this fulfill your needs?
/LS
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--
Stephen J. McConnell mailto:[EMAIL PROTECTED] http://www.osm.net
Sent via James running under Merlin as an NT service. http://avalon.apache.org/sandbox/merlin
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
