Local Clients

   

Message-Driven Beans

EJB 2.0 defines a third type of enterprise bean ”the message-driven bean ”for the purpose of integrating the EJB architecture with the Java Message Service (JMS). This bean type differs most from entity and session beans in that it doesn't serve a synchronous client. Instead, a client makes use of the business logic defined by a message-driven bean by sending a message to a JMS destination (queue or topic) with which the bean has been associated. When the destination receives a message that satisfies the selector criteria (if any) established for the bean, the container invokes the bean's onMessage method, which allows the bean to function as a JMS message consumer. You're responsible for implementing the onMessage method so that it performs any business logic you want to execute based on a received message. Unlike session and entity beans, you don't declare home and component interfaces to expose the functionality of a message-driven bean. All work is done through onMessage and the client has no direct access to the bean. A future goal (beyond EJB 2.0) is to support messaging APIs other than JMS.

For more information on the new message-driven bean, see "What are Message-Driven Beans?" p. 316 .



Special Edition Using Enterprise JavaBeans 2.0
Special Edition Using Enterprise JavaBeans 2.0
ISBN: 0789725673
EAN: 2147483647
Year: 2000
Pages: 223

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net