O'Reilly logo

J2EE™ Tutorial, The by Beth Stearns, Monica Pawlan, Eric Jendrock, Kim Haase, Dale Green, Stephanie Bodoff

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Message-Driven Bean Class

The code for the SimpleMessageEJB class illustrates the requirements of a message-driven bean class:

  • It implements the MessageDrivenBean and MessageListener interfaces.

  • The class is defined as public.

  • The class cannot be defined as abstract or final.

  • It implements one onMessage method.

  • It implements one ejbCreate method and one ejbRemove method.

  • It contains 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 may contain helper ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required