com.interface21.ejb.support
Class AbstractSessionBean
java.lang.Object
|
+--com.interface21.ejb.support.AbstractEnterpriseBean
|
+--com.interface21.ejb.support.AbstractSessionBean
- All Implemented Interfaces:
- javax.ejb.EnterpriseBean, java.io.Serializable, javax.ejb.SessionBean
- Direct Known Subclasses:
- AbstractStatelessSessionBean
- public abstract class AbstractSessionBean
- extends AbstractEnterpriseBean
- implements javax.ejb.SessionBean
Convenient superclass for session beans.
SFSBs can extend this class directly,
leaving them to implement the ejbActivate() and ejbPassivate() lifecycle methods
to comply with the requirements of the EJB specification.
SLSBs will extend the AbstractStatelessSessionBean subclass of this class.
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.
NB: We cannot use final for our implementation of EJB lifecycle methods,
as this violates the EJB specification.
- Author:
- Rod Johnson
- See Also:
- Serialized Form
|
Method Summary |
void |
ejbRemove()
This method is required by the EJB Specification. |
protected javax.ejb.SessionContext |
getSessionContext()
Convenience method for subclasses. |
void |
setSessionContext(javax.ejb.SessionContext sessionContext)
Sets the session context.
|
| 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 |
AbstractSessionBean
public AbstractSessionBean()
setSessionContext
public void setSessionContext(javax.ejb.SessionContext sessionContext)
- Sets the session context.
If overriding this method, be sure to invoke this form of it
first.
- Specified by:
setSessionContext in interface javax.ejb.SessionBean
- Parameters:
sessionContext - SessionContext Context for session
ejbRemove
public void ejbRemove()
- This method is required by the EJB Specification.
- Specified by:
ejbRemove in interface javax.ejb.SessionBean
getSessionContext
protected final javax.ejb.SessionContext getSessionContext()
- Convenience method for subclasses. Return the EJB context saved on
initialization.
- Returns:
- the SessionContext saved on initialization by this class's
implementation of the setSessionContext() method.
Rod Johnson and Spring contributors 2001-2003.