From what I remember from a brief trawl through the Spring codebase,
the classpath scanning works by coercing the classloader URLs into
filesystem constructs, and then scanning the filesystem.
I don't think it works for non-filesystem-based classloaders, but that's
a fair compromise.
It's also very quick.
Kohsuke Kawaguchi wrote:
> Thank you.
>
> I'd imagine a little glue code that uses this to figure out classes with
> a JAXB annotation and then return it as Class[] would be a nice JAXB
> commons project.
>
> From there, people can easily create JAXBContext.
>
> Would you be interested in writing on, Dimitris? :-)
>
> Dimitris Andreou wrote:
>> Hi Koshuke,
>> I'm at SpringOne conference @ Belgium. I see that spring (2.5) has a new
>> utility that scans classes out of the classpath (searching for some
>> annotated classes).
>> Although I was not able to find the code (yet), it sounds like that
>> could be modified/used to alleviate the need for XmlSeeAlso. Well, there
>> are caveats for you
>> (or, your replacement anyway! :)) to consider though. It supports either
>> directories or jar files, and parses .class files with ASM to avoid
>> actually loading them.
>> And it uses some package-prefix filtering, or else it would be hugely slow.
>> Even if the need of an annotation won't be completely eliminated (you
>> would still need a package prefix to look for...), maybe another
>> annotation, or XmlSeeAlso itself,
>> could handle package declarations, and would look in them for subtypes.
>>
>> Anyway, just dropped a note in case you would find this interesting.
>
>
> --
> Kohsuke Kawaguchi
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>