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.


Method Index

 o getCallerIdentity()
Obtain the java.security.Identity of the caller.
 o getEJBHome()
Obtain the enterprise bean's home interface.
 o getEnvironment()
Obtain the enterprise bean's environment properties.
 o getRollbackOnly()
Test if the transaction has been marked for rollback only.
 o getUserTransaction()
Obtain the transaction demarcation interface.
 o isCallerInRole(Identity)
Test if the caller has a given role.
 o setRollbackOnly()
Mark the current transaction for rollback.

Methods

 o getEJBHome
 public abstract EJBHome getEJBHome()
Obtain the enterprise bean's home interface.

Returns:
The enterprise bean's home interface.
 o 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.
 o getCallerIdentity
 public abstract Identity getCallerIdentity()
Obtain the java.security.Identity of the caller.

Returns:
The Identity object that identifies the caller.
 o 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.
 o 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).
 o 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.

 o 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