The Message-Driven Bean Class
The code for the SimpleMessageBean class illustrates the requirements of a message-driven bean class:
It must implement the MessageDrivenBean and MessageListener interfaces.
The class must be defined as public.
The class cannot be defined as abstract or final.
It must implement one onMessage method.
It must implement one ejbCreate method and one ejbRemove method.
It must contain a public constructor with no arguments.
It must not define the finalize method.
Unlike session and entity beans, message-driven beans do not have the remote or local interfaces that define client access. Client components do not locate message-driven beans and invoke methods on them. Although message-driven beans do not have business methods, they ...
Get The J2EE™ Tutorial Second Edition 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.