JCA provides an independent and standardized mechanism for integrating with systems external to an application server via a standard set of contracts. JCA defines contracts for the management of lifecycle, connections, transactions, security, work, message inflow, and transaction inflow. Apache Geronimo supports JCA 1.5 and utilizes it to provide JMS resources and JDBC connection pooling. Through the use of a JCA resource adapter descriptor, the JDBC resources can be packaged up in a Resource Adapter Archive (RAR) file and deployed into the Geronimo server. This section explores the contents of a RAR file.
The RAR file is packaged using the jar tool and must include a deployment descriptor in a META-INF directory, as well as any additional items such as Java classes, native libraries, and any documentation and images. These contents and their locations are broken down in Table 13-1.
Item | Required | Location |
---|---|---|
Deployment Descriptor | Yes | META-INF/ra.xml |
Documentation | No | Arbitrary |
Dependent Classes | No | Arbitrary |
Native Libraries | No | Arbitrary |
The deployment of these resources takes place via the resource adapter deployment descriptor and the tranql-connector-derby-embed-xa-1.1.rar file. The contents of this RAR file are shown in Listing 13-1.
Listing 13-1: The Contents of the tranql-connector-derby-embed-xa-1.1.rar File
META-INF/ META-INF/MANIFEST.MF META-INF/ra.xml tranql-connector-1.1.jar tranql-connector-derby-common-1.1.jar
The tranql-connector-derby-embed-xa-1.1.rar file comes from the TranQL project (http:// tranql.codehaus.org/) and is a very specific resource adapter designed to support the embedded API for Apache Derby. To deploy a RAR file, it needs a deployment plan. The deployment plan and the RAR file are fed to the Geronimo deployer and deployed to the Geronimo server. This whole process will be outlined later in the chapter. For now, the process of creating a deployment plan will be covered.