All Packages Class Hierarchy This Package Previous Next Index
Interface javax.ejb.InstanceContext
- public interface interface InstanceContext
The InstanceContext 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.
-
getCurrentTransaction()
- Obtain the transaction demaraction interface.
-
getEJBHome()
- Obtain the enterprise bean's home interface.
-
getEnvironment()
- Obtain the enterprise bean's environment properties.
-
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 interfac.
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.
getCurrentTransaction
public abstract CurrentTransaction getCurrentTransaction() throws IllegalStateException
- Obtain the transaction demaraction interface.
- Returns:
- The CurrentTransaction interface that the enterprise bean
instance can use for transaction demarcation.
- Throws: IllegalStateException
- Thrown if the instance container does
not make the CurrentTransaction interface available to the instance
(only the enterprise beans with the BEAN_MANAGED transaction attribute
are allowed to use the CurrentTransaction 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.
All Packages Class Hierarchy This Package Previous Next Index