• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Use of SessionContext and EjbContext

 
Greenhorn
Posts: 9
Netscape Java ME Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
someone please explain the uses of sessioncontext and EjbContext.why it is there?how it fits to the architecture of EJB ?I need the understanding of it.please help

note:- Please don't say how to use it?I can find it in books.
thanks in advance.
 
Greenhorn
Posts: 3
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
amit vikram ghajni
Greenhorn
Posts: 9
Netscape Java ME Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

RohitMisra Rm wrote: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



thanks rohit. I am getting the complete picture now.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic