Configuring JCA activation specifications
You can configure activation specifications that comply with the Java EE Connector Architecture (JCA) specification.
About this task
Procedure
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.