ヘッダーをスキップ
Oracle® Complex Event Processing開発者ガイド
11g リリース1 (11.1.1.4.0) for Eclipse
B61654-02
  目次へ移動
目次
索引へ移動
索引

前
 
次
 

G スキーマ参照: メッセージ・カタログmsgcat.dtd

この付録では、msgcat.dtdスキーマの要素について説明します。

詳細については、次を参照してください。

G.1 メッセージ・カタログ要素の概要

Oracle CEPでは、ローカライズ可能なログ・メッセージの定義に使用する、多数のメッセージ・カタログ要素が提供されます。

G.1.1 要素の階層

最上位Oracle CEPメッセージ・カタログ要素は、メッセージのカタログ・タイプに応じて次の階層に構成されます。

例G-1 ログ・メッセージ・カタログの階層

message_catalog
    log_message
        messagebody
        messagedetail
        cause
        action

例G-2 シンプル・テキスト・カタログの階層

message_catalog
    message
        messagebody

G.1.2

この項では、次のメッセージ・カタログの例を示します。

例G-3 ログ・メッセージ・カタログ

<?xml version="1.0"?>
<!DOCTYPE message_catalog PUBLIC "weblogic-message-catalog-dtd" 
"http://www.bea.com/servers/wls90/dtd/msgcat.dtd">
<message_catalog 
  l10n_package="programs.utils"
  i18n_package="programs.utils"
  subsystem="MYUTIL"
  version="1.0"
  baseid="600000"
  endid="600100">
  <logmessage
    messageid="600001"
    severity="warning"
    method="logNoAuthorization(String arg0, java.util.Date arg1,int arg2)">
    <messagebody>
      Could not open file, {0} on {1,date} after {2,number} attempts.
    </messagebody>
    <messagedetail>
      The configuration for this application will be defaulted to
      factory settings. Custom configuration information resides
      in file, {0}, created on {1,date}, but is not readable.
    </messagedetail>
    <cause>
      The user is not authorized to use custom configurations. Custom
     configuration information resides in file, {0}, created on
     {1,date}, but is not readable.The attempt has been logged to
     the security log.
    </cause>
    <action>
      The user needs to gain approriate authorization or learn to
      live with the default settings.
    </action>
  </logmessage>
</message_catalog>

例G-4 シンプル・テキスト・カタログ

<?xml version="1.0"?> 
<!DOCTYPE message_catalog PUBLIC "weblogic-message-catalog-dtd"
    "http://www.bea.com/servers/wls90/dtd/msgcat.dtd"> 
<message_catalog>
  l10n_package="programs.utils"
  i18n_package="programs.utils"
  subsystem="MYUTIL"
  version="1.0">
  <message messageid="FileMenuTitle">
    <messagebody>
      File
    </messagebody>
  </message>
</message_catalog>

G.2 message_catalog

この要素はログ・メッセージ・カタログを表します。

G.2.1 子要素

message_catalog要素は、次の子要素をサポートしています。

G.2.2 属性

表G-1では、message_catalog要素の属性を示します。

表G-1 message_catalog要素の属性

属性 説明 データ型 必須?

i18n_package

このカタログのLoggerクラスを含むJavaパッケージ。クラスの名前はカタログ・ファイルの名前に基づいて付けられます。たとえば、カタログの名前がmycat.xmlの場合、生成される Loggerクラスの名前はi18n_package.mycatLogger.classになります。

構文: 標準のJavaパッケージ構文。

例: i18n_package="programs.utils"

デフォルト: weblogic.i18n

String

いいえ。

I10n_package

カタログ用に生成したLogLocalizerプロパティを含むJavaパッケージ。たとえば、カタログの名前がmycat.xmlの場合、次のプロパティ・ファイルが生成されます。

  • l10n_package.mycatLogLocalizer.properties

  • l10n_packagemycatLogLocalizerDetail.properties

構文: 標準のJavaパッケージ構文。

例: l10n_package="programs.utils"

デフォルト: weblogic.i18n

String

いいえ。

subsystem

このカタログと関連付けられているサブシステムを識別する頭字語。サブシステムの名前はサーバー・ログに含まれ、メッセージの分離を目的として使用されます。

例: subsystem="MYUTIL"

String

はい。

version

使用されるmsgcat.dtdのバージョンを指定します。

