Figure 14–6 illustrates the stages in the lifecycle of a message-driven bean.
The EJB container usually creates a pool of message-driven bean instances. For each instance, the EJB container performs these tasks.
If the message-driven bean uses dependency injection, the container injects these references before instantiating the instance.
The container calls the method annotated @PostConstruct, if any.
Like a stateless session bean, a message-driven bean is never passivated and has only two states: nonexistent and ready to receive messages.
At the end of the lifecycle, the container calls the method annotated @PreDestroy, if any. The bean’s instance is then ready for garbage collection.