@Deprecated public abstract class AbstractMessageDrivenBean extends AbstractEnterpriseBean implements MessageDrivenBean
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.
Modifier and Type | Field and Description |
---|---|
protected Log |
logger
Deprecated.
Logger available to subclasses
|
BEAN_FACTORY_PATH_ENVIRONMENT_KEY
Constructor and Description |
---|
AbstractMessageDrivenBean()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
ejbCreate()
Deprecated.
Lifecycle method required by the EJB specification but not the
MessageDrivenBean interface.
|
protected MessageDrivenContext |
getMessageDrivenContext()
Deprecated.
Convenience method for subclasses to use.
|
protected abstract void |
onEjbCreate()
Deprecated.
Subclasses must implement this method to do any initialization they would
otherwise have done in an
ejbCreate() method. |
void |
setMessageDrivenContext(MessageDrivenContext messageDrivenContext)
Deprecated.
Required lifecycle method.
|
ejbRemove, getBeanFactory, onEjbRemove, setBeanFactoryLocator, setBeanFactoryLocatorKey
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
ejbRemove
protected final Log logger
public void setMessageDrivenContext(MessageDrivenContext messageDrivenContext)
setMessageDrivenContext
in interface MessageDrivenBean
messageDrivenContext
- MessageDrivenContextprotected final MessageDrivenContext getMessageDrivenContext()
public void ejbCreate()
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.
protected abstract void onEjbCreate()
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.