When
EJB application server starts it parse the D.D and then loads and
initializes declared beans. In case of M.D.B container establish a
connection with the message provide(MOM server), client access message
beans through the beans JMS interface (java.JMS.messageListerner) which
exposes a single method.
Message driven bean’s life cycle
- EJB container creates a pool of message-driven bean instances
- For each instance, the EJB container instantiates the bean :
- It calls the setMessageDrivenContext
- It calls the instance's ejbCreate
- Like a stateless session bean,it’s never passivated, It has only two states:
- Nonexistent
- Ready to receive messages.
- is only a bean class – no interfaces
- While in the ready state :
- EJB container may call onMessage
- EJB container may call the ejbRemove
Posted in: 