How will dependency Injection/Annotation scanning work?

Peter Kriens peter.kriens at
Wed Sep 30 07:33:36 UTC 2015

Thanks for the answer David about the annotation scanning. I guess this still will have to undergo a more detailed design?

Kind regards,

	Peter Kriens

> On 28 sep. 2015, at 19:33, David M. Lloyd <david.lloyd at> wrote:
> 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.
> -- 
> - DML

More information about the jpms-spec-observers mailing list