First page Back Continue Last page Graphics

Using Contexts


Notes:

The objects passed to setSessionContext() and setEntityContext() both implement the javax.ejb.EJBContext interface. It provides a number of methods that the bean instance will use from time to time. Here is the complete listing:
public interface EJBContext {
// Get a reference to the bean’s home
public EJBHome getEJBHome( );

// Security-related methods
public java.security.Principal getCallerPrincipal( );
public boolean isCallerInRole( java.lang.String roleName );

// Transaction-related methods
public UserTransaction getUserTransaction( ) throws IllegalStateException;
public void setRollbackOnly( ) throws IllegalStateException;
public boolean getRollbackOnly( ) throws IllegalStateException;
}

Continued...