org.springframework.ejb.support |
Superclasses to make implementing EJBs simpler and less error-prone,
as well as guaranteeing a Spring BeanFactory is available to EJBs.
This promotes good practice, with EJB services used for transaction
management, thread management, and (possibly) remoting, while
business logic is implemented in easily testable POJOs.
In this model, the EJB is a facade, with as many POJO helpers
behind the BeanFactory as required.
The classes in this package are discussed in Chapter 11 of
Expert One-On-One J2EE Design and Development
by Rod Johnson (Wrox, 2002).
The present version has changed somewhat, but has the same goals.
Note that the default behavior is to look for an EJB enviroment variable
with name ejb/BeanFactoryPath that specifies the
location on the classpath of an XML bean factory definition
file (such as /com/mycom/mypackage/mybeans.xml ).
If this JNDI key is missing, your EJB subclass won't successfully
initialize in the container.
|
Java Source File Name | Type | Comment |
AbstractEnterpriseBean.java | Class | Base class for all Spring-based EJBs. |
AbstractJmsMessageDrivenBean.java | Class | Convenient superclass for JMS MDBs. |
AbstractMessageDrivenBean.java | Class | Convenient superclass for MDBs.
Doesn't require JMS, as EJB 2.1 MDBs are no longer JMS-specific;
see the
AbstractJmsMessageDrivenBean subclass.
This class ensures that subclasses have access to the
MessageDrivenContext provided by the EJB container, and implement
a no-arg ejbCreate() method as required by the EJB
specification. |
AbstractSessionBean.java | Class | Base class for all Spring-based EJB session beans. |
AbstractStatefulSessionBean.java | Class | Convenient superclass for stateful session beans.
SFSBs should extend this class, leaving them to implement the
ejbActivate() and ejbPassivate() lifecycle
methods to comply with the requirements of the EJB specification.
Note: Subclasses should invoke the loadBeanFactory()
method in their custom ejbCreate() and ejbActivate()
methods, and should invoke the unloadBeanFactory() method in
their ejbPassivate method.
Note: The default BeanFactoryLocator used by this class's superclass
(ContextJndiBeanFactoryLocator) is not serializable. |
AbstractStatelessSessionBean.java | Class | 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. |
SmartSessionBean.java | Interface | Interface to be implemented by Session Beans that want
to expose important state to cooperating classes. |