Read all about EJB 2.0

Dramatic EJB 2.0 changes enhance flexibility and portability in your application development

1 2 3 4 Page 4
Page 4 of 4

As a final note on the message bean, it's important to understand that messages do not have to be produced by other beans in order for the message bean to consume them. Message beans can consume messages from any topic or queue provided by a JMS-compliant vendor. Messages consumed by message beans may have come from other beans (session, entity, or message beans), non-EJB Java applications, or even non-Java applications that use a JMS-compliant vendor. A legacy application might, for example, use IBM's MQSeries to deliver messages to a queue, which is consumed by other legacy applications as well as message beans.


Enterprise JavaBean 2.0 embodies some fantastic changes from the previous specification. The new CMP model is far more flexible than the previous model, allowing entities to model complex object graphs while providing for more portability across containers. The definition of a common query language for find and select operations is greatly anticipated and will also help with portability.

The new MessageDrivenBean type will help bring the powerful messaging paradigm into the limelight enjoyed by EJB. Messaging is an extremely significant ingredient in the distributed computing mix, and its inclusion in EJB is a testament to its importance.

At the time of this writing, EJB 2.0 has just been released as a public draft, which means that it will probably change before it becomes a final specification. An attempt will be made to annotate this article if changes have a serious impact on the material presented here, but the specification is stabilizing, so truly momentous changes are unlikely.

Richard Monson-Haefel is the author of the recently released second edition of Enterprise JavaBeans. He is the lead architect of OpenEJB, an open source Enterprise JavaBeans 2.0 container and has consulted as an architect on Enterprise JavaBeans, CORBA, Java RMI, and other Java projects. Monson-Haefel also maintains a Website for the discussion of Enterprise JavaBeans and related distributed computing technologies.

Learn more about this topic

  • More articles by Richard Monson-Haefel

1 2 3 4 Page 4
Page 4 of 4