使用方法: 「1.0」である必要があります。

構文: x.y - ここで、xおよびyは数値です。

例: version="1.0"

String

はい。

baseid

このカタログで使用される最低のメッセージIDを指定します。構文: 1から6桁。例: baseid="600000"

有効な値:

  • 000000はOracle CEPサーバー・カタログ

  • 500000 :ユーザー定義のカタログ

String

いいえ。

endid

このカタログで使用される最高のメッセージIDを指定します。

構文: 1桁から6桁の数値。

例: endid="600100"

有効な値:

  • 499999はOracle CEPサーバー・カタログ

  • 999999 :ユーザー定義のカタログ

String

いいえ。

loggables

Loggableオブジェクトを返す追加メソッドを生成するかどうかを示します。

例: loggable="true"

有効な値:

  • true

  • false

デフォルト: false

String


prefix

ログに記録されるときにメッセージIDの先頭に追加するStringを指定します。Oracle CEPサーバー・メッセージは、プレフィックスのデフォルトは「CEP」で、別のプレフィックスを指定することはできません。ユーザー・メッセージは、任意のプレフィックスを指定することが可能です。プレフィックスが付いたメッセージIDは、ログ・エントリで次のように表示されます。

<[prefix-]id>

ここで、prefixはこの属性であり、idは特定のメッセージに関連付けられた6桁のメッセージIDです。

たとえば、プレフィックスが"XYZ"の場合、メッセージ987654はログ・エントリでは <XYZ-987654>として表示されます。prefixが定義されていない場合、ログ・エントリは<987654>となります。

構文: 任意のString (5文字まで)

例: prefix="CEP"

有効な値:

  • "CEP"はOracle CEPサーバー・カタログ

  • nullはユーザー定義カタログ

String

いいえ。

description

カタログの内容を説明する省略可能な属性。

例: description="Contains messages logged by the foobar application"

String

いいえ。


G.2.3

次の例は、ログ・メッセージ・カタログ・ファイル内のmessage_catalog要素の使用方法を示します。

<?xml version="1.0"?>
<!DOCTYPE message_catalog PUBLIC "weblogic-message-catalog-dtd" 
"http://www.bea.com/servers/wls90/dtd/msgcat.dtd">
<message_catalog 
  l10n_package="programs.utils"
  i18n_package="programs.utils"
  subsystem="MYUTIL"
  version="1.0"
  baseid="600000"
  endid="600100">
  <logmessage
    messageid="600001"
    severity="warning"
    method="logNoAuthorization(String arg0, java.util.Date arg1,int arg2)">
    <messagebody>
      Could not open file, {0} on {1,date} after {2,number} attempts.
    </messagebody>
    <messagedetail>
      The configuration for this application will be defaulted to
      factory settings. Custom configuration information resides
      in file, {0}, created on {1,date}, but is not readable.
    </messagedetail>
    <cause>
      The user is not authorized to use custom configurations. Custom
     configuration information resides in file, {0}, created on
     {1,date}, but is not readable.The attempt has been logged to
     the security log.
    </cause>
    <action>
      The user needs to gain approriate authorization or learn to
      live with the default settings.
    </action>
  </logmessage>
</message_catalog>

G.3 logmessage

この要素を使用して正式なログ・メッセージを定義します。

G.3.1 子要素

logmessageコンポーネント構成要素では、次の子要素をサポートしています。

G.3.2 属性

表G-6ではlogmessageコンポーネント構成要素の属性が一覧表示されています。

表G-2 logmessage要素の属性

属性 説明 データ型 必須?

messageid

このログ・メッセージのユニークな識別子。識別子は、すべてのカタログにわたりユニークである必要があります。値は、baseid属性とendid属性で定義された範囲で指定する必要があります。

使用方法: 値は、message_catalog要素に定義されているbaseidおよびendid属性で定義された範囲内である必要があります。

構文: 1桁から6桁の数値。

例: messageid="600001"

String

はい。

datelastchanged

このメッセージの修正管理に使用される日付と時刻のスタンプ。日付は、カタログで動作するユーティリティによって提供されます。

使用方法: 日付はカタログで動作するユーティリティによって提供されます。

構文: Long.toString(new Date().getTime());

String

いいえ。

severity

ログ・メッセージの重大度を示します。ユーザー定義カタログでは、debuginfowarningおよびerrorのみを使用します。

