last summer, sun microsystems released the first public draft of the ejb 2.0 specification with a lot of fanfare. since then, its been through a whirlwind of discussion, controversy, and modifications. yes, modifications. the latest release of the ejb specification is public final draft 2, which was released at the end of april.
the latest incarnation of the ejb specification has a variety of features that developers should become familiar with: the introduction of message-driven beans the creation of a new entity ejb container-managed persistence model a model for creating container-managed relationships between entity ejbs the creation of a standard query language, ejb-ql, for querying ejbs and their properties the introduction of local interfaces for session and entity beans the renaming of remote interfaces to component interfaces the introduction of home methods the introduction of ejbselect methods that allow an entity ejb to internally query for properties using a deployment descriptor-defined ejb-ql query this article provides a rapid-fire implementation primer to the new features of the ejb 2.0 specification for developers with prior ejb experience.
the examples in this article are based on the simple uml diagram presented in figure 1. our mini e-business system will model components that might be used by a magazine publisher. our magazine component will be a cmp-entity ejb that can have zero or more article cmp-entity ejb components in a one-to-many container-managed relationship (cmr). the client application will be able to query the magazine component for magazines and articles. additionally, the client application will be able to register a subscriber to a magazine by sending a jms message to a queue that has a registration message-driven bean consumer. the registration message-driven bean will simulate registering the subscriber and sending an e-mail message to confirm the information.
the examples provided with this article are configured to run on bea weblogic server 6.0, service pack 1. the examples are based on the ejb 2.0 specification, public draft 1 (pd1). the examples do not support pd2 semantics since a vendor implementation supporting pd2 did not exist at the time this article was written. pd2 introduces requirements around the use of local interfaces for entity ejbs participating in a cmr relationship, a modified ejb-ql language, and a different dtd for the ejb deployment descriptor.... 下一页