tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Blevins <>
Subject Re: EJBContext cannot be injected in 3.1-SNAPSHOT
Date Fri, 11 Jul 2008 00:25:56 GMT

On Jul 5, 2008, at 2:06 PM, Jacek Laskowski wrote:

> On Fri, Jun 27, 2008 at 10:33 PM, David Blevins < 
> > wrote:
>> In general, we don't check isAssignable on injection types,  
>> primarily cause
>> it gets very hairy around business interfaces.  But we could probably
>> support this particular use case.
> I think we have to as 16.15 EJBContext References is pretty clear on  
> it:
> The container must make a component's EJBContext interface available
> either through injection using the Resource annotation or in JNDI
> under the name java:comp/EJBContext. The authenticationType and
> shareable elements of the Resource annotation must not be specified.
> and further on:
> The Bean Provider is responsible for requesting injection of an
> EJBContext object using a Resource annotation or using the defined
> name to lookup the EJBContext object.
> and finally:
> The Container Provider is responsible for providing an appropriate
> EJBContext object to the referencing component. The object returned
> must be of the appropriate specific type for the bean requesting
> injection or performing the lookup—that is, the container provider
> must return an instance of the SessionContext interface to referencing
> session beans and an instance of the MessageDrivenContext interface to
> message-driven beans.

When the spec says "a component's EJBContext interface" or "an  
appropriate EJBContext" it's referring to SessionContext,  
MessageDrivenContext or EntityContext specifically.  It isn't a  
requirement that @Resource EJBContext be injectable, but we can  
certainly support it as a feature.


View raw message