Hi Barrie,

I was ignorant too and found reading javadoc for javax.inject fast and very 
useful [1]
In summary, standard contains:
- 3 concepts: @Inject, @Qualifier and @Scope
- 2 basic use case: @Named as classical Qualifier and @Singleton as classical 
Scope
I still didn't investigate Provider<T>

But anything more specific that these needs extension: we're in that case

Please have a look at [2], with proposed Improvements and comment

Regards,

Hervé


[1] http://atinject.googlecode.com/svn/trunk/javadoc/javax/inject/package-
summary.html

[2] 
https://cwiki.apache.org/confluence/display/MAVEN/Java+5+Annotations+for+Plugins

Le mercredi 23 mai 2012 08:16:26 Barrie Treloar a écrit :
> On Wed, May 23, 2012 at 7:00 AM, Olivier Lamy <[email protected]> wrote:
> [del]
> 
> >>> I may have misunderstood what you said earlier, but I thought the
> >>> runtime operated off of plugin.xml still - and the plugin tools could
> >>> parse any annotation into that, so we were free to use the standard
> >>> ones. In the future, the core could well use that more directly, which
> >>> would also be easier if it's a standard annotation.>> 
> >> Ok makes sense.
> >> Looks good for me.
> > 
> > Nope in fact. Some use cases makes that impossible.
> > Sample from war plugin:
> > 
> >    /**
> >     * @component role="org.codehaus.plexus.archiver.Archiver"
> > role-hint="jar" */
> >    private JarArchiver jarArchiver;
> > 
> > So we need role attribute/information to know the type for writing the
> > plugin descriptor.
> > And @Inject doesn't have that.
> 
> Please excuse my extreme ignorance of annotation injection :)
> 
> But would have thought there was something that helped with this
> problem already available.
> 
> My quick googling looks like @Qualifier types of @Named might be what is
> needed. Can someone with a clue confirm this?
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to