org.jboss.ejb
Class EntityEnterpriseContext.EntityContextImpl

java.lang.Object
  extended byorg.jboss.ejb.EnterpriseContext.EJBContextImpl (src) 
      extended byorg.jboss.ejb.EntityEnterpriseContext.EntityContextImpl
All Implemented Interfaces:
EJBContext (src) , EntityContext (src)
Enclosing class:
EntityEnterpriseContext (src)

protected class EntityEnterpriseContext.EntityContextImpl
extends EnterpriseContext.EJBContextImpl (src)
implements EntityContext (src)


Constructor Summary
protected EntityEnterpriseContext.EntityContextImpl()
           
 
Method Summary
 java.security.Principal getCallerPrincipal()
          Obtains the java.security.Principal of the caller.
 EJBHome (src) getEJBHome()
          Obtain the enterprise bean's remote home interface.
 EJBLocalHome (src) getEJBLocalHome()
          Obtain the enterprise bean's local home interface.
 EJBLocalObject (src) getEJBLocalObject()
          Obtain a reference to the EJB local object that is currently associated with the instance.
 EJBObject (src) 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.
 boolean getRollbackOnly()
          Test if the transaction has been marked for rollback only.
 TimerService (src) getTimerService()
          Get access to the EJB Timer Service.
 UserTransaction (src) getUserTransaction()
          Obtain the transaction demarcation interface.
 boolean isCallerInRole(java.lang.String id)
          Tests if the caller has a given role.
 void setRollbackOnly()
          Mark the current transaction for rollback.
 
Methods inherited from class org.jboss.ejb.EnterpriseContext.EJBContextImpl (src)
getCallerIdentity, getEnvironment, isCallerInRole, lookup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.ejb.EJBContext (src)
getCallerIdentity, getEnvironment, isCallerInRole, lookup
 

Constructor Detail

EntityEnterpriseContext.EntityContextImpl

protected EntityEnterpriseContext.EntityContextImpl()
Method Detail

getEJBHome

public EJBHome (src)  getEJBHome()
Description copied from interface: EJBContext (src)
Obtain the enterprise bean's remote home interface.

Specified by:
getEJBHome in interface EJBContext (src)
Overrides:
getEJBHome in class EnterpriseContext.EJBContextImpl (src)

getEJBLocalHome

public EJBLocalHome (src)  getEJBLocalHome()
Description copied from interface: EJBContext (src)
Obtain the enterprise bean's local home interface.

Specified by:
getEJBLocalHome in interface EJBContext (src)
Overrides:
getEJBLocalHome in class EnterpriseContext.EJBContextImpl (src)

getCallerPrincipal

public java.security.Principal getCallerPrincipal()
Description copied from interface: EJBContext (src)
Obtains the java.security.Principal of the caller.

Specified by:
getCallerPrincipal in interface EJBContext (src)
Overrides:
getCallerPrincipal in class EnterpriseContext.EJBContextImpl (src)

getRollbackOnly

public boolean getRollbackOnly()
Description copied from interface: EJBContext (src)
Test if the transaction has been marked for rollback only. An enterprise bean instance can use this operation, for example, to test after an exception has been caught, whether it is fruitless to continue computation on behalf of the current transaction. Only enterprise beans with container-managed transactions are allowed to use this method.

Specified by:
getRollbackOnly in interface EJBContext (src)
Overrides:
getRollbackOnly in class EnterpriseContext.EJBContextImpl (src)

setRollbackOnly

public void setRollbackOnly()
Description copied from interface: EJBContext (src)
Mark the current transaction for rollback. The transaction will become permanently marked for rollback. A transaction marked for rollback can never commit. Only enterprise beans with container-managed transactions are allowed to use this method.

Specified by:
setRollbackOnly in interface EJBContext (src)
Overrides:
setRollbackOnly in class EnterpriseContext.EJBContextImpl (src)

isCallerInRole

public boolean isCallerInRole(java.lang.String id)
Description copied from interface: EJBContext (src)
Tests if the caller has a given role.

Specified by:
isCallerInRole in interface EJBContext (src)
Overrides:
isCallerInRole in class EnterpriseContext.EJBContextImpl (src)

getUserTransaction

public UserTransaction (src)  getUserTransaction()
Description copied from interface: EJBContext (src)
Obtain the transaction demarcation interface. Only enterprise beans with bean-managed transactions are allowed to to use the UserTransaction interface. As entity beans must always use container-managed transactions, only session beans with bean-managed transactions are allowed to invoke this method.

Specified by:
getUserTransaction in interface EJBContext (src)
Overrides:
getUserTransaction in class EnterpriseContext.EJBContextImpl (src)

getEJBObject

public EJBObject (src)  getEJBObject()
Description copied from interface: EntityContext (src)

Obtain a reference to the EJB object that is currently associated with the instance.

An 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.

Specified by:
getEJBObject in interface EntityContext (src)
Returns:
The EJB object currently associated with the instance.

getEJBLocalObject

public EJBLocalObject (src)  getEJBLocalObject()
Description copied from interface: EntityContext (src)

Obtain a reference to the EJB local object that is currently associated with the instance.

An 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.

Specified by:
getEJBLocalObject in interface EntityContext (src)
Returns:
The EJB local object currently associated with the instance.

getPrimaryKey

public java.lang.Object getPrimaryKey()
Description copied from interface: EntityContext (src)

Obtain the primary key of the EJB object that is currently associated with this instance.

An 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().

Specified by:
getPrimaryKey in interface EntityContext (src)
Returns:
The primary key currently associated with the instance.

getTimerService

public TimerService (src)  getTimerService()
                             throws java.lang.IllegalStateException
Description copied from interface: EJBContext (src)
Get access to the EJB Timer Service.

Specified by:
getTimerService in interface EJBContext (src)
Overrides:
getTimerService in class EnterpriseContext.EJBContextImpl (src)
Throws:
java.lang.IllegalStateException