On Jan 12, 2007, at 9:58 AM, Manu George wrote:

Hi Mohammad,
                   Without the @Resource annotation itself it is
getting injected. Is that the right behaviour? Setter injection needs
to be specified using @Resource or in dd.But now it is injected
irrespective of that. Is that the right behaviour?

It's not the right behavior. @Resource or the equivalent injection- target xml declaration or implementing the SessionBean interface.

We could leave it as a convenience (provided the tck doesn't mind) or yank it.

-David


Thanks
Manu

On 1/12/07, Mohammad Nour El-Din <[EMAIL PROTECTED]> wrote:
Hi Manu...

On 1/12/07, Manu George <[EMAIL PROTECTED]> wrote:
>
> Hi,
>     A doubt on sessionContext
>
> The spec says
>
> 4.3.3 The SessionContext Interface
> If the bean specifies a dependency on the SessionContext interface (or
> if the bean class implements
> the SessionBean interface), the container must provide the session
> bean instance with a SessionContext.
> This gives the session bean instance access to the instance's context
> maintained by the
> container. The SessionContext interface has the following methods:
>
> Now does this mean that if we put a setSessionContext method in the
> bean the sessionContext should be injected irrespective of whether the
> bean class implements
> the SessionBean interface? Currently that is how it is in Openejb but > still I wanted to confirm whether that is the behaviour required. Same
> for MDB's as well.


Yes this is right, this is the setter injection, and you can have the
SessionContext field to be initialized to a SessionContext object instance by annotating it with the @Resource annotation, and you can annotate the setSessionContext method with the same annotation, but I don't know the
status of the implementation for the annotated fields.

thanks
> Manu
>



--
Thanks
- Mohammad Nour




Reply via email to