|
Tomcat example source code file (mbean-names.xml)
This example Tomcat source code file (mbean-names.xml) is included in the DevDaily.com
"Java Source Code
Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.
The Tomcat mbean-names.xml source code
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE document [
<!ENTITY project SYSTEM "project.xml">
]>
<document url="mbean-names.html">
&project;
<properties>
<author email="craigmcc@apache.org">Craig McClanahan
<author email="amyroh@apache.org">Amy Roh
<title>Tomcat MBean Names
<revision>$Id: mbean-names.xml 562814 2007-08-05 03:52:04Z markt $
</properties>
<body>
<section name="Background">
<p>We will be using JMX MBeans as the technology for
implementing manageability of Tomcat.</p>
<p>One of the key concepts of JMX (and JSR-77) is that each management
bean has a unique name in the MBeanServer's registry, and that
management applications can utilize these names to retrieve the MBean
of interest to them for a particular management operation.
This document proposes a naming convention for MBeans that allows easy
calculation of the name for a particular MBean. For background
information on JMX MBean names, see the <em>Java Management Extensions
Instrumentation and Agent Specification</em>, version 1.0, section 6.
In particular, we will be discussing the String Representation of
<code>ObjectName instances.
</section>
<section name="Catalina Object Hierarchy">
<p>Tomcat's servlet container implementation, called Catalina, can be
represented as a hierarchy of objects that contain references to each other.
The object hierarchy can be represented as a tree, or (isomorphically) based
on the nesting of configuration elements in the <code>conf/server.xml
file that is traditionally used to configure Tomcat stand-alone.</p>
<p>The valid component nestings for Catalina are depicted in the following
table, with columns that contain the following values:</p>
<ul>
<li>Pattern - Nesting pattern of XML elements (in the
<code>conf/server.xml file) used to configure this component.
<li>Cardinality - Minimum and maximum number of occurrences of
this element at this nesting position, which also corresponds to the
minimum and maximum number of Catalina components.</li>
<li>Identifier - Name of the JavaBeans property of this component
that represents the unique identifier (within the nested hierarchy),
if any.</li>
<li>MBean ObjectName - The portion of the MBean object name that
appears <strong>after the domain name. For now, it should be
assumed that all of these MBeans appear in the default JMX domain.</li>
</ul>
<p>In the MBean ObjectName descriptions, several types of symbolic
expressions are utilized to define variable text that is replaced by
corresponding values:</p>
<ul>
<li>${GROUP} - One of the standard MBean names of the specified
"group" category. For example, the expression <code>${REALM}
represents the values like <code>JDBCRealm and JAASRealm
that identify the various MBeans for possible <code>Realm components.
<li>${name} - Replaced by the value of property name
from the current component.</li>
<li>${parent.name} - Replaced by the value of property
<code>name from a parent of the current component, with the
parent's type identified by <em>parent.
<li>${###} - An arbitrary numeric identifier that preserves
order but has no other particular meaning. In general, the server will
assign numeric values to existing instances with large gaps into which
new items can be configured if desired.</li>
</ul>
<table border="1" cellpadding="5">
<tr>
<th align="center" bgcolor="aqua">Pattern
<th align="center" bgcolor="aqua">Cardinality
<th align="center" bgcolor="aqua">Identifier
<th align="center" bgcolor="aqua">MBean ObjectName
</tr>
<tr>
<td>Server |
<td align="center">1..1
<td align="center">(none)
<td>type=${SERVER}
</tr>
<tr>
<td>Server / Listener
<td align="center">0..n
<td align="center">(none)
<td>type=${LISTENER}, sequence=${###}
</tr>
<tr>
<td>Server / Service
<td align="center">1..n
<td align="center">name
<td>type=${SERVICE}, name=${name}
</tr>
<tr>
<td>Server / Service / Connector
<td align="center">1..n
<td align="center">address, port
<td>type=${CONNECTOR}, service=${service}, port=${port},
address=${address}</code>
</tr>
<tr>
<td>Server / Service / Connector / Factory
<td align="center">0..1
<td align="center">(none)
<td>(Only defined explicitly for an SSL connector, but can be treated
as part of the connector component)</td>
</tr>
<tr>
<td>Server / Service / Connector / Listener
<td align="center">0..n
<td align="center">(none)
<td>type=${LISTENER}, sequence=${###}, service=${service},
port=${connector.port}, address=${connector.address}</code>
</tr>
<tr>
<td>Server / Service / Engine
<td align="center">1..1
<td align="center">(none)
<td>type=${ENGINE}, service=${service.name}
</tr>
<tr>
<td>Server / Service / Engine / Host
<td align="center">1..n
<td align="center">name
<td>type=${HOST}, host=${name},
service=${service.name}</code>
</tr>
<tr>
<td>Server / Service / Engine / Host / Context
<td align="center">1..n
<td align="center">path
<td>type=${CONTEXT}, path=${path}, host=${host.name},
service=${service.name}</code>
</tr>
<tr>
<td>Server / Service / Engine / Host / Context / InstanceListener
<td align="center">0..n
<td align="center">(none)
<td>type=${INSTANCE-LISTENER}, sequence=${###}, path=${context.path},
host=${host.name}, service=${service.name}</code>
</tr>
<tr>
<td>Server / Service / Engine / Host / Context / Listener
<td align="center">0..n
<td align="center">(none)
<td>type=${LISTENER}, sequence=${###}, path=${context.path},
host=${host.name}, service=${service.name}</code>
</tr>
<tr>
<td>Server / Service / Engine / Host / Context / Loader
<td align="center">0..1
<td align="center">(none)
<td>type=${LOADER}, path=${context.path}, host=${host.name},
service=${service.name}</code>
</tr>
<tr>
<td>Server / Service / Engine / Host / Context / Manager
<td align="center">0..1
<td align="center">(none)
<td>type=${MANAGER}, path=${context.path}, host=${host.name},
service=${service.name}</code>
</tr>
<tr>
<td>Server / Service / Engine / Host / Context / Realm
<td align="center">0..1
<td align="center">(none)
<td>type=${REALM}, path=${context.path}, host=${host.name},
service=${service.name}</code>
</tr>
<tr>
<td>Server / Service / Engine / Host / Context / Resources
<td align="center">0..1
<td align="center">(none)
<td>type=${RESOURCES}, path=${context.path}, host=${host.name},
service=${service.name}</code>
</tr>
<tr>
<td>Server / Service / Engine / Host / Context / Valve
<td align="center">0..n
<td align="center">(none)
<td>type=${VALVE}, sequence=${###}, path=${context.path},
host=${host.name}, service=${service.name}</code>
</tr>
<tr>
<td>Server / Service / Engine / Host / Context / Wrapper
<td align="center">0..n
<td align="center">(none)
<td>j2eeType=Servlet,name=${name},
WebModule=//${host.name}/${context.name},
J2EEApplication=${context.J2EEApplication},
J2EEServer=${context.J2EEServer}</code>
</tr>
<tr>
<td>Server / Service / Engine / Host / Context / WrapperLifecycle
<td align="center">0..n
<td align="center">(none)
<td>type=${WRAPPER-LIFECYCLE}, sequence=${###}, path=${context.path},
host=${host.name}, service=${service.name}</code>
</tr>
<tr>
<td>Server / Service / Engine / Host / Context / WrapperListener
<td align="center">0..n
<td align="center">(none)
<td>type=${WRAPPER-LISTENER}, sequence=${###}, path=${context.path},
host=${host.name}, service=${service.name}</code>
</tr>
<tr>
<td>Server / Service / Engine / Host / Listener
<td align="center">0..n
<td align="center">(none)
<td>type=${LISTENER}, sequence=${###}, host=${host.name},
service=${service.name}</code>
</tr>
<tr>
<td>Server / Service / Engine / Host / Realm
<td align="center">0..1
<td align="center">(none)
<td>type=${REALM}, host=${host.name},
service=${service.name}</code>
</tr>
<tr>
<td>Server / Service / Engine / Host / Valve
<td align="center">0..n
<td align="center">(none)
<td>type=${VALVE}, sequence=${###},
host=${host.name}, service=${service.name}</code>
</tr>
<tr>
<td>Server / Service / Engine / Listener
<td align="center">0..n
<td align="center">(none)
<td>type=${LISTENER}, sequence=${###}
(<strong>FIXME - disambiguate from Server / Service /
Listener)</td>
</tr>
<tr>
<td>Server / Service / Engine / Realm
<td align="center">0..1
<td align="center">(none)
<td>type=${REALM}, service=${service.name}
</tr>
<tr>
<td>Server / Service / Engine / Valve
<td align="center">0..n
<td align="center">(none)
<td>type=${VALVE}, sequence=${###},
service=${service.name}</code>
</tr>
<tr>
<td>Server / Service / Listener
<td align="center">0..n
<td align="center">(none)
<td>type=${LISTENER}, sequence=${###}
(<strong>FIXME - disambiguate from Server / Service /
Engine / Listener)</td>
</tr>
</table>
</section>
<section name="MBean Groups and Names">
<p>The following MBean names shall be defined in the resource file
<code>/org/apache/catalina/mbeans/mbeans-descriptors.xml
(and
therefore available for use within the Administration/Configuration
web application for Tomcat):</p>
<table border="1" cellpadding="5">
<tr>
<th align="center" bgcolor="aqua">MBean Name
<th align="center" bgcolor="aqua">Group Name
<th align="center" bgcolor="aqua">Catalina Interface
<th align="center" bgcolor="aqua">Implementation Class
</tr>
<tr>
<td>AccessLogValve
<td align="center">VALVE
<td>org.apache.catalina.Valve
<td>org.apache.catalina.valves.AccessLogValve
</tr>
<tr>
<td>BasicAuthenticator
<td align="center">VALVE
<td>org.apache.catalina.Valve
<td>org.apache.catalina.authenticator.BasicAuthenticator
</tr>
<tr>
<td>CertificatesValve
<td align="center">VALVE
<td>org.apache.catalina.Valve
<td>org.apache.catalina.valves.CertificatesValve
</tr>
<tr>
<td>ContextConfig
<td align="center">LISTENER
<td>org.apache.catalina.LifecycleListener
<td>org.apache.catalina.startup.ContextConfig
</tr>
<tr>
<td>ContextEnvironment
<td align="center">RESOURCES
<td>org.apache.catalina.deploy.ContextEnvironment
<td>org.apache.catalina.deploy.ContextEnvironment
</tr>
<tr>
<td>ContextResource
<td align="center">RESOURCES
<td>org.apache.catalina.deploy.ContextResource
<td>org.apache.catalina.deploy.ContextResource
</tr>
<tr>
<td>ContextResourceLink
<td align="center">RESOURCES
<td>org.apache.catalina.deploy.ContextResourceLink
<td>org.apache.catalina.deploy.ContextResourceLink
</tr>
<tr>
<td>CoyoteConnector
<td align="center">CONNECTOR
<td>org.apache.catalina.Connector
<td>org.apache.coyote.tomcat4.CoyoteConnector
</tr>
<tr>
<td>DigestAuthenticator
<td align="center">VALVE
<td>org.apache.catalina.Valve
<td>org.apache.catalina.authenticator.DigestAuthenticator
</tr>
<tr>
<td>EngineConfig
<td align="center">LISTENER
<td>org.apache.catalina.LifecycleListener
<td>org.apache.catalina.startup.EngineConfig
</tr>
<tr>
<td>ErrorReportValve
<td align="center">VALVE
<td>org.apache.catalina.Valve
<td>org.apache.catalina.valves.ErrorReportValve
</tr>
<tr>
<td>ErrorDispatcherValve
<td align="center">VALVE
<td>org.apache.catalina.Valve
<td>org.apache.catalina.valves.ErrorDispatcherValve
</tr>
<tr>
<td>FormAuthenticator
<td align="center">VALVE
<td>org.apache.catalina.Valve
<td>org.apache.catalina.authenticator.FormAuthenticator
</tr>
<tr>
<td>Group
<td align="center">GROUP
<td>org.apache.catalina.Group
<td>org.apache.catalina.Group
</tr>
<tr>
<td>HostConfig
<td align="center">LISTENER
<td>org.apache.catalina.LifecycleListener
<td>org.apache.catalina.startup.HostConfig
</tr>
<tr>
<td>HttpConnector10
<td align="center">CONNECTOR
<td>org.apache.catalina.Connector
<td>org.apache.catalina.connector.http10.HttpConnector
</tr>
<tr>
<td>HttpConnector11
<td align="center">CONNECTOR
<td>org.apache.catalina.Connector
<td>org.apache.catalina.connector.http.HttpConnector
</tr>
<tr>
<td>JAASRealm
<td align="center">REALM
<td>org.apache.catalina.Realm
<td>org.apache.catalina.realm.JAASRealm
</tr>
<tr>
<td>JDBCRealm
<td align="center">REALM
<td>org.apache.catalina.Realm
<td>org.apache.catalina.realm.JDBCRealm
</tr>
<tr>
<td>JDBCUserDatabase
<td align="center">USERDATABASE
<td>org.apache.catalina.users.JDBCUserDatabase
<td>org.apache.catalina.users.JDBCUserDatabase
</tr>
<tr>
<td>JNDIRealm
<td align="center">REALM
<td>org.apache.catalina.Realm
<td>org.apache.catalina.realm.JNDIRealm
</tr>
<tr>
<td>MBeanFactory
<td align="center">
<td>
<td>org.apache.catalina.mbeans.MBeanFactory
</tr>
<tr>
<td>MemoryRealm
<td align="center">REALM
<td>org.apache.catalina.Realm
<td>org.apache.catalina.realm.MemoryRealm
</tr>
<tr>
<td>MemoryUserDatabase
<td align="center">USERDATABASE
<td>org.apache.catalina.users.MemoryUserDatabase
<td>org.apache.catalina.users.MemoryUserDatabase
</tr>
<tr>
<td>NamingContextListener
<td align="center">LISTENER
<td>org.apache.catalina.LifecycleListener
<td>org.apache.catalina.core.NamingContextListener
</tr>
<tr>
<td>NamingResources
<td align="center">RESOURCES
<td>org.apache.catalina.deploy.NamingResources
<td>org.apache.catalina.deploy.NamingResources
</tr>
<tr>
<td>NonLoginAuthenticator
<td align="center">VALVE
<td>org.apache.catalina.Valve
<td>org.apache.catalina.authenticator.NonLoginAuthenticator
</tr>
<tr>
<td>PersistentManager
<td align="center">MANAGER
<td>org.apache.catalina.Manager
<td>org.apache.catalina.session.PersistentManager
</tr>
<tr>
<td>RemoteAddrValve
<td align="center">VALVE
<td>org.apache.catalina.Valve
<td>org.apache.catalina.valves.RemoteAddrValve
</tr>
<tr>
<td>RemoteHostValve
<td align="center">VALVE
<td>org.apache.catalina.Valve
<td>org.apache.catalina.valves.RemoteHostValve
</tr>
<tr>
<td>RequestDumperValve
<td align="center">VALVE
<td>org.apache.catalina.Valve
<td>org.apache.catalina.valves.RequestDumperValve
</tr>
<tr>
<td>Role
<td align="center">ROLE
<td>org.apache.catalina.Role
<td>org.apache.catalina.Role
</tr>
<tr>
<td>SingleSignOn
<td align="center">VALVE
<td>org.apache.catalina.Valve
<td>org.apache.catalina.valves.SingleSignOn
</tr>
<tr>
<td>SSLAuthenticator
<td align="center">VALVE
<td>org.apache.catalina.Valve
<td>org.apache.catalina.authenticator.SSLAuthenticator
</tr>
<tr>
<td>StandardContext
<td align="center">CONTEXT
<td>org.apache.catalina.Context
<td>org.apache.catalina.core.StandardContext
</tr>
<tr>
<td>StandardContextValve
<td align="center">VALVE
<td>org.apache.catalina.Valve
<td>org.apache.catalina.core.StandardContextValve
</tr>
<tr>
<td>StandardEngine
<td align="center">ENGINE
<td>org.apache.catalina.Engine
<td>org.apache.catalina.core.StandardEngine
</tr>
<tr>
<td>StandardEngineValve
<td align="center">VALVE
<td>org.apache.catalina.Valve
<td>org.apache.catalina.core.StandardEngineValve
</tr>
<tr>
<td>StandardHost
<td align="center">HOST
<td>org.apache.catalina.Host
<td>org.apache.catalina.core.StandardHost
</tr>
<tr>
<td>StandardHostValve
<td align="center">VALVE
<td>org.apache.catalina.Valve
<td>org.apache.catalina.core.StandardHostValve
</tr>
<tr>
<td>StandardManager
<td align="center">MANAGER
<td>org.apache.catalina.Manager
<td>org.apache.catalina.session.StandardManager
</tr>
<tr>
<td>StandardServer
<td align="center">SERVER
<td>org.apache.catalina.Server
<td>org.apache.catalina.core.StandardServer
</tr>
<tr>
<td>StandardService
<td align="center">SERVICE
<td>org.apache.catalina.Service
<td>org.apache.catalina.core.StandardService
</tr>
<tr>
<td>StandardWrapper
<td align="center">WRAPPER
<td>org.apache.catalina.Wrapper
<td>org.apache.catalina.core.StandardWrapper
</tr>
<tr>
<td>StandardWrapperValve
<td align="center">VALVE
<td>org.apache.catalina.Valve
<td>org.apache.catalina.core.StandardWrapperValve
</tr>
<tr>
<td>User
<td align="center">USER
<td>org.apache.catalina.User
<td>org.apache.catalina.User
</tr>
<tr>
<td>UserDatabaseRealm
<td align="center">REALM
<td>org.apache.catalina.Realm
<td>org.apache.catalina.realm.UserDatabaseRealm
</tr>
<tr>
<td>WebappLoader
<td align="center">LOADER
<td>org.apache.catalina.Loader
<td>org.apache.catalina.loader.WebappLoader
</tr>
</table>
</section>
<section name="JSR-77 Cross Reference">
<p>The managed objects in the JSR-77 object hierarchy correspond
to the specified MBean names or groups as follows:</p>
<table border="1" cellpadding="5">
<tr>
<th align="center" bgcolor="aqua">JSR-77 Managed Object
<th align="center" bgcolor="aqua">MBean Name or Group
<th align="center" bgcolor="aqua">Comments
</tr>
<tr>
<td>J2EEServer
<td>${SERVICE}
<td>
</tr>
<tr>
<td>Node
<td>${SERVICE}
<td>Tomcat supports a single node only.
</tr>
<tr>
<td>Port
<td>${CONNECTOR}
<td>
</tr>
<tr>
<td>Servlet
<td>${WRAPPER}
<td>
</tr>
<tr>
<td>WebModule
<td>${CONTEXT}
<td>
</tr>
</table>
</section>
<section name="JSR-88 Cross Reference">
<p>The deployment objects in the JSR-88 API object hierarchy correspond
to the specified MBean names or groups as follows:</p>
<table border="1" cellpadding="5">
<tr>
<th align="center" bgcolor="aqua">JSR-88 API Object
<th align="center" bgcolor="aqua">MBean Name or Group
<th align="center" bgcolor="aqua">Comments
</tr>
<tr>
<td>DeployableObject
<td>${CONTEXT}
<td>Context deployment info plus the corresponding WAR file
</tr>
<tr>
<td>Target
<td>${HOST}
<td>
</tr>
</table>
</section>
</body>
</document>
Other Tomcat examples (source code examples)
Here is a short list of links related to this Tomcat mbean-names.xml source code file: