How will dependency Injection/Annotation scanning work?
David M. Lloyd
david.lloyd at redhat.com
Mon Sep 28 17:33:38 UTC 2015
On 09/28/2015 12:05 PM, Peter Kriens wrote:
> Dependency injection subsystems (Guice,CDI, Spring) tend to require annotation scanning. This should be able to iterate over implementation classes that are not exported.
> I could not find how you could iterate over the classes in a module. If there is no such way, how will CDI work with modules?
This one I can answer, at least partially: modules are likely to be
indexed or contain an index of annotated classes. The index is
presumably keyed by any annotation annotated in turn with the @Indexed
annotation (package TBD I believe). The following excerpt from the
requirements doc (heading "Development") is relevant:
> One potential approach is to augment a module’s definition with an index of the annotations that are present in the module, together with an indication of the elements to which each annotation applies. To limit the size of the index, only annotations which themselves are annotated with a new meta-annotation, say @Indexed, would be included.
More information about the jpms-spec-observers