有効な値:

  • error

  • warning

  • info

  • debug

例: severity="warning"

String

はい。

method

このメッセージをログに記録するためのメソッド・シグネチャ。

構文は標準のJavaメソッド・シグネチャから修飾子、セミコロン、および拡張子を除いたもの。引数の型にはJavaプリミティブまたはJavaクラスを使用できます。クラスはjava.langにない場合は完全修飾である必要があります。また、クラスはjava.text.MessageFormatの規約に準拠している必要があります。たいていの場合、クラス引数は便利なtoString()メソッドを備えています。

引数には有効であればどのような名前でも指定できますが、argn (nは0から9) の規則に従っている必要があります。指定できる引数は10個までです。各argnについて、G.3.1項「子要素」で説明されているテキスト要素に少なくとも1つの対応するプレースホルダーが存在している必要があります。プレースホルダーの形式は{n}{n,number}または{n,date}です。

String

はい。

methodtype

生成するメソッドのタイプを指定します。メソッドは次のとおりです。

  • メッセージ本文をデフォルトのロケールにフォーマットし、結果をログに記録するloggerメソッド。

  • subsystemおよびmessageidのプレフィクスの付いたメッセージ本文を[susbsystem:msgid]textのように戻すgetterメソッド。

有効な値:

  • logger

  • getter

デフォルト: logger

String

いいえ。

stacktrace

Throwableの引数としてスタック・トレースを生成するかどうかを示します。値がtrueの場合はトレースが生成されます。

有効な値:

  • true

  • false

デフォルト: true

String

いいえ。

retired

メッセージが廃止されているかどうかを示します。廃止されたメッセージとは、前のリリースで使用されていたが、今は古くなり、現在のバージョンでは使用されないメッセージ。廃止されたメッセージは、クラスまたはリソースの生成で使用しません。

有効な値:

  • true

  • false

デフォルト: false

String

いいえ。


G.3.3

次の例は、ログ・メッセージ・カタログ・ファイル内のlogmessage要素の使用方法を示します。

<?xml version="1.0"?>
<!DOCTYPE message_catalog PUBLIC "weblogic-message-catalog-dtd" 
"http://www.bea.com/servers/wls90/dtd/msgcat.dtd">
<message_catalog 
  l10n_package="programs.utils"
  i18n_package="programs.utils"
  subsystem="MYUTIL"
  version="1.0"
  baseid="600000"
  endid="600100">
  <logmessage
    messageid="600001"
    severity="warning"
    method="logNoAuthorization(String arg0, java.util.Date arg1,int arg2)">
    <messagebody>
      Could not open file, {0} on {1,date} after {2,number} attempts.
    </messagebody>
    <messagedetail>
      The configuration for this application will be defaulted to
      factory settings. Custom configuration information resides
      in file, {0}, created on {1,date}, but is not readable.
    </messagedetail>
    <cause>
      The user is not authorized to use custom configurations. Custom
     configuration information resides in file, {0}, created on
     {1,date}, but is not readable.The attempt has been logged to
     the security log.
    </cause>
    <action>
      The user needs to gain approriate authorization or learn to
      live with the default settings.
    </action>
  </logmessage>
</message_catalog>

G.4 message

この要素を使用して非公式のログ・メッセージを定義します。

G.4.1 子要素

message要素は、次の子要素をサポートしています。

G.4.2 属性

表G-3では、message要素の属性を示します。

表G-3 message要素の属性

属性 説明 データ型 必須?

messageid

このログ・メッセージの、英数字文字列での一意の識別子。このカタログでのみ、一意である必要があります。

String

はい。

datelastchanged

このメッセージの修正管理に使用される日付と時刻のスタンプ。日付は、カタログで動作するユーティリティによって提供されます。

使用方法: 日付はカタログで動作するユーティリティによって提供されます。

構文: Long.toString(new Date().getTime());

String

いいえ。

method

このメッセージをフォーマットするためのメソッド・シグネチャ。

