When deploying your adapter as a resource adapter archive (RAR) follow the rules described in the JCA specification.
The references refer to chapter 10, particularly chapter 10.2, of the document J2EE Connector Architecture Specification, Final Version 1.0.
You can download this document at java.sun.com/j2ee/connector.
An RAR typically contains the following:
META-INF\connector-j2ee-engine.xml
META-INF\log-configuration.xml
META-INF\Manifest.mf
META-INF\ra.xml
your_ra.jar
connector-j2ee.engine.xml
The AS Java connector-j2ee.engine.xml Deployment Descriptor (DD) is required to restore references to other units, such as the Adapter-Framework Messaging Service or the Adapter Framework CCI Library.
More information: Deployment Descriptors
The content looks the same as in the following example, and can be used for an adapter in the Adapter Framework.
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE connector-j2ee-engine SYSTEM 'connector-j2ee-engine.dtd'>
<connector-j2ee-engine>
<loader-references>
<!-- Typically these SAP J2EE libs, etc. are used -->
<loader-name strength="hard">interface:appcontext</loader-name>
<loader-name strength="hard">service:engine.security.facade</loader-name>
<loader-name strength="hard">library:engine.j2ee14.facade</loader-name>
<loader-name strength="hard">library:com.sap.base.technology.facade</loader-name>
<!-- Use AF Facades in 7.1, never the single interfaces, libraries or services -->
<loader-name strength="hard">library:com.sap.aii.af.lib.facade</loader-name>
<loader-name strength="hard">interface:com.sap.aii.af.ifc.facade</loader-name>
<loader-name strength="hard">service:com.sap.aii.af.svc.facade</loader-name>
</loader-references>
</connector-j2ee-engine>
log-configuration.xml
If you want to support the optional AS Java logging API, add log-configuration.xml to it.
This makes the adapter trace objects known to AS Java and contains default values for the logging settings.
More information: Tracing, Logging, and Monitoring
The content looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log-configuration SYSTEM "log-configuration.dtd">
<log-configuration>
<log-formatters>
<!-- This formatter produces human readable messages. -->
<log-formatter name="trc" pattern="%26d %150l [%t] %10s: %m"
type="TraceFormatter"/>
</log-formatters>
<log-destinations>
<!-- Destination for Trace Information of this ra com.sap.aii.af.sample.adapter.ra -->
<log-destination count="5" effective-severity="DEBUG" limit="2000000" name="sample_ra.trc" pattern="./log/applications/com.sap.aii.af.sample.adapter.ra/default.trc" type="FileLog">
<formatter-ref name="trc"/>
</log-destination>
</log-destinations>
<log-controllers>
<!-- Trace Location com.sap.aii.af.sample.adapter.ra -->
<log-controller name="com.sap.aii.af.sample.adapter.ra" effective-severity="ERROR">
<associated-destinations>
<destination-ref association-type="LOG" name="sample_ra.trc"/>
</associated-destinations>
</log-controller>
<!-- Logging Category: none, we use the default XILog -->
</log-controllers>
</log-configuration>
You must replace the entries in bold in the above example with the specifications for your own adapter.
The name of the log controller must be identical to the package name.
Manifest.mf
The Manifest.mf file can be empty, but it must exist. It does not contain any information that is necessary for the deployment process.
ra.xml
The RA.XML file follows the rules of the JCA specification. It could look like this:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE connector PUBLIC '-//Sun Microsystems, Inc.//DTD Connector 1.0//EN' 'http://java.sun.com/dtd/connector_1_0.dtd'>
<connector>
<display-name>
sample_ra
</display-name>
<vendor-name>
sap.com
</vendor-name>
<spec-version>
1.0
</spec-version>
<eis-type>
XI AF Sample Resource Adapter
</eis-type>
<version>
1.4
</version>
<resourceadapter>
<managedconnectionfactory-class>
com.sap.aii.af.sample.adapter.ra.SPIManagedConnectionFactory
</managedconnectionfactory-class>
<connectionfactory-interface>
javax.resource.cci.ConnectionFactory
</connectionfactory-interface>
<connectionfactory-impl-class>
com.sap.aii.af.sample.adapter.ra.CCIConnectionFactory
</connectionfactory-impl-class>
<connection-interface>
javax.resource.cci.Connection
</connection-interface>
<connection-impl-class>
com.sap.aii.af.sample.adapter.ra.CCIConnection
</connection-impl-class>
<transaction-support>
NoTransaction
</transaction-support>
<config-property>
<config-property-name>
addressMode
</config-property-name>
<config-property-type>
java.lang.String
</config-property-type>
<config-property-value>
CPA
</config-property-value>
</config-property>
<config-property>
<config-property-name>
adapterType
</config-property-name>
<config-property-type>
java.lang.String
</config-property-type>
<config-property-value>
JCA
</config-property-value>
</config-property>
<config-property>
<config-property-name>
adapterNamespace
</config-property-name>
<config-property-type>
java.lang.String
</config-property-type>
<config-property-value>
http://sap.com/xi/XI/sample
</config-property-value>
</config-property>
<authentication-mechanism>
<authentication-mechanism-type>
BasicPassword
</authentication-mechanism-type>
<credential-interface>
javax.resource.spi.security.PasswordCredential
</credential-interface>
</authentication-mechanism>
<reauthentication-support>
false
</reauthentication-support>
</resourceadapter>
</connector>
You must replace the entries in bold in the above example with the specifications for your adapter.
The adapter specifies NoTransactionbecause it implements the transaction control itself.
More information: Asynchronous Messages .
If you deploy the resource adapter in the stand-alone variant, your own Adapter Framework modules are not deployed. The default modules are used instead. You must set the connectionfactory and connection interfaces to the CCI standard interfaces.