Hi Amit
I think
you should include the
MessageDrivenContext and
EntityContext as well in order to understand the whole picture.
The above two, in addition to
SessionContext are subclasses of
EJBContext .
The EJBContext provides access to the container-provided runtime context of an enterprise bean instance. For example a bean can find out about the user that invoked that bean with the use of getCallerPrincipal() and isCallerInRole() methods, or lookup a resource in the bean's naming context using the lookup() method.
The subclasses have specialized methods according to the requirements of the bean type they serve. For eg, SessionContext has getEJBLocalObject and getEJBObject methods to pass a reference to the bean itself in a method argument or result. Such functionality is not required by MDBs, so these methods are absent in the MessageDrivenContext.
Hope that helps.
- Rohit