Lines 1-86
Link Here
|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
1 |
<?xml version="1.0" encoding="UTF-8"?> |
2 |
<!-- |
2 |
<!-- |
3 |
Licensed to the Apache Software Foundation (ASF) under one or more |
3 |
Licensed to the Apache Software Foundation (ASF) under one or more |
4 |
contributor license agreements. See the NOTICE file distributed with |
4 |
contributor license agreements. See the NOTICE file distributed with |
5 |
this work for additional information regarding copyright ownership. |
5 |
this work for additional information regarding copyright ownership. |
6 |
The ASF licenses this file to You under the Apache License, Version 2.0 |
6 |
The ASF licenses this file to You under the Apache License, Version 2.0 |
7 |
(the "License"); you may not use this file except in compliance with |
7 |
(the "License"); you may not use this file except in compliance with |
8 |
the License. You may obtain a copy of the License at |
8 |
the License. You may obtain a copy of the License at |
9 |
|
9 |
|
10 |
http://www.apache.org/licenses/LICENSE-2.0 |
10 |
http://www.apache.org/licenses/LICENSE-2.0 |
11 |
|
11 |
|
12 |
Unless required by applicable law or agreed to in writing, software |
12 |
Unless required by applicable law or agreed to in writing, software |
13 |
distributed under the License is distributed on an "AS IS" BASIS, |
13 |
distributed under the License is distributed on an "AS IS" BASIS, |
14 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
14 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
15 |
See the License for the specific language governing permissions and |
15 |
See the License for the specific language governing permissions and |
16 |
limitations under the License. |
16 |
limitations under the License. |
17 |
--> |
17 |
--> |
18 |
<!DOCTYPE document [ |
18 |
<!DOCTYPE document [ |
19 |
<!ENTITY project SYSTEM "project.xml"> |
19 |
<!ENTITY project SYSTEM "project.xml"> |
20 |
]> |
20 |
]> |
21 |
<document url="mbeans-descriptors-howto.html"> |
21 |
<document url="mbeans-descriptors-howto.html"> |
22 |
|
22 |
|
23 |
&project; |
23 |
&project; |
24 |
|
24 |
|
25 |
<properties> |
25 |
<properties> |
26 |
<author email="amyroh@apache.org">Amy Roh</author> |
26 |
<author email="amyroh@apache.org">Amy Roh</author> |
27 |
<title>MBeans Descriptors How To</title> |
27 |
<title>MBeans Descriptors How To</title> |
28 |
</properties> |
28 |
</properties> |
29 |
|
29 |
|
30 |
<body> |
30 |
<body> |
31 |
|
31 |
|
32 |
<section name="Table of Contents"> |
32 |
<section name="Table of Contents"> |
33 |
<toc/> |
33 |
<toc/> |
34 |
</section> |
34 |
</section> |
35 |
|
35 |
|
36 |
<section name="Introduction"> |
36 |
<section name="Introduction"> |
37 |
|
37 |
|
38 |
|
38 |
|
39 |
<p>Tomcat uses JMX MBeans as the technology for implementing |
39 |
<p>Tomcat uses JMX MBeans as the technology for implementing |
40 |
manageability of Tomcat.</p> |
40 |
manageability of Tomcat.</p> |
41 |
|
41 |
|
42 |
|
42 |
<p>The "mbeans-descriptors" element is the root of the configuration file |
43 |
|
43 |
hierarchy, and contains nested elements for all of the other |
44 |
<p>The descriptions of JMX MBeans for Catalina are in the mbeans-descriptors.xml |
44 |
configuration settings. Remaining element definitions are listed |
45 |
file in each package.</p> |
45 |
in alphabetical order. |
46 |
|
46 |
|
47 |
<p>You will need to add MBean descriptions for your custom components |
47 |
<![CDATA[ <!ELEMENT mbeans-descriptors (mbean*)> |
48 |
in order to avoid a "ManagedBean is not found" exception.</p> |
48 |
<!ATTLIST mbeans-descriptors id ID #IMPLIED> ]]> |
49 |
|
49 |
</p> |
50 |
</section> |
50 |
|
51 |
|
51 |
<p>The "mbean" element describes a particular JMX ModelMBean implementation, |
52 |
<section name="Adding MBean descriptions"> |
52 |
including the information necessary to construct the corresponding |
53 |
|
53 |
ModelMBeanInfo structures. The following attributes are supported: |
54 |
<p>You may also add MBean descriptions for custom components in |
54 |
|
55 |
a mbeans-descriptors.xml file, located in the same package as the class files |
55 |
className Fully qualified Java class name of the ModelMBean |
56 |
it describes.</p> |
56 |
implementation class. If not specified, the standard |
57 |
|
57 |
implementation provided by JMX will be utilized. |
58 |
<source><![CDATA[ <mbean name="LDAPRealm" |
58 |
|
59 |
className="org.apache.catalina.mbeans.ClassNameMBean" |
59 |
description Human-readable description of this managed bean. |
60 |
description="Custom LDAPRealm" |
60 |
|
61 |
domain="Catalina" |
61 |
domain The JMX MBeanServer domain in which the ModelMBean |
62 |
group="Realm" |
62 |
created by this managed bean should be registered, |
63 |
type="com.myfirm.mypackage.LDAPRealm"> |
63 |
when creating its ObjectName. |
64 |
|
64 |
|
65 |
<attribute name="className" |
65 |
group Optional name of a "grouping classification" that can |
66 |
description="Fully qualified class name of the managed object" |
66 |
be used to select groups of similar MBean implementation |
67 |
type="java.lang.String" |
67 |
classes. |
68 |
writeable="false"/> |
68 |
|
69 |
|
69 |
name Unique name of this MBean (normally corresponds to the |
70 |
<attribute name="debug" |
70 |
base class name of the corresponding server component). |
71 |
description="The debugging detail level for this component" |
71 |
|
72 |
type="int"/> |
72 |
type Fully qualified Java class name of the underlying |
73 |
. |
73 |
managed resource implementation class. |
74 |
. |
74 |
<![CDATA[ <!ELEMENT mbean (descriptor?, attribute*, constructor*, notification*, operation*) |
75 |
. |
75 |
<!ATTLIST mbean id ID #IMPLIED> |
76 |
|
76 |
<!ATTLIST mbean className %ClassName; #IMPLIED> |
77 |
</mbean>]]> |
77 |
<!ATTLIST mbean description CDATA #IMPLIED> |
78 |
|
78 |
<!ATTLIST mbean domain CDATA #IMPLIED> |
79 |
</source> |
79 |
<!ATTLIST mbean group CDATA #IMPLIED> |
80 |
|
80 |
<!ATTLIST mbean name %MethodName; #IMPLIED> |
81 |
|
81 |
<!ATTLIST mbean type %ClassName; #IMPLIED> ]]> |
82 |
</section> |
82 |
</p> |
83 |
|
83 |
|
84 |
</body> |
84 |
<p>The descriptions of JMX MBeans for Catalina are in the mbeans-descriptors.xml |
85 |
|
85 |
file in each package.</p> |
86 |
</document> |
86 |
|
|
|
87 |
<p>You will need to add MBean descriptions for your custom components |
88 |
in order to avoid a "ManagedBean is not found" exception.</p> |
89 |
|
90 |
</section> |
91 |
|
92 |
<section name="Adding MBean descriptions"> |
93 |
|
94 |
<p>You may also add MBean descriptions for custom components in |
95 |
a mbeans-descriptors.xml file, located in the same package as the class files |
96 |
it describes.</p> |
97 |
|
98 |
<source><![CDATA[ <mbean name="LDAPRealm" |
99 |
className="org.apache.catalina.mbeans.ClassNameMBean" |
100 |
description="Custom LDAPRealm" |
101 |
domain="Catalina" |
102 |
group="Realm" |
103 |
type="com.myfirm.mypackage.LDAPRealm"> |
104 |
|
105 |
<attribute name="className" |
106 |
description="Fully qualified class name of the managed object" |
107 |
type="java.lang.String" |
108 |
writeable="false"/> |
109 |
|
110 |
<attribute name="debug" |
111 |
description="The debugging detail level for this component" |
112 |
type="int"/> |
113 |
. |
114 |
. |
115 |
. |
116 |
|
117 |
</mbean>]]> |
118 |
|
119 |
</source> |
120 |
|
121 |
|
122 |
</section> |
123 |
|
124 |
</body> |
125 |
|
126 |
</document> |