Cosminexus V9 アプリケーションサーバ リファレンス 定義編(アプリケーション/リソース定義)

[目次][索引][前へ][次へ]

4.1.12 CJMSプロバイダのリソースアダプタに設定する<config-property>タグに指定できるプロパティ

CJMSプロバイダのリソースアダプタ(CJMSPリソースアダプタ)に設定する<config-property>タグに指定できる値について説明します。

なお,CJMSPリソースアダプタのプロパティの設定では,テンプレートファイルを使用できます。テンプレートファイルについては,「4.1.14 Connector属性ファイルのテンプレートファイル」を参照してください。

<この項の構成>
(1) リソースアダプタ(<resourceadapter>)の設定
(2) ManagedConnectionFactory(<managedconnectionfactory-class>の<config-property>)の設定
(3) 管理対象オブジェクト(<adminobject>)の設定
(4) ログに関する設定

(1) リソースアダプタ(<resourceadapter>)の設定

リソースアダプタに設定できるプロパティについて説明します。

表4-12 リソースアダプタ(<resourceadapter>)に設定できるプロパティ

config-property-name config-property-type config-property-value
connectionURL java.lang.String CJMSプロバイダと接続するためのURLを指定します。
URLには,ホスト名,ポート番号およびサービス名が含まれます。
reconnectAttempts java.lang.Integer CJMSプロバイダとの接続でエラーが発生した場合のリトライ回数を,1〜2147483647の整数で指定します。デフォルト値は6です。
reconnectEnabled java.lang.Boolean CJMSプロバイダとの接続でエラーが発生した場合にリトライを実行するかどうかを,true(リトライする)またはfalse(リトライしない)で指定します。デフォルト値はfalseです。
reconnectInterval java.lang.Integer CJMSプロバイダとの接続でエラーが発生した場合のリトライ間隔(ミリ秒単位)を,0〜2147483647の整数で指定します。デフォルト値は30000です。

指定例を次に示します。

 
<resourceadapter-class>com.cosminexus.jmsprovider.messaging.jms.ra.ResourceAdapter</resourceadapter-class>
  <config-property>
      <description xml:lang="en"/>
      <config-property-name>ConnectionURL</config-property-name>
      <config-property-type>java.lang.String</config-property-type>
      <config-property-value>mq://localhost:7676/</config-property-value>
  </config-property>
    <config-property>
      <description xml:lang="en"/>
      <config-property-name>ReconnectEnabled</config-property-name>
      <config-property-type>java.lang.Boolean</config-property-type>
      <config-property-value>false</config-property-value>
    </config-property>
    <config-property>
      <description xml:lang="en"/>
      <config-property-name>ReconnectAttempts</config-property-name>
      <config-property-type>java.lang.Integer</config-property-type>
      <config-property-value>6</config-property-value>
    </config-property>
   <config-property>
      <description xml:lang="en"/>
      <config-property-name>ReconnectInterval</config-property-name>
      <config-property-type>java.lang.Integer</config-property-type>
      <config-property-value>30000</config-property-value>
   </config-property>
 
注意
リソースアダプタのプロパティの設定で,キューまたはトピックごとの管理対象オブジェクト(AdminObject)の値を編集しないでリソースアダプタを開始しようとすると,例外がスローされます。この例外は,J2EEサーバのログディレクトリ下のcjexceptionN.log(Nはログファイルの面数)に出力されます。

(2) ManagedConnectionFactory(<managedconnectionfactory-class>の<config-property>)の設定

ManagedConnectionFactory(<managedconnectionfactory-class>の<config-property>)に設定できるプロパティについて説明します。

表4-13 ManagedConnectionFactory(<managedconnectionfactory-class>の<config-property>)に設定できるプロパティ

config-property-name config-property-type config-property-value
clientId java.lang.String CJMSプロバイダと接続するためのクライアントのIDを指定します。
reconnectAttempts java.lang.Integer CJMSプロバイダとの接続でエラーが発生した場合のリトライ回数を,1〜2147483647の整数で指定します。デフォルト値は6です。
reconnectEnabled java.lang.Boolean CJMSプロバイダとの接続でエラーが発生した場合にリトライを実行するかどうかを,true(リトライする)またはfalse(リトライしない)で指定します。デフォルト値はfalseです。
reconnectInterval java.lang.Integer CJMSプロバイダとの接続でエラーが発生した場合のリトライ間隔(ミリ秒単位)を,1〜2147483647の整数で指定します。デフォルト値は30000です。

