Creating a Message-Driven Bean

Creating a message-driven bean is not that complicated. They really are much easier to create than session or entity beans because you don’t have to worry about creating a home or a component interface for them. To create a message-driven bean, your class must implement two required interfaces:

  • The javax.ejb.MessageDrivenBean interface

  • The javax.jms.MessageListener interface

The MessageDrivenBean Interface

The first interface that your message-driven bean must implement is the javax.ejb.MessageDrivenBean interface. Table 11.1 lists the methods that are part of the MessageDrivenBean interface.

Table 11.1. Methods of the javax.ejb.MessageDrivenBean Interface
Name Description
ejbRemove Called by the container before ...

Get Special Edition Using Enterprise JavaBeans™ 2.0 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.