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 つ以上の管理対象オブジェクトを構成します。 管理対象オブジェクトのインスタンスを構成する場合、どの構成プロパティーもオーバーライドしたくない場合でも、adminObject エレメントを、特定のリソース・アダプターによって提供されている管理対象オブジェクト・タイプに関連付けるために、properties サブエレメントを提供する必要があります。以下の例で、MyAdapter リソース・アダプターは 1 つのタイプの管理対象オブジェクトのみを提供します。
    <adminObject jndiName="eis/interactionSpec">
     <properties.MyAdapter functionName="find" executionTimeout="5000"/>
    </adminObject>
  4. (オプション) 必要な場合、使用可能な管理対象オブジェクト・プロパティー・サブエレメント名を識別します。
    • リソース・アダプターが、JMS 宛先、キュー、およびトピックをすべて除き、厳密に 1 つの管理対象オブジェクト・インターフェースを提供する場合、サブエレメント名は properties.<rar_identifier> になります。

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

    • パッケージ名を除いて実装名が固有の場合、サブエレメント名は properties.<rar_identifier>.<ImplementationName> になります。

    • パッケージ名を除いたインターフェース名と実装名の組み合わせが固有の場合、サブエレメントは properties.<rar_identifier>.<InterfaceName>-<ImplementationName> になります。

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

固有のインターフェース・クラス名を持つ 2 つの管理対象オブジェクトを含むリソース・アダプターの構成方法については、以下の例を使用してください。

ra.xml ファイルからの以下のスニペットで、MyAdapter リソース・アダプターは、固有のインターフェース・クラス名を持つ 2 つの管理対象オブジェクトを提供します。

<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>
以下に、このシナリオのサーバー構成の例を示します。
<adminObject jndiName="eis/connectionSpec">
 <properties.MyAdapter.ConnectionSpec isolationLevel="4"/>
</adminObject>

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

固有の実装クラス名を持つ 2 つの管理対象オブジェクトを含むリソース・アダプターの構成方法については、以下の例を使用してください。

ra.xml ファイルからの以下のスニペットで、MyAdapter リソース・アダプターは、固有の実装クラス名を持つ 2 つの管理対象オブジェクトを提供します。

<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>
以下に、このシナリオのサーバー構成の例を示します。
<adminObject jndiName="eis/finder">
 <properties.MyAdapter.FinderInteractionSpec resultSetType="1003"/>
</adminObject>

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

シンプル・インターフェース・クラス名または実装クラス名のいずれも固有でない 2 つの管理対象オブジェクトを持つリソース・アダプターの構成方法については、以下の例を使用してください。

ra.xml ファイルからの以下のスニペットで、MyAdapter リソース・アダプターは、シンプル・インターフェース・クラス名または実装クラス名のいずれも固有でない 2 つの管理対象オブジェクトを提供します。

<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>
以下に、このシナリオのサーバー構成の例を示します。
<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>

構成エレメント名のサフィックスはオーバーライドできます。構成エレメント名のサフィックスのオーバーライド方法については、JCA 構成エレメントのカスタマイズに関する情報を参照してください。


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



タイム・スタンプ・アイコン 最終更新: Tuesday, 6 December 2016
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=twlp_jca_config_admobj
ファイル名: twlp_jca_config_admobj.html