Home » openejb-3.1.2-src » javax » ejb » [javadoc | source]
javax.ejb
public interface: EJBContext [javadoc | source]

All Known Implementing Classes:
    EntityContext, MessageDrivenContext, SessionContext

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 from javax.ejb.EJBContext Summary:
getCallerIdentity,   getCallerPrincipal,   getEJBHome,   getEJBLocalHome,   getEnvironment,   getRollbackOnly,   getTimerService,   getUserTransaction,   isCallerInRole,   isCallerInRole,   lookup,   setRollbackOnly
Method from javax.ejb.EJBContext Detail:
 public Identity getCallerIdentity()
    Deprecated. Use Principal getCallerPrincipal() instead.

    Obtain the java.security.Identity of the caller. This method is deprecated in EJB 1.1. The Container is allowed to return alway null from this method. The enterprise bean should use the getCallerPrincipal method instead.

 public Principal getCallerPrincipal()
    Obtains the java.security.Principal of the caller.
 public EJBHome getEJBHome()
    Obtain the enterprise bean's remote home interface.
 public EJBLocalHome getEJBLocalHome()
    Obtain the enterprise bean's local home interface.
 public Properties getEnvironment()
    Deprecated. Use the JNDI naming context java:comp/env to access enterprise bean's environment.

    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.

 public boolean getRollbackOnly() throws IllegalStateException
    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. Only enterprise beans with container-managed transactions are allowed to use this method.

 public TimerService getTimerService() throws IllegalStateException
    Get access to the EJB Timer Service.
 public UserTransaction getUserTransaction() throws IllegalStateException
    Obtain the transaction demarcation interface. Only enterprise beans with bean-managed transactions are allowed to to use the UserTransaction interface. As entity beans must always use container-managed transactions, only session beans with bean-managed transactions are allowed to invoke this method.
 public boolean isCallerInRole(Identity role)
    Deprecated. Use boolean isCallerInRole(String roleName) instead.

    Test if the caller has a given role.

    This method is deprecated in EJB 1.1. The enterprise bean should use the isCallerInRole(String roleName) method instead.

 public boolean isCallerInRole(String roleName)
    Tests if the caller has a given role.
 public Object lookup(String name) throws IllegalArgumentException
    Lookup a resource within the component's private naming context.
 public  void setRollbackOnly() throws IllegalStateException
    Mark the current transaction for rollback. The transaction will become permanently marked for rollback. A transaction marked for rollback can never commit. Only enterprise beans with container-managed transactions are allowed to use this method.