O'Reilly logo

Sams Teach Yourself J2EE™ in 21 Days by Peter Roxburgh, Andy Longshaw, Debbie Law, Dan Haywood, Martin Bond

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

Programming Interfaces in a Message-Driven Bean

There are a number of constraints on the contents of a Message-driven bean class. In particular your Message-driven bean class must

  • Implement the javax.ejb.MessageDrivenBean interface

  • Implement the javax.jms.MessageListener interface

  • Have a single constructor, with no arguments

  • Have a single public setMessageDrivenContext(MessageDrivenContext ctx) method that returns a void

  • Have a single public ejbCreate() method with no arguments that returns a void

  • Have a single public ejbRemove() method with no arguments that returns a void

  • Have a single public onMessage(Message message) method that returns a void

  • Not have a finalize() method

The following sections cover these methods in more detail.

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