<?xml version="1.0" encoding="Shift_JIS"?>
<!DOCTYPE document [
  <!ENTITY project SYSTEM "project.xml">
]>
<document url="mbean-descriptor-howto.html">

    &project;

    <properties>
        <author email="amyroh@apache.org">Amy Roh</author>
        <primary>
        <title>MBean Descriptor How To</title>
        </primary>
        <title>MBean記述子の設定</title>
        <translator>田中 ラ・マンチャ 良浩</translator>
        <editor>高橋 達男</editor>
    </properties>

<body>

<primary>
<section name="Introduction"/>
</primary>
<section name="はじめに">

<primary>
<p>Tomcat 5 uses JMX MBeans as the technology for implementing 
manageability of Tomcat.</p>

<p>The descriptions of JMX MBeans for Catalina are in the 
org.apache.catalina.mbeans.mbeans-descriptor.xml file.</p>

<p>You will need to add MBean descriptions for your custom components 
in order to avoid a "ManagedBean is not found" exception.</p>
</primary>

<p>Tomcat 5は、管理性(manageability)を実現する技術としてJMX MBeansを使用しています。</p>

<p>Catalinaが使用するJMX MBeansに関する記述は、
org.apache.catalina.mbeans.mbeans-descriptor.xml ファイルにあります。</p>

<p>「ManagedBean が見つかりません」という例外を防ぐために、
カスタムコンポーネント向けのMBeanに関する記述を追加する必要があります。</p>

</section>

<primary>
<section name="Including your own mbean-descriptor files"/>
</primary>
<section name="自作のmbean-descriptor ファイルを読み込ませる">

<primary>
<p>You may configure custom components (e.g. Valves/Realms) by including 
your own mbean-descriptor file(s), and setting the "descriptors" 
attribute to point to a ';' separated list of paths (in the ClassLoader sense) 
of files to add to the default list under ServerLifecycleListener definition 
in server.xml.</p>
</primary>

<p>自作のmbean-descriptor ファイルを読み込ませることによってカスタムコンポーネント(例えば Valve/Realm)を設定出来ます。
server.xml ファイル内の ServerLifecycleListener の定義にあるデフォルト設定に対して、
クラスローダが使うようなセミコロン( ; )で区切られたファイルパス(スラッシュ区切り)の一覧を指すように
"descriptors"属性を追加します。
<note>in the ClassLoader sense の意図が不明。単純に訳すと「クラスローダの点で」となるが...</note>
<note>ClassLoader クラスはスラッシュ区切りのパス名で指定された名前でリソースを取得しますが、
それと同じやり方でファイルのパスを指定することと解釈しました。(高橋)</note>
</p>

<source>
&lt;Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
          debug="0"
          descriptors="/com/myfirm/mypackage/mbean-descriptor.xml"/&gt;
</source>          


</section>

<primary>
<section name="Adding MBean description to Catalina's mbean-descriptors.xml"/>
</primary>
<section name="MBean 記述を Catalina の mbean-descriptors.xml に追加する">

<primary>
<p>You may also add MBean descriptions for custom components in 
org.apache.catalina.mbeans.mbeans-descriptor.xml file.</p>

<source>
  &lt;mbean         name="LDAPRealm"
            className="org.apache.catalina.mbeans.ClassNameMBean"
          description="Custom LDAPRealm"
               domain="Catalina"
                group="Realm"
                 type="com.myfirm.mypackage.LDAPRealm"&gt;

    &lt;attribute   name="className"
          description="Fully qualified class name of the managed object"
                 type="java.lang.String"
            writeable="false"/&gt;

    &lt;attribute   name="debug"
          description="The debugging detail level for this component"
                 type="int"/&gt;
    .
    .
    .

  &lt;/mbean&gt;
</source>
</primary>

<p>カスタムコンポーネントの MBean に関する記述は、
org.apache.catalina.mbeans.mbeans-descriptor.xml ファイルに追加してもかまいません。</p>

<source>
  &lt;mbean         name="LDAPRealm"
            className="org.apache.catalina.mbeans.ClassNameMBean"
          description="自作のLDAPレルム"
               domain="Catalina"
                group="Realm"
                 type="com.myfirm.mypackage.LDAPRealm"&gt;

    &lt;attribute   name="className"
          description="管理されるオブジェクトの完全修飾クラス名"
                 type="java.lang.String"
            writeable="false"/&gt;

    &lt;attribute   name="debug"
          description="このコンポーネントのデバッグレベル"
                 type="int"/&gt;
    .
    .
    .

  &lt;/mbean&gt;
</source>


</section>

</body>

</document>
