First page Back Continue Last page Graphics
Bean Context...
All beans operate in a context
- Gives access to container’s environment for this bean
- Defined by javax.EJBContext interface
EJBContext gives
a bean access to:
- The bean’s home object
- Security information
about the bean
- Transaction functionality
Sub-interfaces:
- Specifics for the two kinds of beans
Details follow…
Notes:
Every EnterpriseBean object (every instance of a class implementing the SessionBean or EntityBean interface) operates in a context created by the container. For example, it is linked to an instance of EJBObject (the object implementing the remote interface). It is also linked to an instance of EJBHome.
Often the bean object will need this context information. To get it, it can use an object that implements the javax.ejb.EJBContext interface.
Note: if you have worked with Java servlets, you may find this familiar. The servlet API defines a ServletContext interface that provides access to the servlet’s context.