So far, you have looked at two types of Enterprise Java Bean (EJB)—the Session bean and the Entity bean. Today you will consider the third and final EJB, the Message-driven bean. Topics that are covered are as follows:
Similarities and differences with Entity and Session beans
The life-cycle of a Message-driven bean
Writing a Message-driven bean
Prior to the EJB 2.0 specification, it was only possible to support asynchronous message passing by writing an external Java program that acted as a listener. A listener is a program whose sole purpose is to wait for data to arrive, for example, a socket server program that “listens” on a socket and perform some action when it detects client connections. The listener was then ...