java.lang.Object | ||
↳ | org.springframework.ejb.support.AbstractEnterpriseBean | |
↳ | org.springframework.ejb.support.AbstractMessageDrivenBean |
Known Direct Subclasses |
Convenient base class for EJB 2.x 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. This ejbCreate()
method loads a BeanFactory,
before invoking the onEjbCreate()
method, which is
supposed to contain subclass-specific initialization.
NB: We cannot use final methods to implement EJB API methods,
as this violates the EJB specification. However, there should be
no need to override the setMessageDrivenContext
or
ejbCreate()
methods.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.ejb.support.AbstractEnterpriseBean
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
logger | Logger available to subclasses |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Lifecycle method required by the EJB specification but not the
MessageDrivenBean interface.
| |||||||||||
Required lifecycle method.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Convenience method for subclasses to use.
| |||||||||||
Subclasses must implement this method to do any initialization they would
otherwise have done in an
ejbCreate() method. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.ejb.support.AbstractEnterpriseBean
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
javax.ejb.MessageDrivenBean
|
Logger available to subclasses
Lifecycle method required by the EJB specification but not the MessageDrivenBean interface. This implementation loads the BeanFactory.
Don't override it (although it can't be made final): code initialization in onEjbCreate(), which is called when the BeanFactory is available.
Unfortunately we can't load the BeanFactory in setSessionContext(), as resource manager access isn't permitted and the BeanFactory may require it.
Required lifecycle method. Sets the MessageDriven context.
messageDrivenContext | MessageDrivenContext |
---|
Convenience method for subclasses to use.
Subclasses must implement this method to do any initialization they would
otherwise have done in an ejbCreate()
method. In contrast
to ejbCreate()
, the BeanFactory will have been loaded here.
The same restrictions apply to the work of this method as
to an ejbCreate()
method.