The Spring Framework

org.springframework.ejb.support
Class AbstractSessionBean

java.lang.Object
  extended by org.springframework.ejb.support.AbstractEnterpriseBean
      extended by org.springframework.ejb.support.AbstractSessionBean
All Implemented Interfaces:
Serializable, EnterpriseBean, SessionBean, SmartSessionBean
Direct Known Subclasses:
AbstractStatefulSessionBean, AbstractStatelessSessionBean

abstract class AbstractSessionBean
extends AbstractEnterpriseBean
implements SmartSessionBean

Superclass for all session beans. Not intended for direct client subclassing; derive from AbstractStatelessSessionBean or AbstractStatefulSessionBean instead.

This class saves the session context provided by the EJB container in an instance variable and provides a NOP implementation of the ejbRemove() lifecycle method.

Author:
Rod Johnson
See Also:
AbstractStatelessSessionBean, AbstractStatefulSessionBean

Field Summary
 
Fields inherited from class org.springframework.ejb.support.AbstractEnterpriseBean
BEAN_FACTORY_PATH_ENVIRONMENT_KEY
 
Constructor Summary
AbstractSessionBean()
           
 
Method Summary
 SessionContext getSessionContext()
          Convenience method for subclasses.
 void setSessionContext(SessionContext sessionContext)
          Set the session context.
 
Methods inherited from class org.springframework.ejb.support.AbstractEnterpriseBean
ejbRemove, getBeanFactory, loadBeanFactory, onEjbRemove, setBeanFactoryLocator, setBeanFactoryLocatorKey, unloadBeanFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.ejb.SessionBean
ejbActivate, ejbPassivate, ejbRemove
 

Constructor Detail

AbstractSessionBean

AbstractSessionBean()
Method Detail

setSessionContext

public void setSessionContext(SessionContext sessionContext)
Set the session context.

If overriding this method, be sure to invoke this form of it first.

Specified by:
setSessionContext in interface SessionBean
Parameters:
sessionContext - SessionContext context for session

getSessionContext

public final SessionContext getSessionContext()
Convenience method for subclasses. Return the EJB context saved on initialization.

Specified by:
getSessionContext in interface SmartSessionBean
Returns:
the SessionContext saved on initialization by this class's implementation of the setSessionContext() method.

The Spring Framework

Copyright © 2002-2006 The Spring Framework.