Configuring JCA activation specifications

You can configure activation specifications that comply with the Java EE Connector Architecture (JCA) specification.

About this task

You can configure one or more instances of activation specifications 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>
    Stabilized feature: The jca-1.6 feature is stabilized. You can continue to use the jca-1.6 feature. However, consider using a later JCA feature.
  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 activation specifications.
    When you configure activation specifications, you must supply a properties subelement, even if you do not want to override any configuration properties, to associate the activationSpec element with a message listener type that is provided by a particular resource adapter. In the following example, the MyAdapter resource adapter provides only one type of message listener:
    <activationSpec id="app1/module1/MyMessageDrivenBean">
     <properties.MyAdapter messageFilter="ALL"/>
    </activationSpec>
  4. If required, identify the available activation specification property subelement names.
    • If a resource adapter provides exactly one message listener interface, excluding any JMS connection factories, the subelement name is: properties.<rar_identifier>

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

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

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

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

  5. See the documentation on deploying message-driven beans for information about how to associate the activation specification with a message-driven bean.

Example

Use the following example to learn how to configure resource adapters with two message listener types with unique interface class names.

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

<messagelistener>
<messagelistener-type>javax.resource.cci.MessageListener</messagelistener-type>
<activationspec>
 <activationspec-class>com.vendor.adapter.CCIActivationSpec</activationspec-class>
 <config-property>
  <config-property-name>maxSize</config-property-name>
  <config-property-type>java.lang.Long</config-property-type>
 </config-property>
 ...
</activationspec>
...
</messagelistener>

<messagelistener>
<messagelistener-type>com.vendor.adapter.MyMessageListener</messagelistener-type>
<activationspec>
 <activationspec-class>com.vendor.adapter.MyActivationSpec</activationspec-class>
 <config-property> 
  <config-property-name>messageFilter</config-property-name>
  <config-property-type>java.lang.String</config-property-type>
 </config-property>
 ...
</activationspec>
...
</messagelistener>
The following is an example of a server configuration for this scenario:
<activationSpec id="app1/module1/CCIMessageDrivenBean">
 <properties.MyAdapter.MessageListener maxSize="1024"/>
</activationSpec> 

<activationSpec id="app1/module1/MyMessageDrivenBean">
 <properties.MyAdapter.MyMessageListener messageFilter="ALL"/>
</activationSpec>

Use the following example to learn how to configure resource adapters with two message listener types with unique implementation class names

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

<messagelistener>
<messagelistener-type>javax.resource.cci.MessageListener</messagelistener-type>
<activationspec> 
 <activationspec-class>com.vendor.adapter.CCIActivationSpec</activationspec-class>
 <config-property>
  <config-property-name>maxSize</config-property-name> 
  <config-property-type>java.lang.Long</config-property-type>
 </config-property> 
...
</activationspec>
...
</messagelistener>

<messagelistener>
<messagelistener-type>com.vendor.adapter.MessageListener</messagelistener-type>
<activationspec>
 <activationspec-class>com.vendor.adapter.MyActivationSpec</activationspec-class>
 <config-property>
  <config-property-name>messageFilter</config-property-name>
  <config-property-type>java.lang.String</config-property-type>
 </config-property>
...
</activationspec>
...
</messagelistener>
The following is an example of a server configuration for this scenario:
<activationSpec id="app1/module1/CCIMessageDrivenBean">
 <properties.MyAdapter.CCIActivationSpec maxSize="1024"/>
</activationSpec>

<activationSpec id="app1/module1/MyMessageDrivenBean">
 <properties.MyAdapter.MyActivationSpec messageFilter="ALL"/>
</activationSpec>

Use the following example to learn how to configure resource adapters with two message listener types 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 message listener types where neither the simple interface nor the implementation class names are unique:

<messagelistener>
<messagelistener-type>javax.resource.cci.MessageListener</messagelistener-type>
<activationspec>
 <activationspec-class>com.vendor.adapter.cci.ActivationSpec</activationspec-class>
 <config-property>
  <config-property-name>maxSize</config-property-name>
  <config-property-type>java.lang.Long</config-property-type>
 </config-property> 
...
</activationspec>
...
</messagelistener>

<messagelistener>
<messagelistener-type>com.vendor.adapter.MessageListener</messagelistener-type> 
<activationspec>
 <activationspec-class>com.vendor.adapter.ActivationSpec</activationspec-class>
 <config-property>
  <config-property-name>messageFilter</config-property-name>
  <config-property-type>java.lang.String</config-property-type>
 </config-property>
...
</activationspec>
...
</messagelistener>
The following is an example of a server configuration for this scenario:
<activationSpec id="app1/module1/CCIMessageDrivenBean">
 <properties.MyAdapter.javax.resource.cci.MessageListener maxSize="1024"/>
</activationSpec>

<activationSpec id="app1/module1/MyMessageDrivenBean">
 <properties.MyAdapter.com.vendor.adapter.MessageListener messageFilter="ALL"/>
</activationSpec>

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.