The Contents of a Deployment Descriptor

We’ve discussed XML deployment descriptors throughout this book—you probably know enough to write deployment descriptors on your own. However, it is still worthwhile to take a tour through a complete descriptor. Example 18-1 is a complete deployment descriptor for the Cabin EJB, which we created in Chapter 4. Other than the type of schema used (XSD or DTD) and the fact that EJB 2.1 uses XML namespaces, the elements are the same in EJB 2.1 and 2.0. The Cabin EJB’s deployment descriptor contains most of the tags that are needed to describe entity beans; session and message-driven beans are not much different. The differences between the versions are small but significant. We’ll use this deployment descriptor to guide our discussion in the following sections.

Example 18-1. Cabin EJB deployment descriptor

<?xml version="1.0" encoding="UTF-8"?> ... <ejb-jar ...> <enterprise-beans> <entity> <description> This Cabin enterprise bean entity represents a cabin on a cruise ship. </description> <ejb-name>CabinEJB</ejb-name> <home>com.titan.cabin.CabinHomeRemote</home> <remote>com.titan.cabin.CabinRemote</remote> <local-home>com.titan.cabin.CabinHomeLocal</local-home> <local>com.titan.cabin.CabinLocal</local> <ejb-class>com.titan.cabin.CabinBean</ejb-class> <persistence-type>Container</persistence-type> <prim-key-class>com.titan.cabin.CabinPK</prim-key-class> <reentrant>False</reentrant> <cmp-version>2.x</cmp-version> <abstract-schema-name>Cabin</abstract-schema-name> ...

Get Enterprise JavaBeans, Fourth 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.