Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

Overview

Geronimo uses the OpenEJB container for providing EJB services. With the advent of Java EE, the EJB container services such as transaction management, security, life cycle management can be declared in the EJB class itself using annotations. However, the EJB deployment descriptor can still be provided via usage of the ejb-jar.xml file. When both annotations and the ejb-jar.xml file are provided, the ejb-jar.xml file takes precedence over the annotations.

...

The root XML element in the openejb-jar-2.2.xsd schema is the <openejb-jar-2.2> element. The top-level XML elements of the <openejb-jar> root element are described in the sections below. The deployment plan should always use the OpenEJB namespace, and it typically requires elements from the Geronimo Naming, Geronimo Security, and Geronimo System namespaces. Additionally, it has a required attribute to identify its configuration name. A typical deployment for openejb-jar.xml can be presented as follows:

...

<sys:environment>

The <sys:environment> XML element uses the Geronimo System namespace, which is used to specify the common elements for common libraries and module-scoped services, which is documented here:

...

An example openejb-jar.xml file is shown below using the <sys:environment> element:

...


<sec:security>

The <sec:security> XML element uses the Geronimo Security namespace, and is documented here:

...

The <naming:cmp-connection-factory> element is used to specify a JDBC connection pool that should be used by Container Managed Persistence (CMP) entity beans to connect to a database. Since the <naming:cmp-connection-factory> element points to a database pool using the same syntax a resource reference uses, there are multiple methods available to refer to the connection pool. It can be specified by a simple name using the <resource-link> element, by pattern using the <pattern> element, or finally by URL using the <url> element. The resource-link handles most common resource situations where the JDBC pools are deployed as J2EE connectors in the same application, or deployed standalone in the same server. But pattern or URL can be use for any. An example openejb-jar.xml using all three techniques is shown:

...

...


<ejb-ql-compiler-factory>

...

The <ejb-ql-compiler-factory> element is used to specify the name of a Java class that can compile EJB-QL (Query Language) queries into SQL statements for a particular database product. This must be the fully-qualified class name of a class that implements org.tranql.sql.EJBQLCompilerFactory. The default is for the Derby database, which ships with Geronimo, although it may work for other database products as well. An example openejb-jar.xml using the <ejb-ql-compiler-factory> XML element is shown:

...


<db-syntax-factory>

The <db-syntax-factory> XML element uses the OpenEJB default namespace for a openejb-jar.xml file, which is documented here:

...

The <db-syntax-factory> element is used to specify the name of a Java class that can customize CMP SQL statements for a particular database product. This must be the fully-qualified class name of a class that implements org.tranql.sql.DBSyntaxFactory. The default is for the Derby database, which ships with Geronimo, although it may work for other database products as well. An example openejb-jar.xml using the <db-syntax-factory> XML element is shown:

...

...


<enforce-foreign-key-constraints>

...

The <enforce-foreign-key-constraints> element is effectively a true/false element – if it's present that means true, and if it's not present, that means false. If true, then Geronimo will make a special effort to execute insert, update, and delete statements in an order consistent with the foreign keys between tables. If false, then Geronimo will execute statements in any order, though still within the same transaction. This element should be present if the underlying database enforces foreign keys at the moment a statement is executed instead of at the end of the transaction. An example openejb-jar.xml setting the <db-syntax-factory> XML element to "true" is shown:

...

...

<relationships>

The <relationships> XML element uses the OpenEJB default namespace for a openejb-jar.xml file, which is described here:

...

The <enterprise-beans> element used to specify references by <entity>, <session>, or <message-driven> EJB's. For example, a EJB Entity Bean would be specified similarly as below in an openejb-jar.xml file:

...

...

A EJB Session Bean would be specified similarly as below in an openejb-jar.xml file:

...

...

And an EJB Message-driven Bean would be specified similarly as below in an openejb-jar.xml file:

...

<ejb-name>

The <ejb-name> element identifies the EJB that these settings apply to and must match the <ejb-name> for the EJB in ejb-jar.xml file.

...

The <activation-config> XML element is used to specify any configuration data (in the form of name/value pairs) required by the resource adapter in order to supply messages to the MDB. For example:

...

...