構文は標準のJavaメソッド・シグネチャから戻り値の型、修飾子、セミコロン、および拡張子を除いたものです。戻り値の型は常にStringです。引数の型にはJavaプリミティブまたはJavaクラスを使用できます。クラスはjava.langにない場合は完全修飾である必要があります。また、クラスはjava.text.MessageFormatの規約に準拠している必要があります。たいていのクラス引数は便利なtoString()メソッドを備えており、対応するMessageFormatプレースホルダーは文字列である(つまり{n}の形式)である必要があります。引数には有効であればどのような名前でも指定できます。指定できる引数は10個までです。

各引数について、次に説明するmessagebody要素に少なくとも1つの対応するプレースホルダーが存在する必要があります。プレースホルダーの形式は{n}{n,number}または{n,date}です。

例: method="getNoAuthorization(String filename, java.util.Date creDate)"

この例は、次のようにTextFormatterクラスのメソッドになります。

public String getNoAuthorization(String filename, java.util.Date creDate)

String

いいえ。

retired

メッセージが廃止されているかどうかを示します。廃止されたメッセージとは、前のリリースで使用されていたが、今は古くなり、現在のバージョンでは使用されないメッセージ。廃止されたメッセージは、クラスまたはリソースの生成で使用しません。

有効な値:

  • true

  • false

デフォルト: false

String

いいえ。


G.4.3

次の例は、ログ・メッセージ・カタログ・ファイル内のmessage要素の使用方法を示します。

<?xml version="1.0"?> 
<!DOCTYPE message_catalog PUBLIC "weblogic-message-catalog-dtd"
    "http://www.bea.com/servers/wls90/dtd/msgcat.dtd"> 
<message_catalog>
  l10n_package="programs.utils"
  i18n_package="programs.utils"
  subsystem="MYUTIL"
  version="1.0">
  <message messageid="FileMenuTitle">
    <messagebody>
      File
    </messagebody>
  </message>
</message_catalog>

G.5 messagebody

この要素を使用して、このメッセージの簡略説明を定義します。

messagebody要素では、0から10のプレースホルダー{n}を使用できます。プレースホルダーは、ログ・メッセージがローカライズされるときに適切な引数で置き換えられます。

最後の引数がThrowableまたはサブクラスでない場合、メッセージ本文には、対応するメソッド属性にリストされたすべての引数に対するプレースホルダーを含める必要があります。

一重引用符は、java.text.MessageFormatによって特別に解析されるため、使用は慎重に行います。メッセージ引数に引用符を付けた方がよい場合は、(G.5.3項「例」のように)二重引用符を使用します。メッセージが1つ以上のプレースホルダーを持つ場合、一重引用符が正しく表示されるようにするには(たとえば、アポストロフィとして)、もう1つ一重引用符を付ける必要があります。

構文: String

G.5.1 子要素

messagebody要素には子要素はありません。

G.5.2 属性

messagebody要素には属性はありません。

G.5.3

次の例は、ログ・メッセージ・カタログ・ファイル内のmessagebody要素の使用方法を説明します。

<?xml version="1.0"?>
<!DOCTYPE message_catalog PUBLIC "weblogic-message-catalog-dtd" 
"http://www.bea.com/servers/wls90/dtd/msgcat.dtd">
<message_catalog 
  l10n_package="programs.utils"
  i18n_package="programs.utils"
  subsystem="MYUTIL"
  version="1.0"
  baseid="600000"
  endid="600100">
  <logmessage
    messageid="600001"
    severity="warning"
    method="logNoAuthorization(String arg0, java.util.Date arg1,int arg2)">
    <messagebody>
      Could not open file, "{0}" on {1,date} after {2,number} attempts.
    </messagebody>
    <messagedetail>
      The configuration for this application will be defaulted to
      factory settings. Custom configuration information resides
      in file, {0}, created on {1,date}, but is not readable.
    </messagedetail>
    <cause>
      The user is not authorized to use custom configurations. Custom
     configuration information resides in file, {0}, created on
     {1,date}, but is not readable.The attempt has been logged to
     the security log.
    </cause>
    <action>
      The user needs to gain approriate authorization or learn to
      live with the default settings.
    </action>
  </logmessage>
</message_catalog>

G.6 messagedetail

この要素を使用して、イベントの詳しい説明を定義します。この要素には、任意のプレースホルダーを含めることができます。

構文: String

G.6.1 子要素

messagedetail要素は子要素をサポートしていません。

G.6.2 属性

messagedetail要素には属性はありません。

G.6.3

次の例は、ログ・メッセージ・カタログ・ファイル内のmessagedetail要素の使用方法を説明します。

