|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectau.gov.tas.dpiwe.mr.bean.MrEntityContext
public class MrEntityContext
An implementation of EntityContext with a few internal methods utilized by the Architecture added for good measure.
This class is essential to imposing lifecycle on Mr Architecture beans, even though this lifecycle deviates somewhat from standard EJBs. The additional methods exposed here over EntityContext are not for use outside the Architecture, and are subject to change without notice.
EntityContext| Field Summary | |
|---|---|
protected EJBLocalObject |
bean
The bean wrapper for this entity bean. |
protected Container |
container
The container to which the entity bean belongs. |
protected EJBLocalHome |
home
The home for entity beans of this type. |
| Constructor Summary | |
|---|---|
MrEntityContext()
Creates a new empty entity bean context. |
|
MrEntityContext(Container container,
EJBLocalObject bean,
EJBLocalHome home)
Creates a new entity bean context for an entity bean. |
|
MrEntityContext(Container container,
EntityBean bean)
Creates a new entity bean context for an entity bean. |
|
| Method Summary | |
|---|---|
void |
activate(Container container,
EntityBean bean)
Called internally by the Architecture in order to issue an activate lifecycle event to the entity bean to which this context object is assigned. |
void |
create(Container container,
EntityBean bean)
Called internally by the Architecture in order to issue a create and post-create lifecycle events and establish the container and home for the entity bean to which this context object is assigned, at least if these were not already established at construct time. |
Identity |
getCallerIdentity()
Obtain the java.security.Identity of the caller. |
Principal |
getCallerPrincipal()
Obtain the java.security.Principal that identifies the caller. |
EJBHome |
getEJBHome()
Obtain the enterprise bean's remote home interface. |
EJBLocalHome |
getEJBLocalHome()
Obtain the enterprise bean's local home interface. |
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. |
Properties |
getEnvironment()
Obtain the enterprise bean's environment properties. |
Object |
getPrimaryKey()
Obtain the primary key of the EJB object that is currently associated with this instance. |
boolean |
getRollbackOnly()
Test if the transaction has been marked for rollback only. |
UserTransaction |
getUserTransaction()
Obtain the transaction demarcation interface. |
boolean |
isCallerInRole(Identity role)
Test if the caller has a given role. |
boolean |
isCallerInRole(String roleName)
Test if the caller has a given security role. |
void |
setRollbackOnly()
Mark the current transaction for rollback. |
EntityContext |
wrap(Container container,
EJBLocalObject bean)
Amends an entity bean context to reflect a new container and/or object wrapper. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Container container
protected EJBLocalObject bean
protected EJBLocalHome home
| Constructor Detail |
|---|
public MrEntityContext()
Not to be called by external clients.
public MrEntityContext(Container container,
EntityBean bean)
Not to be called by external clients.
container - the container to which the entity bean belongs.bean - the entity bean whose context this will be.
public MrEntityContext(Container container,
EJBLocalObject bean,
EJBLocalHome home)
Not to be called by external clients.
container - the container to which the entity bean belongs.bean - the entity bean's object interface.home - the entity bean's home interface.| Method Detail |
|---|
public void create(Container container,
EntityBean bean)
throws CreateException,
EJBException
Not to be called by external clients.
container - the container to which the entity bean belongs.bean - the entity bean which has been created.
CreateException
EJBException
public void activate(Container container,
EntityBean bean)
throws EJBException,
RemoteException
Not to be called by external clients.
container - the container to which the entity bean belongs.bean - the entity bean to activate.
EJBException
RemoteException
public EntityContext wrap(Container container,
EJBLocalObject bean)
Used internally by the Architecture itself and not to be called by external clients.
container - the container to which the entity bean belongs.bean - the entity bean's object interface.
public EJBHome getEJBHome()
EJBContext
getEJBHome in interface EJBContextpublic EJBObject getEJBObject()
EntityContextAn instance of an entity enterprise 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 EntityContextpublic Properties getEnvironment()
EJBContextNote: If the enterprise bean has no environment properties this method returns an empty java.util.Properties object. This method never returns null.
getEnvironment in interface EJBContextpublic EJBLocalHome getEJBLocalHome()
EJBContext
getEJBLocalHome in interface EJBContextpublic EJBLocalObject getEJBLocalObject()
EntityContextAn instance of an entity enterprise 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 EntityContextpublic Object getPrimaryKey()
EntityContextAn instance of an entity enterprise 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 EntityContextpublic boolean getRollbackOnly()
EJBContext
getRollbackOnly in interface EJBContextpublic void setRollbackOnly()
EJBContext
setRollbackOnly in interface EJBContextpublic UserTransaction getUserTransaction()
EJBContext
getUserTransaction in interface EJBContextpublic Identity getCallerIdentity()
EJBContext
getCallerIdentity in interface EJBContextpublic Principal getCallerPrincipal()
EJBContext
getCallerPrincipal in interface EJBContextpublic boolean isCallerInRole(Identity role)
EJBContextThis method is deprecated in EJB 1.1. The enterprise bean should use the isCallerInRole(String roleName) method instead.
isCallerInRole in interface EJBContextrole - The java.security.Identity of the role to be tested.
public boolean isCallerInRole(String roleName)
EJBContext
isCallerInRole in interface EJBContextroleName - The name of the security role. The role must be one of
the security roles that is defined in the deployment descriptor.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||