How will dependency Injection/Annotation scanning work?

Peter Kriens peter.kriens at aqute.biz
Thu Oct 1 08:08:10 UTC 2015


Paul,
Agree. We have experience with this in OSGi with the maven bundle plugin based on bnd. This plugin can generate indexes of classes of packages based on annotations or other indexing criteria. These indexes are generally placed in the manifest. 

Standardizing such indexes would be very useful.

Kind regards,

	Peter Kriens

> On 30 sep. 2015, at 16:02, Paul Benedict <pbenedict at apache.org> wrote:
> 
> If the module-info was not in binary format, it could be possible to list the annotations in the module meta data. This is just another reason to make the "module-info" an open format. A build tool could easily do this index (like Maven) at packaging time.
> 
> 
> Cheers,
> Paul
> 
> On Wed, Sep 30, 2015 at 2:33 AM, Peter Kriens <peter.kriens at aqute.biz <mailto:peter.kriens at aqute.biz>> wrote:
> 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 redhat.com <mailto:david.lloyd at redhat.com>> 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