JCA 構成エレメントのカスタマイズ

リソース・アダプターをインストールする際の JCA プロパティー・サブエレメントの生成方法をカスタマイズすることができます。

このタスクについて

スタンドアロン・リソース・アダプター、またはアプリケーションに組み込まれているリソース・アダプターをインストールする際に、1 つ以上の <customize> サブエレメントを <resourceAdapter> の下に追加して、指定されたインターフェース・クラスまたは実装クラスのプロパティー・サブエレメントに使用されるサフィックスを選択することができます。構成エレメントに固有の名前をつけるために長いプロパティー・サブエレメント名が必要になる場合がありますが、サブエレメントをカスタマイズすることにより、それを回避することができます。
注:

Liberty の JCA サポートを追加するには、WebSphere® Application Server Developer Tools for Eclipse のサーバー構成エディターの「ソース」ビュー、または他のテキスト・エディターを使用して server.xml ファイルを編集する必要があります。「設計」ビューで接続ファクトリー、管理オブジェクト、アクティベーション・スペック、およびリソース・アダプターの構成の一部を編集することは、ベータ版ではサポートされていません。

手順

  1. スタンドアロン・リソース・アダプターの場合、カスタマイズしたい既存の構成から開始します。 例えば、リソース・アダプター MyAdapter が、シンプル・インターフェース・クラス名も実装クラス名も固有でない、2 つの接続ファクトリーを提供する場合、次のようになります。
    <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><resourceAdapter location="C:/adapters/MyAdapter.rar"/>
    
    <connectionFactory jndiName="eis/cci-cf">
     <properties.MyAdapter.javax.resource.cci.ConnectionFactory serverName="localhost"/>
    </connectionFactory> 
    
    <connectionFactory jndiName="eis/custom-cf">
     <properties.MyAdapter.com.vendor.adapter.custom.ConnectionFactory hostName="localhost"/>
    </connectionFactory>
  2. customize サブエレメントを resourceAdapter に追加して、両方の接続ファクトリー・インターフェースのサフィックスを選択します。
    <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>
    <resourceAdapter location="C:/adapters/MyAdapter.rar">
     <customize interface="javax.resource.cci.ConnectionFactory" suffix="cci"/>
     <customize interface="com.vendor.adapter.custom.ConnectionFactory" suffix="custom"/>
    </resourceAdapter>
    
    <connectionFactory jndiName="eis/cci-cf">
     <properties.MyAdapter.cci serverName="localhost"/>
    </connectionFactory> 
    
    <connectionFactory jndiName="eis/custom-cf">
     <properties.MyAdapter.custom hostName="localhost"/>
    </connectionFactory>
  3. アプリケーションに組み込まれているリソース・アダプターの場合、カスタマイズしたい既存の構成から開始します。 例えば、次のように、MyAdapter という名前の組み込みリソース・アダプターを持つ app1 があると想定します。
    <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>
    <application name="app1" type="ear" location="C:/applications/app1.ear"/>
    
    <adminObject jndiName="eis/interactionSpec-find">
     <properties.app1.MyAdapter.javax.resource.cci.InteractionSpec-com.vendor.adapter.finder.InteractionSpecImpl resultSetType="1003"/>
    </adminObject>
    
    <adminObject jndiName="eis/interactionSpec-update">
     <properties.app1.MyAdapter.com.vendor.adapter.InteractionSpec-com.vendor.adapter.updater.InteractionSpecImpl executionTimeout="3000"/> 
    </adminObject>
  4. リソース・アダプター・アーカイブ (RAR) モジュールの resourceAdapter エレメントをアプリケーション内に指定します。RAR モジュールのモジュール名になる ID 属性を指定します。customize サブエレメントを追加して、インターフェース・クラスまたは実装クラスに基づいた、両方の管理対象オブジェクトのサフィックスを選択します。 この例では実装クラスのみが指定されます。管理対象オブジェクトを識別するにはそれで十分です。
    <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>
    <application name="app1" type="ear" location="C:/applications/app1.ear">
     <resourceAdapter id="MyAdapter">
      <customize implementation="com.vendor.adapter.finder.InteractionSpecImpl" suffix="finder"/>
      <customize implementation="com.vendor.adapter.updater.InteractionSpecImpl" suffix="updater"/>
     </resourceAdapter>
    </application>
    
    <adminObject jndiName="eis/interactionSpec-find">
     <properties.app1.MyAdapter.finder resultSetType="1003"/>
    </adminObject>
    
    <adminObject jndiName="eis/interactionSpec-update">
     <properties.app1.MyAdapter.updater executionTimeout="3000"/>
    </adminObject>

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

ファイル名: twlp_jca_config_custelements.html