Configuring JCA administered objects

You can configure administered objects that comply with the Java™ EE Connector Architecture (JCA) specification.

About this task

You can configure one or more instances of administered objects that are provided by an installed resource adapter.
Note: To configure JCA support for Liberty, you must edit the server.xml file using either the Source view of the Server configuration editor of the WebSphere® Application Server Developer Tools for Eclipse, or some other text editor. This topic assumes that a resource adapter with a unique identifier of MyAdapter has already been configured in the server, see the documentation on configuring resource adapters for further details. An end-to-end example of configuring a basic scenario is provided in the following steps.
Note: Editing the properties sub-elements of the server configuration for connection factories, administrative objects, activation specifications, and resource adapters in the Design view of WebSphere® Development Tools (WDT) is not supported.

Procedure

  1. Update the server.xml file to add the jca-1.6 feature under the featureManager tag.
    <featureManager>  
    	<feature>jca-1.6</feature> 
    	<feature>jndi-1.0</feature>  <!-- Add the jndi feature to enable look up of connection factories and administered objects. -->   
    		... 
    </featureManager>
  2. Install a resource adapter.
    For example, update the server.xml file as follows:
    <resourceAdapter location="C:/adapters/MyAdapter.rar"/>
  3. Configure one or more administered object instances.
    When you configure administered object instances, you must supply a properties subelement, even if you do not want to override any configuration properties, to associate the adminObject element with an administered object type that is provided by a particular resource adapter. In the following example, the MyAdapter resource adapter provides only one type of administered object:
    <adminObject jndiName="eis/interactionSpec">
     <properties.MyAdapter functionName="find" executionTimeout="5000"/>
    </adminObject>
  4. (Optional) If required, identify the available administered object property subelement names.
    • If a resource adapter provides exactly one administered object interface excluding any JMS destinations, queues and topics, the subelement name is: properties.<rar_identifier>

    • If the interface name is unique without the package name, the subelement name is: properties.<rar_identifier>.<InterfaceName>

    • If the implementation name is unique without the package name, the subelement name is: properties.<rar_identifier>.<ImplementationName>

    • If the combination of interface name and implementation name are unique without the package name, the subelement name is: properties.<rar_identifier>.<InterfaceName>-<ImplementationName>

    • In other cases, the subelement name is: properties.<rar_identifier>.<fully.qualified.InterfaceName>-<fully.qualified.ImplementationName>

Example

Use the following example to learn how to configure resource adapters with two administered objects with unique interface class names.

In the following snippet from a ra.xml file, the MyAdapter resource adapter provides two administered objects with unique interface class names:

<adminobject>
<adminobject-interface>javax.resource.cci.ConnectionSpec</adminobject-interface>
<adminobject-class>com.vendor.adapter.ConnectionSpecImpl</adminobject-class>
<config-property> 
 <config-property-name>isolationLevel</config-property-name>
 <config-property-type>java.lang.Integer</config-property-type>
</config-property>
... 
</adminobject>

<adminobject>
<adminobject-interface>javax.resource.cci.InteractionSpec</adminobject-interface>
<adminobject-class>com.vendor.adapter.InteractionSpecImpl</adminobject-class>
<config-property>
 <config-property-name>FunctionName</config-property-name>
 <config-property-type>java.lang.String</config-property-type>
</config-property>
... 
</adminobject>
The following is an example of a server configuration for this scenario:
<adminObject jndiName="eis/connectionSpec">
 <properties.MyAdapter.ConnectionSpec isolationLevel="4"/>
</adminObject>

<adminObject jndiName="eis/interactionSpec">
 <properties.MyAdapter.InteractionSpec functionName="find"/>
</adminObject>

Use the following example to learn how to configure resource adapters with two administered objects with unique implementation class names.

In the following snippet from a ra.xml file, the MyAdapter resource adapter provides two administered objects with unique implementation class names:

<adminobject>
<adminobject-interface>javax.resource.cci.InteractionSpec</adminobject-interface>
<adminobject-class>com.vendor.adapter.FinderInteractionSpec</adminobject-class>
<config-property>
 <config-property-name>ResultSetType</config-property-name>
 <config-property-type>java.lang.Integer</config-property-type>
</config-property> 
... 
</adminobject>

<adminobject>
<adminobject-interface>javax.resource.cci.InteractionSpec</adminobject-interface>
<adminobject-class>com.vendor.adapter.UpdaterInteractionSpec</adminobject-class> 
<config-property> 
 <config-property-name>ExecutionTimeout</config-property-name>
 <config-property-type>java.lang.Long</config-property-type> 
</config-property>
...
</adminobject>
The following is an example of a server configuration for this scenario:
<adminObject jndiName="eis/finder">
 <properties.MyAdapter.FinderInteractionSpec resultSetType="1003"/>
</adminObject>

<adminObject jndiName="eis/updater">
 <properties.MyAdapter.UpdaterInteractionSpec executionTimeout="3000"/>
</adminObject>

Use the following example to learn how to configure resource adapters with two administered objects where neither the simple interface nor implementation class names are unique.

In the following snippet from a ra.xml file, the MyAdapter resource adapter provides two administered objects where neither the simple interface nor the implementation class names are unique:

<adminobject>
<adminobject-interface>javax.resource.cci.InteractionSpec</adminobject-interface>
<adminobject-class>com.vendor.adapter.finder.InteractionSpecImpl</adminobject-class>
<config-property> 
 <config-property-name>ResultSetType</config-property-name>
 <config-property-type>java.lang.Integer</config-property-type>
</config-property>
... 
</adminobject>

<adminobject>
<adminobject-interface>javax.resource.cci.InteractionSpec</adminobject-interface>
<adminobject-class>com.vendor.adapter.updater.InteractionSpecImpl</adminobject-class>
<config-property> 
 <config-property-name>ExecutionTimeout</config-property-name>
 <config-property-type>java.lang.Long</config-property-type>
</config-property>
...
</adminobject>
The following is an example of a server configuration for this scenario:
<adminObject jndiName="eis/finder">
 <properties.MyAdapter.javax.resource.cci.InteractionSpec-com.vendor.adapter.finder.InteractionSpecImpl resultSetType="1003"/>
</adminObject> 

<adminObject jndiName="eis/updater"> 
 <properties.MyAdapter.javax.resource.cci.InteractionSpec-com.vendor.adapter.updater.InteractionSpecImpl executionTimeout="3000"/>
</adminObject>

It is possible to override the suffixes of configuration element names. See the information about customizing JCA configuration elements to learn how to override the suffixes of configuration element names.