All Packages Class Hierarchy This Package Previous Next Index
Interface javax.ejb.EJBContext
- public interface interface EJBContext
The EJBContext interface provides an instance with access to the
container-provided runtime context of an enterprise Bean instance.
This interface is extended by the SessionContext and EntityContext
interface to provide additional methods specific to the enterprise
Bean type.
-
getCallerIdentity()
- Obtain the java.security.Identity of the caller.
-
getEJBHome()
- Obtain the enterprise bean's home interface.
-
getEnvironment()
- Obtain the enterprise bean's environment properties.
-
getRollbackOnly()
- Test if the transaction has been marked for rollback only.
-
getUserTransaction()
- Obtain the transaction demarcation interface.
-
isCallerInRole(Identity)
- Test if the caller has a given role.
-
setRollbackOnly()
- Mark the current transaction for rollback.
getEJBHome
public abstract EJBHome getEJBHome()
- Obtain the enterprise bean's home interface.
- Returns:
- The enterprise bean's home interface.
getEnvironment
public abstract Properties getEnvironment()
- Obtain the enterprise bean's environment properties.
Note: If the enterprise bean has no environment properties
this method returns an empty java.util.Properties object. This method
never returns null.
- Returns:
- The environment properties for the enterprise bean.
getCallerIdentity
public abstract Identity getCallerIdentity()
- Obtain the java.security.Identity of the caller.
- Returns:
- The Identity object that identifies the caller.
isCallerInRole
public abstract boolean isCallerInRole(Identity role)
- Test if the caller has a given role.
- Parameters:
- role - The java.security.Identity of the role to be tested.
- Returns:
- True if the caller has the specified role.
getUserTransaction
public abstract UserTransaction getUserTransaction() throws IllegalStateException
- Obtain the transaction demarcation interface.
- Returns:
- The UserTransaction interface that the enterprise bean
instance can use for transaction demarcation.
- Throws: IllegalStateException
- Thrown if the instance container does
not make the UserTransaction interface available to the instance
(only the enterprise beans with the TX_BEAN_MANAGED transaction attribute
are allowed to use the UserTransaction interface).
setRollbackOnly
public abstract void setRollbackOnly()
- Mark the current transaction for rollback. The transaction will become
permanently marked for rollback. A transaction marked for rollback
can never commit.
getRollbackOnly
public abstract boolean getRollbackOnly()
- 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.
- Returns:
- True if the current transaction is marked for rollback, false
otherwise.
All Packages Class Hierarchy This Package Previous Next Index