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.


Method Index

 o getCallerIdentity()
Obtain the java.security.Identity of the caller.
 o getCurrentTransaction()
Obtain the transaction demaraction interface.
 o getEJBHome()
Obtain the enterprise bean's home interface.
 o getEnvironment()
Obtain the enterprise bean's environment properties.
 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 interfac.
 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 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).
 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.


All Packages  Class Hierarchy  This Package  Previous  Next  Index