JCA アクティベーション・スペックの構成
Java EE Connector Architecture (JCA) 仕様に準拠するアクティベーション・スペックを構成することができます。
このタスクについて
注: Liberty の JCA サポートを構成するには、WebSphere® Application Server Developer Tools for Eclipse のサーバー構成エディターの「ソース」ビュー、または他のテキスト・エディターを使用して server.xml ファイルを編集する必要があります。このトピックでは、MyAdapter という固有 ID を持つリソース・アダプターが既にサーバーに構成されていると想定しています。詳細については、リソース・アダプターの構成に関する資料を参照してください。以下のステップでは、基本シナリオの構成のエンドツーエンド・サンプルを提供します。
注: WebSphere® Development Tools (WDT) の「設計」ビューで接続ファクトリー、管理オブジェクト、アクティベーション・スペック、およびリソース・アダプターのサーバー構成のプロパティー・サブエレメントを編集することはサポートされていません。
手順
例
固有のインターフェース・クラス名を持つ 2 つのメッセージ・リスナーを含むリソース・アダプターの構成方法については、以下の例を使用しください。
ra.xml ファイルからの以下のスニペットで、MyAdapter リソース・アダプターは、固有のインターフェース・クラス名を持つ 2 つのメッセージ・リスナー・タイプを提供します。
<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>
以下に、このシナリオのサーバー構成の例を示します。<activationSpec id="app1/module1/CCIMessageDrivenBean">
<properties.MyAdapter.MessageListener maxSize="1024"/>
</activationSpec>
<activationSpec id="app1/module1/MyMessageDrivenBean">
<properties.MyAdapter.MyMessageListener messageFilter="ALL"/>
</activationSpec>
固有の実装クラス名を持つ 2 つのメッセージ・リスナー・タイプを含むリソース・アダプターの構成方法については、以下の例を使用しください。
ra.xml ファイルからの以下のスニペットで、MyAdapter リソース・アダプターは、固有の実装クラス名を持つ 2 つのメッセージ・リスナー・タイプを提供します。
<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>
以下に、このシナリオのサーバー構成の例を示します。<activationSpec id="app1/module1/CCIMessageDrivenBean">
<properties.MyAdapter.CCIActivationSpec maxSize="1024"/>
</activationSpec>
<activationSpec id="app1/module1/MyMessageDrivenBean">
<properties.MyAdapter.MyActivationSpec messageFilter="ALL"/>
</activationSpec>
シンプル・インターフェース・クラス名または実装クラス名のいずれも固有でない 2 つのメッセージ・リスナーを持つリソース・アダプターの構成方法については、以下の例を使用しください。
ra.xml ファイルからの以下のスニペットで、MyAdapter リソース・アダプターは、シンプル・インターフェース・クラス名または実装クラス名のいずれも固有でない 2 つのメッセージ・リスナー・タイプを提供します。
<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>
以下に、このシナリオのサーバー構成の例を示します。<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>
構成エレメント名のサフィックスはオーバーライドできます。構成エレメント名のサフィックスのオーバーライド方法については、JCA 構成エレメントのカスタマイズに関する情報を参照してください。