<?xml version="1.0"?>
<!DOCTYPE message_catalog PUBLIC "weblogic-message-catalog-dtd" 
"http://www.bea.com/servers/wls90/dtd/msgcat.dtd">
<message_catalog 
  l10n_package="programs.utils"
  i18n_package="programs.utils"
  subsystem="MYUTIL"
  version="1.0"
  baseid="600000"
  endid="600100">
  <logmessage
    messageid="600001"
    severity="warning"
    method="logNoAuthorization(String arg0, java.util.Date arg1,int arg2)">
    <messagebody>
      Could not open file, {0} on {1,date} after {2,number} attempts.
    </messagebody>
    <messagedetail>
      The configuration for this application will be defaulted to
      factory settings. Custom configuration information resides
      in file, {0}, created on {1,date}, but is not readable.
    </messagedetail>
    <cause>
      The user is not authorized to use custom configurations. Custom
     configuration information resides in file, {0}, created on
     {1,date}, but is not readable.The attempt has been logged to
     the security log.
    </cause>
    <action>
      The user needs to gain approriate authorization or learn to
      live with the default settings.
    </action>
  </logmessage>
</message_catalog>

G.7 cause

この要素を使用して、イベントの主な原因を定義します。この要素には、任意のプレースホルダーを含めることができます。

構文: String

G.7.1 子要素

cause要素は子要素をサポートしていません。

G.7.2 属性

cause要素には属性はありません。

G.7.3

次の例は、ログ・メッセージ・カタログ・ファイル内のcause要素の使用方法を説明します。

<?xml version="1.0"?>
<!DOCTYPE message_catalog PUBLIC "weblogic-message-catalog-dtd" 
"http://www.bea.com/servers/wls90/dtd/msgcat.dtd">
<message_catalog 
  l10n_package="programs.utils"
  i18n_package="programs.utils"
  subsystem="MYUTIL"
  version="1.0"
  baseid="600000"
  endid="600100">
  <logmessage
    messageid="600001"
    severity="warning"
    method="logNoAuthorization(String arg0, java.util.Date arg1,int arg2)">
    <messagebody>
      Could not open file, {0} on {1,date} after {2,number} attempts.
    </messagebody>
    <messagedetail>
      The configuration for this application will be defaulted to
      factory settings. Custom configuration information resides
      in file, {0}, created on {1,date}, but is not readable.
    </messagedetail>
    <cause>
      The user is not authorized to use custom configurations. Custom
     configuration information resides in file, {0}, created on
     {1,date}, but is not readable.The attempt has been logged to
     the security log.
    </cause>
    <action>
      The user needs to gain approriate authorization or learn to
      live with the default settings.
    </action>
  </logmessage>
</message_catalog>

G.8 action

この要素を使用して、推奨の解決方法を定義します。この要素には、任意のプレースホルダーを含めることができます。

構文: String

G.8.1 子要素

action要素は子要素をサポートしていません。

G.8.2 属性

action要素には属性はありません。

G.8.3

次の図は、ログ・メッセージ・カタログ・ファイル内のaction要素の使用方法を説明します。

<?xml version="1.0"?>
<!DOCTYPE message_catalog PUBLIC "weblogic-message-catalog-dtd" 
"http://www.bea.com/servers/wls90/dtd/msgcat.dtd">
<message_catalog 
  l10n_package="programs.utils"
  i18n_package="programs.utils"
  subsystem="MYUTIL"
  version="1.0"
  baseid="600000"
  endid="600100">
  <logmessage
    messageid="600001"
    severity="warning"
    method="logNoAuthorization(String arg0, java.util.Date arg1,int arg2)">
    <messagebody>
      Could not open file, {0} on {1,date} after {2,number} attempts.
    </messagebody>
    <messagedetail>
      The configuration for this application will be defaulted to
      factory settings. Custom configuration information resides
      in file, {0}, created on {1,date}, but is not readable.
    </messagedetail>
    <cause>
      The user is not authorized to use custom configurations. Custom
     configuration information resides in file, {0}, created on
     {1,date}, but is not readable.The attempt has been logged to
     the security log.
    </cause>
    <action>
      The user needs to gain approriate authorization or learn to
      live with the default settings.
    </action>
  </logmessage>
</message_catalog>