vipx / google-guice

Automatically exported from code.google.com/p/google-guice
Apache License 2.0
0 stars 0 forks source link

Add javax.inject.Named creation support #585

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Since com.google.inject.util.Providers adds support for javax.inject.Provider, 
I wonder why there's not anything to support javax.inject.Named.

One quick way could be the com.google.inject.name.NamedImpl class implements 
javax.inject.Named, another could be creating a com.google.inject.util.Named or 
something similar.

I'd suggest adopting the first approach, so when users bind a Named instance, 
they can request injections for both custom Guice's and JSR330's one.

Thoughts?

Original issue reported on code.google.com by simone.t...@gmail.com on 7 Jan 2011 at 3:20

GoogleCodeExporter commented 9 years ago
Bindings to com.google.inject.name.Named and javax.inject.Named are 
interchangeable. Something bound with Names.named("foo") can be injected 
somewhere annotated with @javax.inject.Named("foo").

Original comment by cgdec...@gmail.com on 7 Jan 2011 at 3:53

GoogleCodeExporter commented 9 years ago

Original comment by sberlin on 6 Feb 2011 at 5:51