指定例を次に示します。なお,clientIdはデフォルトの状態では設定されていません。必要に応じて,太字の部分を追加してください。

 
<managedconnectionfactory-class>com.cosminexus.jmsprovider.messaging.jms.ra.ManagedConnectionFactory</managedconnectionfactory-class>
  <config-property>
     <description xml:lang="en"/>
     <config-property-name>ReconnectEnabled</config-property-name>
     <config-property-type>java.lang.Boolean</config-property-type>
     <config-property-value>false</config-property-value>
  </config-property>
  <config-property>
     <description xml:lang="en"/>
     <config-property-name>ReconnectAttempts</config-property-name>
     <config-property-type>java.lang.Integer</config-property-type>
     <config-property-value>6</config-property-value>
  </config-property>
   <config-property>
     <description xml:lang="en"/>
     <config-property-name>ReconnectInterval</config-property-name>
     <config-property-type>java.lang.Integer</config-property-type>
     <config-property-value>30000</config-property-value>
   </config-property>
  <config-property>
     <config-property-name>ClientId</config-property-name>
     <config-property-type>java.lang.String</config-property-type>
     <config-property-value>Test</config-property-value>
  </config-property>
 

(3) 管理対象オブジェクト(<adminobject>)の設定

管理対象オブジェクト(<adminobject>の<config-property>)に設定できるプロパティについて説明します。

表4-14 管理対象オブジェクト(<adminobject>の<config-property>)に設定できるプロパティ

config-property-name config-property-type config-property-value
Description java.lang.String 付加情報を指定するプロパティです。必要な説明を指定してください。空白も指定できます。
Name java.lang.String <adminobject>タグ下に指定した送信先を作成する際に使用する,送信先の名前を指定します。送信先は,このプロパティに指定した名前で作成されます。

管理対象オブジェクトの設定のタグ情報を次に示します。この例は,キューを作成する例です。トピックを作成する場合は,送信先の種類を変更してください。

 
<adminobject>
  <adminobject-name>TestQueue</adminobject-name>
  <adminobject-interface>javax.jms.Queue</adminobject-interface>
  <adminobject-class>com.cosminexus.jmsprovider.messaging.Queue</adminobject-class>
  <config-property>
    <description xml:lang="en"></description>
    <config-property-name>Name</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value>TestQueue</config-property-value>
  </config-property>
  <config-property>
    <description xml:lang="en"></description>
    <config-property-name>Description</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value></config-property-value>
  </config-property>
</adminobject>
 

(4) ログに関する設定

ログについて設定するプロパティについて説明します。

表4-15 ログについて設定するプロパティ

config-property-name config-property-type config-property-value
ExpLogFileNum java.lang.Integer 例外ログを出力するログファイルの最大数を指定します。1〜16の整数で指定します。デフォルト値は2です。
ExpLogFileSize java.lang.Integer 例外ログを出力するログファイルの最大サイズをバイトで指定します。8192〜4194304の整数で指定します。デフォルト値は1048576です。
指定したサイズに到達すると,新しいファイルが作成され,ログの出力先が作成したファイルに切り替わります。
MsgLogFileNum java.lang.Integer メッセージログを出力するログファイルの最大数を指定します。1〜16の整数で指定します。デフォルト値は2です。
MsgLogFileSize java.lang.Integer メッセージログを出力するログファイルの最大サイズをバイトで指定します。8192〜4194304の整数で指定します。デフォルト値は1048576です。
指定したサイズに到達すると,新しいファイルが作成され,ログの出力先が作成したファイルに切り替わります。
MsgLogLevel java.lang.String ログのレベルを指定します。
指定したレベルに基づいた情報がログファイルに出力されます。
次のどれかの値を指定できます。
  • ERROR
  • WARNING
  • INFO
デフォルトはERRORです。
注意
  • CJMSPリソースアダプタのログファイルは,<ejb.server.log.directory>ディレクトリ下のcjmsディレクトリに出力されます。cjmsディレクトリがない場合は,<ejb.server.log.directory>ディレクトリ下にcjmsディレクトリが作成され,ログが出力されます。
  • リソースアダプタのプロパティの検証は,J2EEサーバとCJMSPリソースアダプタの両方で実施されます。J2EEサーバによるプロパティの検証で問題があった場合,J2EEサーバのログファイルにエラーメッセージが出力され,処理が停止します。CJMSPリソースアダプタによるプロパティの検証で問題があった場合,CJMSPリソースアダプタのログファイルに警告メッセージが出力されますが,プロパティの値をデフォルト値として処理は続行されます。