Its always sounded more like a scoping thing to me, and you kind of
sum it up as well. With @Resource, you're generally talking about
something that's been configured on the app server and sits somewhere
in the JNDI tree (typically in the app server global). @Inject though
is always local to the application itself. I can't recall any
examples with two standalone EAR files sharing resources via @Inject
(nor does it sound like a good idea). In our setup, we have a couple
of services deployed as standalone JAR files (reusable logic that many
of our apps all use), these can be injected via @EJB so I anticipate
them being able to be injected via @Inject if we move to CDI.
On Nov 25, 5:32 am, AlexisMP <
alexis...@gmail.com> wrote:
> I think it's fair to say that in a JavaEE 6 environment @Inject really
> only makes sense in the context of CDI (jsr299).
>
> Without CDI @Resource remains a (loosely typed) solution which Now
> also applies to the new javax.annotations.ManagedBean.
>
> In GlassFish v3, @Resource is also used to inject OSGi declarative
> services in regular JavaEE artiacts.
>
> --Alexis
>
> On 25 nov. 2009, at 10:38, Fabrizio Giudici <
fabrizio.giud...@tidalwave.it
>
> > wrote:
> > Stuart McCulloch wrote:
>
> >> Or you could always support both annotations, as they're not mutually
> >> exclusive.
>
> > Great. You also answered to a couple of questions that I hadn't put
> > yet ;-)
>
> > --
> > Fabrizio Giudici - Java Architect, Project Manager
> > Tidalwave s.a.s. - "We make Java work. Everywhere."
> >
weblogs.java.net/blog/fabriziogiudici -
www.tidalwave.it/people
> >
Fabrizio.Giud...@tidalwave.it