Interface EJBContextExtension

All Superinterfaces:
javax.ejb.EJBContext
All Known Subinterfaces:
MessageDrivenContextExtension, SessionContextExtension

public interface EJBContextExtension extends javax.ejb.EJBContext
The EJBContextExtension interface may be used by an EJB to invoke WebSphere-specific EJB Container services.

An EJB may invoke the EJBContextExtension methods by casting the context object passed into the EJB's setSessionContext() or setMessageDrivenContext() method, to com.ibm.websphere.ejbcontainer.EJBContextExtension. Typically the code in setSessionContext() or setMessageDrivenContext assigns the context object to a bean instance variable for later use by other bean methods.

In WebSphere, all javax.ejb.EJBContext objects also implement this interface. This allows the bean to use a single 'context' instance variable (of type EJBContextExtension) and be able to invoke EJB specification-defined methods as well as WebSphere-defined methods on the same context object. It is also possible, of course, to assign the context object to two instance variables, one of type javax.ejb.EJBContext and another of type com.ibm.websphere.ejbcontainer.EJBContextExtension.

For each subinterface of javax.ejb.EJBContext, a corresponding WebSphere-defined context extension interface extends both the applicable subinterface of EJBContext and this EJBContextExtension interface. See MessageDrivenContextExtension and SessionContextExtension.

Note: Application use of some of the methods on this interface may result in behavior not compliant with the official EJB specification. If this is the case, the documentation for that method will indicate so.

Since:
WAS 6.0.2
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns true when the current thread is associated with a global transaction; otherwise, returns false.

    Methods inherited from interface javax.ejb.EJBContext

    getCallerIdentity, getCallerPrincipal, getContextData, getEJBHome, getEJBLocalHome, getEnvironment, getRollbackOnly, getTimerService, getUserTransaction, isCallerInRole, isCallerInRole, lookup, setRollbackOnly
  • Method Details

    • isTransactionGlobal

      boolean isTransactionGlobal()
      Returns true when the current thread is associated with a global transaction; otherwise, returns false.

      This method is useful for container managed transaction beans that may run in either a global transaction or an unspecified (local) transaction context. Since the EJBContext methods getRollbackOnly() and setRollbackOnly() may only be called when running in a global transaction, this method may be used to determine when these other methods may be called.

      Since:
      WAS 6.0.2.19