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