Designing the Message-Driven Bean

Figure 14.2 shows the design of the OrderVerifier component. The OrderVerifierMDB message-driven bean implements the javax.ejb.MessageDrivenBean and javax.jms.MessageListener interfaces. It implements the methods setMessageDrivenContext() and ejbRemove() as defined in the javax.ejb.MessageDrivenBean and the onMessage() method, as defined in the javax.jms.MessageListener interface. It also implements the ejbCreate() method.

Figure 14.2. OrderVerifierMDB message-driven bean design.

The OrderVerifier bean expects the text message to contain the primary key of the order. It locates the order in the database by using ...

Get Sams Teach Yourself EJB in 21 Days now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.