public class EntityContext extends BaseContext implements EntityContext
BaseContext.Call, BaseContext.State, BaseContext.UserTransactionWrapper
securityService, userTransaction
Constructor and Description |
---|
EntityContext(SecurityService securityService) |
Modifier and Type | Method and Description |
---|---|
void |
check(ThreadContext context,
BaseContext.Call call) |
EJBLocalObject |
getEJBLocalObject()
Obtain a reference to the EJB local object that is currently
associated with the instance.
|
EJBObject |
getEJBObject()
Obtain a reference to the EJB object that is currently associated with
the instance.
|
java.lang.Object |
getPrimaryKey()
Obtain the primary key of the EJB object that is currently
associated with this instance.
|
doCheck, getCallerIdentity, getCallerPrincipal, getCallerPrincipal, getContextData, getEJBHome, getEJBLocalHome, getEnvironment, getRollbackOnly, getTimerService, getUserTransaction, getUserTransaction, illegal, isCallerInRole, isCallerInRole, isCallerInRole, isTimerMethodAllowed, isUserTransactionAccessAllowed, lookup, setRollbackOnly, writeReplace
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCallerIdentity, getCallerPrincipal, getContextData, getEJBHome, getEJBLocalHome, getEnvironment, getRollbackOnly, getTimerService, getUserTransaction, isCallerInRole, isCallerInRole, lookup, setRollbackOnly
public EntityContext(SecurityService securityService)
public EJBLocalObject getEJBLocalObject() throws java.lang.IllegalStateException
EntityContext
An instance of an entity bean can call this method only when the instance is associated with an EJB local object identity, i.e. in the ejbActivate, ejbPassivate, ejbPostCreate, ejbRemove, ejbLoad, ejbStore, and business methods.
An instance can use this method, for example, when it wants to pass a reference to itself in a method argument or result.
getEJBLocalObject
in interface EntityContext
java.lang.IllegalStateException
- if the instance invokes this
method while the instance is in a state that does not allow the
instance to invoke this method, or if the instance does not have
a local interface.public EJBObject getEJBObject() throws java.lang.IllegalStateException
EntityContext
An instance of an entity bean can call this method only when the instance is associated with an EJB object identity, i.e. in the ejbActivate, ejbPassivate, ejbPostCreate, ejbRemove, ejbLoad, ejbStore, and business methods.
An instance can use this method, for example, when it wants to pass a reference to itself in a method argument or result.
getEJBObject
in interface EntityContext
java.lang.IllegalStateException
- Thrown if the instance invokes this
method while the instance is in a state that does not allow the
instance to invoke this method, or if the instance does not have
a remote interface.public java.lang.Object getPrimaryKey() throws java.lang.IllegalStateException
EntityContext
An instance of an entity bean can call this method only when the instance is associated with an EJB object identity, i.e. in the ejbActivate, ejbPassivate, ejbPostCreate, ejbRemove, ejbLoad, ejbStore, and business methods.
Note: The result of this method is that same as the result of getEJBObject().getPrimaryKey().
getPrimaryKey
in interface EntityContext
java.lang.IllegalStateException
- Thrown if the instance invokes this
method while the instance is in a state that does not allow the
instance to invoke this method.public void check(ThreadContext context, BaseContext.Call call)
check
in class BaseContext