{scrollbar}

Overview

The Geronimo deployment plan for a resource adapter, which is usually packaged as a JAR file, is called "geronimo-ra.xml". The geronimo-ra.xml deployment plan is used in conjunction with the ra.xml Java EE deployment plan to deploy JCA connector JAR(s) to the Geronimo application server. The geronimo-ra.xml deployment plan is an optional file, but is typically used when deploying a resource adapter JAR file. It is used to specify a moduleId for the deployed module, any third party dependencies, a description for the JCA adapter, an administration object, and additional GBeans..

Packaging

The geronimo-ra.xml deployment plan can be packaged as follows:

  1. Embedded in an JAR file. In this case, a geronimo-ra.xml file must be placed in the /META-INF directory of the JAR, which is the same place where the ra.xml file must be located.

  2. Maintained separately from the JAR file. In this case, the path to the file must be provided to the appropriate Geronimo deployer (e.g., command-line or console). Note that in this case, the filename can be named something other than geronimo-ra.xml but must adhere to the same schema.

  3. Embedded in an application EAR file and referenced by an <alt-dd> element of the EAR deployment plan.

Schema

The geronimo-ra.xml deployment plan is defined by the geronimo-connector-1.2.xsd schema located in the <geronimo_home>/schema/ subdirectory of the main Geronimo installation directory. The geronimo-connector-1.2.xsd schema is briefly described here:

http://geronimo.apache.org/schemas-2.1/docs/geronimo-connector-1.2.xsd.html

Schema top-level elements

The root XML element in the geronimo-connector-1.2.xsd schema is the <connector> element. The top-level XML elements of the <connector> root element are described in the sections below. The deployment plan should always use the Connector namespace, and it typically requires elements from Geronimo System namespace. A typical deployment for geronimo-ra.xml can be presented as follows:

<conn:connector xmlns:conn="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2"
                xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
                ...
</conn:connector>

<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, and is described here:

The <sys:environment> element contains the following elements:

An example geronimo-ra.xml file is shown below using the <sys:environment> elements:

<conn:connector xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2"
  xmlns:conn="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2">
  <dep:environment>
    <dep:moduleId>
      <dep:groupId>connector</dep:groupId>
      <dep:artifactId>ConnectorProj</dep:artifactId>
      <dep:version>1.0</dep:version>
      <dep:type>jar</dep:type>
    </dep:moduleId>
    <dep:dependencies>
      <dep:dependency>
        <dep:groupId>org.apache.geronimo.configs</dep:groupId>
        <dep:artifactId>sharedlib</dep:artifactId>
        <dep:type>car</dep:type>
      </dep:dependency>
    </dep:dependencies>
  </dep:environment>
</conn:connector>

<resourceadapter>

The <resourceadapter> uses the Geronimo default namespace for a geronimo-ra.xml file that is described here:

This element is used to define a single JDBC connector or JMS connection factory. The <resourceadapter-instance> element provides resource adapter instance specific information like configuration properties and workmanager implementation. The <outboundresource-adapter> specifies information about an outbound resource adapter. The information includes fully qualified names of classes and interfaces required as part of the connector architecture specified contracts for connection management, level of transaction support provided, one or more authentication mechanisms supported and additional required security permissions. If there is no authentication mechanism specified as part of the resource adapter element, then the resource adapter does not support any standard security contract. The application server ignores the security part of the system contracts in this case.

<connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2">
  <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
    <dep:moduleId>
      <dep:groupId>console.dbpool</dep:groupId>
      <dep:artifactId>AuthorConnectionsPool</dep:artifactId>
      <dep:version>1.0</dep:version>
      <dep:type>rar</dep:type>
    </dep:moduleId>
    <dep:dependencies>
      <dep:dependency>
        <dep:groupId>org.apache.derby</dep:groupId>
        <dep:artifactId>derby</dep:artifactId>
        <dep:version>10.1.1.0</dep:version>
        <dep:type>jar</dep:type>
      </dep:dependency>
    </dep:dependencies>
  </dep:environment> 
  <resourceadapter>
    <outbound-resourceadapter>
      <connection-definition>
        <connectionfactory-
interface>javax.sql.DataSource</connectionfactory-interface>
        <connectiondefinition-instance>
          <name>AuthorConnectionsPool</name>
          <config-property-setting name="Password">APP</config-property-
setting>
          <config-property-setting
name="Driver">org.apache.derby.jdbc.EmbeddedDriver</config-property-setting>
          <config-property-setting name="UserName">APP</config-property-
setting>
          <config-property-setting
name="ConnectionURL">jdbc:derby:wroxauthors</config-property-setting>
          <connectionmanager>
            <local-transaction/>
            <single-pool>
              <max-size>10</max-size>
              <min-size>0</min-size>
              <match-one/>
            </single-pool>
          </connectionmanager>
        </connectiondefinition-instance>
      </connection-definition
    </outbound-resourceadapter>
  </resourceadapter>
</connector>

<adminobject>

The <adminobject> uses the Geronimo default namespace for a geronimo-ra.xml file that is described here:

This element can be used to define a JMS topic or queue. The <adminobject> contains the following elements:

<connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2">
  <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
    <dep:moduleId>
      <dep:groupId>console.dbpool</dep:groupId>
      <dep:artifactId>AuthorConnectionsPool</dep:artifactId>
      <dep:version>1.0</dep:version>
      <dep:type>rar</dep:type>
    </dep:moduleId>
    <dep:dependencies>
      <dep:dependency>
        <dep:groupId>org.apache.derby</dep:groupId>
        <dep:artifactId>derby</dep:artifactId>
        <dep:version>10.1.1.0</dep:version>
        <dep:type>jar</dep:type>
      </dep:dependency>
    </dep:dependencies>
  </dep:environment> 
  <resourceadapter>
    <inbound-resourceadapter>
      <messageadapter>
        <messagelistener>
          <messagelistener-type>javax.jms.MessageListener</messagelistener-type>
          <activationspec>
            <activationspec-class>org.apache.activemq.ra.ActiveMQActivationSpec</activationspec-class>                     
            <required-config-property>
              <config-property-name>destination</config-property-name>
            </required-config-property>
            <required-config-property>
              <config-property-name>destinationType</config-property-name>
            </required-config-property>
          </activationspec>
        </messagelistener>
      </messageadapter>
    </inbound-resourceadapter>
    <adminobject>
      <adminobject-interface>javax.jms.Queue</adminobject-interface>
      <adminobject-class>org.apache.activemq.command.ActiveMQQueue</adminobject-class>
      <config-property>
        <config-property-name>PhysicalName</config-property-name>
        <config-property-type>java.lang.String</config-property-type>
      </config-property>
    </adminobject>
    <adminobject>
      <adminobject-interface>javax.jms.Topic</adminobject-interface>
      <adminobject-class>org.apache.activemq.command.ActiveMQTopic</adminobject-class>
      <config-property>
        <config-property-name>PhysicalName</config-property-name>
        <config-property-type>java.lang.String</config-property-type>
      </config-property>
    </adminobject>
  </resourceadapter>
</connector>

<sys:service>

The <sys:service> element uses the Geronimo deployment namespace described here:

It is an empty generic element to be extended by GBean and other module types.