Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Entity and Session Contexts  RSS feed

 
Kunaal A Trehan
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This question may seems so silly.
We have entityContext and sessionContext.

What exactly are these contexts and what information can be derived from these contexts

Rgds
Kunal
 
Alex Sharkoff
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kunal,

Think of EJBContext (SessionContext, EntityContext and MessageDrivenContext) as a thing that gives you access to the ejb container environment. Eg, in session bean SessionContext could be used to get a security info on a client who called a business method.

Bean starts its life as a usual java object when container creates a bean instance with the public no-arg bean constructor. Then this instance gets its context (through set...Context( ...Context ) method) and from that moment it becomes an enterprise java bean as it has got special capabilities to access container environement. There are also other things that bean can do such as accessing its special jndi context ("java:/comp/env") and being able to call other beans' methods.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!