javax.ejb

Interface SessionContext

All Superinterfaces:
EJBContext

public interface SessionContext
extends EJBContext

The main ejb context.

Method Summary

T getBusinessObject(Class businessInterface)
EJBLocalObject
getEJBLocalObject()
EJBObject
getEJBObject()
Class<T>
getInvokedBusinessInterface()
MessageContext
getMessageContext()

Methods inherited from interface javax.ejb.EJBContext

getCallerIdentity, getCallerPrincipal, getEJBHome, getEJBLocalHome, getEnvironment, getRollbackOnly, getTimerService, getUserTransaction, isCallerInRole, isCallerInRole, lookup, setRollbackOnly

Method Details

T getBusinessObject

public  T getBusinessObject(Class businessInterface)

getEJBLocalObject

public EJBLocalObject getEJBLocalObject()
            throws IllegalStateException
Usages and Demos :

View More Examples of getEJBLocalObject()
   1: import javax.annotation.Resource;
   2: import javax.ejb.SessionContext;
   3: import javax.ejb.Stateless;
   4:         ...
   5:     @Resource
   6:     private SessionContext sessionContext;
   7:     
   8:     @Resource
   9:     private UserTransaction utx;

View Full Code Here
   1: import javax.ejb.SessionBean;
   2: import javax.ejb.SessionContext;
   3: import javax.naming.InitialContext;
   4:         ...
   5:    private Category log = Category.getInstance(getClass().getName());
   6:    private SessionContext ctx;
   7: 
   8:         ...
   9:       {
  10:          CachedConnectionSessionLocal other = (CachedConnectionSessionLocal) ctx.getEJBLocalObject();
  11:          other.secondTLTest();
  12:         ...
  13: 
  14:    public void setSessionContext(SessionContext ctx) throws RemoteException

View Full Code Here

getEJBObject

public EJBObject getEJBObject()
            throws IllegalStateException
Usages and Demos :

View More Examples of getEJBObject()
   1: import javax.ejb.SessionBean;
   2: import javax.ejb.SessionContext;
   3: import javax.naming.InitialContext;
   4:         ...
   5: {
   6:    SessionContext context;
   7: 
   8:         ...
   9: 
  10:          TestSession next = (TestSession) context.getEJBObject();
  11:          int hashCode = next.invokeNext(id);
  12:         ...
  13:    
  14:    public void setSessionContext( SessionContext context )

View Full Code Here
   1: import javax.ejb.SessionBean;
   2: import javax.ejb.SessionContext;
   3: 
   4:         ...
   5:   private static final boolean DEBUG = false;
   6:   private SessionContext _context;
   7: 
   8:         ...
   9:   public void setSessionContext(SessionContext sessionContext) {
  10:     _context = sessionContext;
  11:         ...
  12:         Sort helperB = ((SortHome) _context.getEJBHome()).create();
  13:         Sort self = (Sort) _context.getEJBObject();

View Full Code Here
   1: import javax.ejb.SessionBean;
   2: import javax.ejb.SessionContext;
   3: import javax.naming.InitialContext;
   4:         ...
   5:    private static Category log = Category.getInstance(StatelessSessionBean3.class);
   6:    private SessionContext sessionContext;
   7:    
   8:         ...
   9:       log.debug("noop calling excluded...");
  10:       StatelessSession myEJB = (StatelessSession) sessionContext.getEJBObject();
  11:       try

View Full Code Here
   1:     String name;
   2:     SessionContext context;
   3:     Context jndiContext;
   4:         ...
   5:     
   6:     public void setSessionContext(SessionContext cntx){
   7:         context = cntx;        
   8:         ...
   9:         try{
  10:             context.getEJBObject();
  11:         ...
  12:             System.out.println("SessionContext.getEJBObject() ... Allowed");

View Full Code Here
   1: 
   2:     private SessionContext context = null;
   3:     private LocalAccountHome accountHome = null;
   4:         ...
   5:         {
   6:             ((Trade)context.getEJBObject()).queueOrderOnePhase(orderID);
   7:         }
   8:         ...
   9:             quoteData = quote.getDataBean();
  10:             ((Trade)context.getEJBObject()).publishQuotePriceChange(quoteData, oldPrice, changeFactor, sharesTraded);
  11: 
  12:         ...
  13:         {
  14:             return ((Trade)context.getEJBObject()).completeOrderOnePhase(orderID);

View Full Code Here

getInvokedBusinessInterface

public Class<T> getInvokedBusinessInterface()

getMessageContext

public MessageContext getMessageContext()