com.interface21.ejb.support
Class AbstractStatelessSessionBean

java.lang.Object
  |
  +--com.interface21.ejb.support.AbstractEnterpriseBean
        |
        +--com.interface21.ejb.support.AbstractSessionBean
              |
              +--com.interface21.ejb.support.AbstractStatelessSessionBean
All Implemented Interfaces:
javax.ejb.EnterpriseBean, java.io.Serializable, javax.ejb.SessionBean

public abstract class AbstractStatelessSessionBean
extends AbstractSessionBean

Convenient superclass for stateless session beans (SLSBs), minimizing the work involved in implementing an SLSB and preventing common errors. Note that SLSBs are the most useful kind of EJB.
As the ejbActivate() and ejbPassivate() methods cannot be invoked on SLSBs, these methods are implemented to throw an exception and should not be overriden by subclasses. (Unfortunately the EJB specification forbids enforcing this by making these two methods final.)
Subclasses are left to implement the ejbCreate() method to ensure that they offer a no-argument implementation of the home interface's create() method as required by the EJB specification.

Author:
Rod Johnson
See Also:
Serialized Form

Fields inherited from class com.interface21.ejb.support.AbstractEnterpriseBean
logger
 
Constructor Summary
AbstractStatelessSessionBean()
           
 
Method Summary
 void ejbActivate()
           
abstract  void ejbCreate()
          This is declared abstract to ensure that subclasses implement this method.
 void ejbPassivate()
           
 
Methods inherited from class com.interface21.ejb.support.AbstractSessionBean
ejbRemove, getSessionContext, setSessionContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractStatelessSessionBean

public AbstractStatelessSessionBean()
Method Detail

ejbCreate

public abstract void ejbCreate()
                        throws javax.ejb.CreateException
This is declared abstract to ensure that subclasses implement this method. Otherwise it isn't required by the compiler, but will fail on deployment. This is a common cause of errors in implementing SLSBs.
The BeanFactory is available at this point

ejbActivate

public void ejbActivate()
                 throws javax.ejb.EJBException
See Also:
This method always throws an exception, as it should not be invoked by the EJB container.

ejbPassivate

public void ejbPassivate()
                  throws javax.ejb.EJBException
See Also:
This method always throws an exception, as it should not be invoked by the EJB container.


Rod Johnson and Spring contributors 2001-2003.