<snip more cool stuff>
OK, how about this:
/**
* Gets a list of all classes with a specific attribute.
* The requirements are:
*
* + The URLClassLoader must either point to...
* ...a local JAR file or * ...a local directory or
* ...a remote JAR file that will be downloaded in its entirety
and examined
*/
Class[] findClassesWithAttributeType ( URLClassLoader loader, Class
attributeClass );
You can get the URLs used the an URLClassLoader via the getURLs method,
and we can get all the ugly iteration stuff in one place.
Idea: How about this. We include in the MANIFEST.mf a list of all classes in the JAR. That's it. Just one big list. That is the only packaging requirement.
Then we solve everything else at runtime.
Then we can load classes and index them and so on as needed, but the packaging requirements are fixed and dead simple.
Excellent. Now the official JAR packaging takes advantage of an "index" service to help a classloader know what is in the JAR. I think the JAR utility can automatically create this "index" file--so all we have to do is specify that Avalon JARs need to use the indexing feature.
Bam. Simple solution, minimal coding.
Automatic discovery of components and such will enable things like IDE plugins and ANT tools to assist the developer as they create and deploy the system.
Just a big list of classes would probably do it. What you then do with that big list can be left to the application.
It depends on how stable and sophisticated we want the packaging
requirements to be.
Ok. If we can guarantee (or at least specify the index list) then we can create the attribute finding algrorithm in that manner.
--
"They that give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety."
- Benjamin Franklin
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
