Enterprise JavaBeans 3.0 (EJB3) Overview

The release of the EJB3 (JSR-220) specification in 2006 marked a significant turning point for EJB and Java EE in general. The primary theme of EJB3 is simplification and it achieves this goal very nicely. In addition to simplifying the development and deployment of Enterprise JavaBeans, the EJB3 specification added a new ORM-based persistence framework called JPA aimed at replacing the EJB 2.1 Entity Beans (which are no longer supported in EJB3).

One of the goals of the EJB3 specification is to address several issues found in the EJB 2.1 specification. Some of these issues included the dependency on a framework for the development of Enterprise JavaBeans (i.e., implementing and extending specific EJB interfaces), the need for home and remote interfaces, verbose and complex XML deployment descriptors, and the Entity Bean persistence model.

One of the significant productivity improvements in EJB3 is the use of Java metadata annotations over XML deployment descriptors (e.g., ejb-jar.xml). Of course, you can still choose to use XML deployment descriptors rather than annotations or you can use both XML and annotations together. When used in conjunction with annotations, the XML deployment descriptor overrides any matching configuration specified by the metadata annotation.

Other major features of the EJB3 framework include simplified bean development, the use of dependency injection, simplified callback methods for session and message-driven beans, ...

Get Java Message Service, 2nd 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.