org.jboss.ejb3.stateful
Class StatefulSessionContextImpl

java.lang.Object
  extended by org.jboss.ejb3.stateful.StatefulSessionContextImpl
All Implemented Interfaces:
Serializable, javax.ejb.EJBContext, javax.ejb.SessionContext

public class StatefulSessionContextImpl
extends Object
implements Serializable, javax.ejb.SessionContext

A session context that is serializable. Since a session context can be serialized with a bean it must not have a direct reference to StatefulBeanContext. Direct instantiation of a StatefulSessionContextImpl after activation is also not possible, because the bean is than not yet in cache. Therefore we use a delegate.

Version:
$Revision: 72001 $
Author:
Carlo de Wolf
See Also:
Serialized Form

Constructor Summary
StatefulSessionContextImpl(StatefulBeanContext beanContext)
           
StatefulSessionContextImpl(String containerGuid, String containerClusterUid, Object id, boolean isClustered)
           
 
Method Summary
<T> T
getBusinessObject(Class<T> businessInterface)
           
 Identity getCallerIdentity()
           
 Principal getCallerPrincipal()
           
protected  javax.ejb.SessionContext getDelegate()
           
 javax.ejb.EJBHome getEJBHome()
           
 javax.ejb.EJBLocalHome getEJBLocalHome()
           
 javax.ejb.EJBLocalObject getEJBLocalObject()
           
 javax.ejb.EJBObject getEJBObject()
           
 Properties getEnvironment()
           
 Class<?> getInvokedBusinessInterface()
           
 javax.xml.rpc.handler.MessageContext getMessageContext()
           
 boolean getRollbackOnly()
           
 javax.ejb.TimerService getTimerService()
           
 UserTransaction getUserTransaction()
           
 boolean isCallerInRole(Identity role)
           
 boolean isCallerInRole(String roleName)
           
 Object lookup(String name)
           
 void setRollbackOnly()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StatefulSessionContextImpl

public StatefulSessionContextImpl(String containerGuid,
                                  String containerClusterUid,
                                  Object id,
                                  boolean isClustered)

StatefulSessionContextImpl

public StatefulSessionContextImpl(StatefulBeanContext beanContext)
Method Detail

getBusinessObject

public <T> T getBusinessObject(Class<T> businessInterface)
                    throws IllegalStateException
Specified by:
getBusinessObject in interface javax.ejb.SessionContext
Throws:
IllegalStateException

getDelegate

protected javax.ejb.SessionContext getDelegate()

getEJBLocalObject

public javax.ejb.EJBLocalObject getEJBLocalObject()
                                           throws IllegalStateException
Specified by:
getEJBLocalObject in interface javax.ejb.SessionContext
Throws:
IllegalStateException

getEJBObject

public javax.ejb.EJBObject getEJBObject()
                                 throws IllegalStateException
Specified by:
getEJBObject in interface javax.ejb.SessionContext
Throws:
IllegalStateException

getInvokedBusinessInterface

public Class<?> getInvokedBusinessInterface()
                                     throws IllegalStateException
Specified by:
getInvokedBusinessInterface in interface javax.ejb.SessionContext
Throws:
IllegalStateException

getMessageContext

public javax.xml.rpc.handler.MessageContext getMessageContext()
                                                       throws IllegalStateException
Specified by:
getMessageContext in interface javax.ejb.SessionContext
Throws:
IllegalStateException

getCallerIdentity

public Identity getCallerIdentity()
Specified by:
getCallerIdentity in interface javax.ejb.EJBContext

getCallerPrincipal

public Principal getCallerPrincipal()
Specified by:
getCallerPrincipal in interface javax.ejb.EJBContext

getEJBHome

public javax.ejb.EJBHome getEJBHome()
Specified by:
getEJBHome in interface javax.ejb.EJBContext

getEJBLocalHome

public javax.ejb.EJBLocalHome getEJBLocalHome()
Specified by:
getEJBLocalHome in interface javax.ejb.EJBContext

getEnvironment

public Properties getEnvironment()
Specified by:
getEnvironment in interface javax.ejb.EJBContext

getRollbackOnly

public boolean getRollbackOnly()
                        throws IllegalStateException
Specified by:
getRollbackOnly in interface javax.ejb.EJBContext
Throws:
IllegalStateException

getTimerService

public javax.ejb.TimerService getTimerService()
                                       throws IllegalStateException
Specified by:
getTimerService in interface javax.ejb.EJBContext
Throws:
IllegalStateException

getUserTransaction

public UserTransaction getUserTransaction()
                                   throws IllegalStateException
Specified by:
getUserTransaction in interface javax.ejb.EJBContext
Throws:
IllegalStateException

isCallerInRole

public boolean isCallerInRole(Identity role)
Specified by:
isCallerInRole in interface javax.ejb.EJBContext

isCallerInRole

public boolean isCallerInRole(String roleName)
Specified by:
isCallerInRole in interface javax.ejb.EJBContext

lookup

public Object lookup(String name)
Specified by:
lookup in interface javax.ejb.EJBContext

setRollbackOnly

public void setRollbackOnly()
                     throws IllegalStateException
Specified by:
setRollbackOnly in interface javax.ejb.EJBContext
Throws:
IllegalStateException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.