[8.5.5.2 以降]Liberty リポジトリー

JCA アクティベーション・スペックの構成

Java™ EE Connector Architecture (JCA) 仕様に準拠するアクティベーション・スペックを構成することができます。

このタスクについて

インストールされているリソース・アダプターによって提供されているアクティベーション・スペックの 1 つ以上のインスタンスを構成することができます。
注: Liberty プロファイルの JCA サポートを構成するには、WebSphere® Application Server Developer Tools for Eclipse のサーバー構成エディターの「ソース」ビュー、または他のテキスト・エディターを使用して server.xml ファイルを編集する必要があります。このトピックでは、MyAdapter という固有 ID を持つリソース・アダプターが既にサーバーに構成されていると想定しています。詳細については、リソース・アダプターの構成に関する資料を参照してください。以下のステップでは、基本シナリオの構成のエンドツーエンド・サンプルを提供します。
注: WebSphere® Development Tools (WDT) の「設計」ビューで接続ファクトリー、管理オブジェクト、アクティベーション・スペック、およびリソース・アダプターのサーバー構成のプロパティー・サブエレメントを編集することはサポートされていません。

手順

  1. server.xml ファイルを更新して、featureManager タグの下に jca-1.6 フィーチャーを追加します。
    <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. リソース・アダプターをインストールします。 例えば、以下のように server.xml ファイルを更新します。
    <resourceAdapter location="C:/adapters/MyAdapter.rar"/>
  3. 1 つ以上のアクティベーション・スペックを構成します。 アクティベーション・スペックを構成する場合、どの構成プロパティーもオーバーライドしたくない場合でも、activationSpec エレメントを、特定のリソース・アダプターによって提供されているメッセージ・リスナー・タイプに関連付けるために、properties サブエレメントを提供する必要があります。以下の例で、MyAdapter リソース・アダプターは 1 つのタイプのメッセージ・リスナーのみを提供します。
    <activationSpec id="app1/module1/MyMessageDrivenBean">
     <properties.MyAdapter messageFilter="ALL"/>
    </activationSpec>
  4. 必要な場合、使用可能なアクティベーション・スペック・プロパティー・サブエレメント名を識別します。
    • リソース・アダプターが、すべての JMS 接続ファクトリーを除き、厳密に 1 つのメッセージ・リスナー・インターフェースを提供している場合、サブエレメント名は properties.<rar_identifier> になります。

    • パッケージ名を除いてメッセージ・リスナー・インターフェース名が固有の場合、サブエレメント名は properties.<rar_identifier>.<MessageListenerInterfaceName> になります。

    • パッケージ名を除いてアクティベーション・スペックの実装名が固有の場合、サブエレメント名は properties.<rar_identifier>.<ActivationSpecificationImplementationName> になります。

    • パッケージ名を除いてアクティベーション・スペックの実装名が固有の場合、サブエレメント名は properties.<rar_identifier>.<ActivationSpecificationImplementationName> になります。

    • 他のケースでは、サブエレメント名は properties.<rar_identifier>.<fully.qualified.MessageListenterInterfaceName> になります。

  5. アクティベーション・スペックとメッセージ駆動型 Bean を関連付ける方法について詳しくは、メッセージ駆動型 Bean のデプロイにある資料を参照してください。

固有のインターフェース・クラス名を持つ 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 構成エレメントのカスタマイズに関する情報を参照してください。


トピックのタイプを示すアイコン タスク・トピック

インフォメーション・センターに関するご使用条件 | フィードバック


タイム・スタンプ・アイコン 最終更新: 2015 年 6 月 17日
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=phil&product=was-libcore-mp&topic=twlp_jca_config_actspec
ファイル名: twlp_jca_config_actspec.html