web server - Borland Technical Publications

web server - Borland Technical Publications web server - Borland Technical Publications

techpubs.borland.com
from techpubs.borland.com More from this publisher
12.11.2014 Views

Resource Adapter overview 7 Deploy the Resource Adapter Archive to the Borland Enterprise Server, or include it in an Enterprise Application Archive (EAR) file to be deployed as part of a J2EE application. Editing existing Resource Adapters If you have existing Resource Adapters you would like to deploy to the Borland Enterprise Server, it may only be necessary to edit the Borland-specific deployment descriptor described above and repackage the adapter. Doing so involves the following steps, with illustrative example: 1 Create an empty staging directory for the RAR: mkdir c:/temp/staging 2 Copy the Resource Adapter to be deployed into the staging directory: cp shmeAdapter.rar c:/temp/staging 3 Extract the contents of the Resource Adapter Archive: jar xvf shmeAdapter.rar The staging directory should now contain the following: ■ ■ a JAR containing Java classes that implement the Resource Adapter a META-INF directory containing the files Manifest.mf and ra.xml 1 Create the ra-borland.xml file using the Borland Deployment Descriptor Editor (DDEditor) and save it into the staging area's META-INF directory. See the User’s Guide for information on using the DDEditor. 2 Create the new Resource Adapter Archive jar cvf shmeAdapter.rar -C c:/temp/staging 3 You may now deploy the Resource Adapter to the Borland Enterprise Server. Resource Adapter Packaging The Resource Adapter is a J2EE component contained in a RAR. Resource Adapters use a common directory format. The following is an example of a Resource Adapter's directory structure: Resource Adapter Directory Structure: .META-INF/ra.xml .META-INF/ra-borland.xml ./images/shmeAdapter.jpg ./readme.html ./shmeAdapter.jar ./shmeUtilities.jar ./shmeEisSdkWin32.dll ./shmeEisSdkUnix.so As shown in the structure above, the Resource Adapter can include documentation and related files not directly used by the Resource Adapter--for example, the image and readme files. Packaging the Resource Adapter means packaging these files as well. Packaging a Resource Adapter includes the following steps: 1 Create a temporary staging directory. 2 Compile the Resource Adapter Java classes into the staging directory. (Or, as above, simply copy pre-compiled classes into the staging directory.) Chapter 27: Using VisiConnect 265

Deployment Descriptors for the Resource Adapter 3 Create a JAR file to store the Resource Adapter Java classes. Add this JAR to the top level of the staging directory. 4 Create a META-INF subdirectory in the staging area. 5 Create a ra.xml deployment descriptor in this subdirectory and add entries for the Resource Adapter. Refer to Sun Microsystems' documentation for information on the ra.xml document type definition, at http://java.sun.com/dtd/connector_1_0.dtd. 6 Create a ra-borland.xml deployment descriptor in this same META-INF subdirectory and add entries for the Resource Adapter. Refer to the DTD at the end of this document for details on the necessary entries. 7 Create the Resource Adapter Archive: jar cvf resource-adapter-archive.rar -C staging-directory This command creates a RAR file that you can deploy to the server. The -C stagingdirectory option instructs the JAR command to change to the staging-directory so that the directory paths recorded in the RAR file are relative to the directory where the Resource Adapters were staged. One or more Resource Adapters can be staged in a directory and packaged in a JAR file. Deployment Descriptors for the Resource Adapter The Borland Enterprise Server uses two XML files to specify deployment information. The first of these is ra.xml, based on Sun Microsystems' DTD for resource adapters. The second is Borland's proprietary ra-borland.xml, which includes additional deployment information necessary for Borland Enterprise Server. Configuring ra.xml If you do not already have an ra.xml file associated with your Resource Adapter, it is necessary to manually create a new one or edit an existing one. You can use a text editor or the Borland DDEditor to edit these properties. For the most up-to-date information on creating an ra.xml file, refer to the Connectors specification at http:// java.sun.com/j2ee/connector. Configuring the transaction level type It is of critical importance that you specify the transaction level type supported by your Resource Adapter in the ra.xml deployment descriptor. The following table shows the transaction levels supported and how they are rendered in XML. Transaction Support Type None Local XA XML representation NoTransaction LocalTransaction XA 266 BES Developer’s Guide

Deployment Descriptors for the Resource Adapter<br />

3 Create a JAR file to store the Resource Adapter Java classes. Add this JAR to the<br />

top level of the staging directory.<br />

4 Create a META-INF subdirectory in the staging area.<br />

5 Create a ra.xml deployment descriptor in this subdirectory and add entries for the<br />

Resource Adapter. Refer to Sun Microsystems' documentation for information on<br />

the ra.xml document type definition, at http://java.sun.com/dtd/connector_1_0.dtd.<br />

6 Create a ra-borland.xml deployment descriptor in this same META-INF subdirectory<br />

and add entries for the Resource Adapter. Refer to the DTD at the end of this<br />

document for details on the necessary entries.<br />

7 Create the Resource Adapter Archive:<br />

jar cvf resource-adapter-archive.rar -C staging-directory<br />

This command creates a RAR file that you can deploy to the <strong>server</strong>. The -C stagingdirectory<br />

option instructs the JAR command to change to the staging-directory so<br />

that the directory paths recorded in the RAR file are relative to the directory where<br />

the Resource Adapters were staged.<br />

One or more Resource Adapters can be staged in a directory and packaged in a<br />

JAR file.<br />

Deployment Descriptors for the Resource Adapter<br />

The <strong>Borland</strong> Enterprise Server uses two XML files to specify deployment information.<br />

The first of these is ra.xml, based on Sun Microsystems' DTD for resource adapters.<br />

The second is <strong>Borland</strong>'s proprietary ra-borland.xml, which includes additional<br />

deployment information necessary for <strong>Borland</strong> Enterprise Server.<br />

Configuring ra.xml<br />

If you do not already have an ra.xml file associated with your Resource Adapter, it is<br />

necessary to manually create a new one or edit an existing one. You can use a text<br />

editor or the <strong>Borland</strong> DDEditor to edit these properties. For the most up-to-date<br />

information on creating an ra.xml file, refer to the Connectors specification at http://<br />

java.sun.com/j2ee/connector.<br />

Configuring the transaction level type<br />

It is of critical importance that you specify the transaction level type supported by your<br />

Resource Adapter in the ra.xml deployment descriptor. The following table shows the<br />

transaction levels supported and how they are rendered in XML.<br />

Transaction Support Type<br />

None<br />

Local<br />

XA<br />

XML representation<br />

NoTransaction<br />

LocalTransaction<br />

XA<br />

266 BES Developer’s Guide

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!