Tomcat MBean Names

 

Tomcat MBean Names

Background

We will be using JMX MBeans as the technology for implementing manageability of Tomcat.

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 Java Management Extensions Instrumentation and Agent Specification , version 1.0, section 6. In particular, we will be discussing the String Representation of ObjectName instances.

Catalina Object Hierarchy

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 conf/server.xml file that is traditionally used to configure Tomcat stand-alone.

The valid component nestings for Catalina are depicted in the following table, with columns that contain the following values:

  • Pattern - Nesting pattern of XML elements (in the conf/server.xml file) used to configure this component.
  • 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.
  • Identifier - Name of the JavaBeans property of this component that represents the unique identifier (within the nested hierarchy), if any.
  • MBean ObjectName - The portion of the MBean object name that appears after the domain name. For now, it should be assumed that all of these MBeans appear in the default JMX domain.

In the MBean ObjectName descriptions, several types of symbolic expressions are utilized to define variable text that is replaced by corresponding values:

  • ${GROUP} - One of the standard MBean names of the specified "group" category. For example, the expression ${REALM} represents the values like JDBCRealm and JAASRealm that identify the various MBeans for possible Realm components.
  • ${name} - Replaced by the value of property name from the current component.
  • ${parent.name} - Replaced by the value of property name from a parent of the current component, with the parent's type identified by parent .
  • ${###} - 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.
PatternCardinalityIdentifierMBean ObjectName
Server1..1(none)type=${SERVER}
Server / Listener0..n(none)type=${LISTENER}, sequence=${###}
Server / Service1..nnametype=${SERVICE}, name=${name}
Server / Service / Connector1..naddress, porttype=${CONNECTOR}, service=${service}, port=${port}, address=${address}
Server / Service / Connector / Factory0..1(none)(Only defined explicitly for an SSL connector, but can be treated as part of the connector component)
Server / Service / Connector / Listener0..n(none)type=${LISTENER}, sequence=${###}, service=${service}, port=${connector.port}, address=${connector.address}
Server / Service / Engine1..1(none)type=${ENGINE}, service=${service.name}
Server / Service / Engine / Host1..nnametype=${HOST}, host=${name}, service=${service.name}
Server / Service / Engine / Host / Context1..npathtype=${CONTEXT}, path=${path}, host=${host.name}, service=${service.name}
Server / Service / Engine / Host / Context / InstanceListener0..n(none)type=${INSTANCE-LISTENER}, sequence=${###}, path=${context.path}, host=${host.name}, service=${service.name}
Server / Service / Engine / Host / Context / Listener0..n(none)type=${LISTENER}, sequence=${###}, path=${context.path}, host=${host.name}, service=${service.name}
Server / Service / Engine / Host / Context / Loader0..1(none)type=${LOADER}, path=${context.path}, host=${host.name}, service=${service.name}
Server / Service / Engine / Host / Context / Manager0..1(none)type=${MANAGER}, path=${context.path}, host=${host.name}, service=${service.name}
Server / Service / Engine / Host / Context / Realm0..1(none)type=${REALM}, path=${context.path}, host=${host.name}, service=${service.name}
Server / Service / Engine / Host / Context / Resources0..1(none)type=${RESOURCES}, path=${context.path}, host=${host.name}, service=${service.name}
Server / Service / Engine / Host / Context / Valve0..n(none)type=${VALVE}, sequence=${###}, path=${context.path}, host=${host.name}, service=${service.name}
Server / Service / Engine / Host / Context / Wrapper0..n(none)j2eeType=Servlet,name=${name}, WebModule=//${host.name}/${context.name}, J2EEApplication=${context.J2EEApplication}, J2EEServer=${context.J2EEServer}
Server / Service / Engine / Host / Context / WrapperLifecycle0..n(none)type=${WRAPPER-LIFECYCLE}, sequence=${###}, path=${context.path}, host=${host.name}, service=${service.name}
Server / Service / Engine / Host / Context / WrapperListener0..n(none)type=${WRAPPER-LISTENER}, sequence=${###}, path=${context.path}, host=${host.name}, service=${service.name}
Server / Service / Engine / Host / Listener0..n(none)type=${LISTENER}, sequence=${###}, host=${host.name}, service=${service.name}
Server / Service / Engine / Host / Realm0..1(none)type=${REALM}, host=${host.name}, service=${service.name}
Server / Service / Engine / Host / Valve0..n(none)type=${VALVE}, sequence=${###}, host=${host.name}, service=${service.name}
Server / Service / Engine / Listener0..n(none)type=${LISTENER}, sequence=${###} (FIXME - disambiguate from Server / Service / Listener)
Server / Service / Engine / Realm0..1(none)type=${REALM}, service=${service.name}
Server / Service / Engine / Valve0..n(none)type=${VALVE}, sequence=${###}, service=${service.name}
Server / Service / Listener0..n(none)type=${LISTENER}, sequence=${###} (FIXME - disambiguate from Server / Service / Engine / Listener)
MBean Groups and Names

The following MBean names shall be defined in the resource file /org/apache/catalina/mbeans/mbeans-descriptors.xml (and therefore available for use within the Administration/Configuration web application for Tomcat):

MBean NameGroup NameCatalina InterfaceImplementation Class
AccessLogValveVALVEorg.apache.catalina.Valveorg.apache.catalina.valves.AccessLogValve
BasicAuthenticatorVALVEorg.apache.catalina.Valveorg.apache.catalina.authenticator.BasicAuthenticator
CertificatesValveVALVEorg.apache.catalina.Valveorg.apache.catalina.valves.CertificatesValve
ContextConfigLISTENERorg.apache.catalina.LifecycleListenerorg.apache.catalina.startup.ContextConfig
ContextEnvironmentRESOURCESorg.apache.catalina.deploy.ContextEnvironmentorg.apache.catalina.deploy.ContextEnvironment
ContextResourceRESOURCESorg.apache.catalina.deploy.ContextResourceorg.apache.catalina.deploy.ContextResource
ContextResourceLinkRESOURCESorg.apache.catalina.deploy.ContextResourceLinkorg.apache.catalina.deploy.ContextResourceLink
CoyoteConnectorCONNECTORorg.apache.catalina.Connectororg.apache.coyote.tomcat4.CoyoteConnector
DigestAuthenticatorVALVEorg.apache.catalina.Valveorg.apache.catalina.authenticator.DigestAuthenticator
EngineConfigLISTENERorg.apache.catalina.LifecycleListenerorg.apache.catalina.startup.EngineConfig
ErrorReportValveVALVEorg.apache.catalina.Valveorg.apache.catalina.valves.ErrorReportValve
ErrorDispatcherValveVALVEorg.apache.catalina.Valveorg.apache.catalina.valves.ErrorDispatcherValve
FormAuthenticatorVALVEorg.apache.catalina.Valveorg.apache.catalina.authenticator.FormAuthenticator
GroupGROUPorg.apache.catalina.Grouporg.apache.catalina.Group
HostConfigLISTENERorg.apache.catalina.LifecycleListenerorg.apache.catalina.startup.HostConfig
HttpConnector10CONNECTORorg.apache.catalina.Connectororg.apache.catalina.connector.http10.HttpConnector
HttpConnector11CONNECTORorg.apache.catalina.Connectororg.apache.catalina.connector.http.HttpConnector
JAASRealmREALMorg.apache.catalina.Realmorg.apache.catalina.realm.JAASRealm
JDBCRealmREALMorg.apache.catalina.Realmorg.apache.catalina.realm.JDBCRealm
JDBCUserDatabaseUSERDATABASEorg.apache.catalina.users.JDBCUserDatabaseorg.apache.catalina.users.JDBCUserDatabase
JNDIRealmREALMorg.apache.catalina.Realmorg.apache.catalina.realm.JNDIRealm
MBeanFactory  org.apache.catalina.mbeans.MBeanFactory
MemoryRealmREALMorg.apache.catalina.Realmorg.apache.catalina.realm.MemoryRealm
MemoryUserDatabaseUSERDATABASEorg.apache.catalina.users.MemoryUserDatabaseorg.apache.catalina.users.MemoryUserDatabase
NamingContextListenerLISTENERorg.apache.catalina.LifecycleListenerorg.apache.catalina.core.NamingContextListener
NamingResourcesRESOURCESorg.apache.catalina.deploy.NamingResourcesorg.apache.catalina.deploy.NamingResources
NonLoginAuthenticatorVALVEorg.apache.catalina.Valveorg.apache.catalina.authenticator.NonLoginAuthenticator
PersistentManagerMANAGERorg.apache.catalina.Managerorg.apache.catalina.session.PersistentManager
RemoteAddrValveVALVEorg.apache.catalina.Valveorg.apache.catalina.valves.RemoteAddrValve
RemoteHostValveVALVEorg.apache.catalina.Valveorg.apache.catalina.valves.RemoteHostValve
RequestDumperValveVALVEorg.apache.catalina.Valveorg.apache.catalina.valves.RequestDumperValve
RoleROLEorg.apache.catalina.Roleorg.apache.catalina.Role
SingleSignOnVALVEorg.apache.catalina.Valveorg.apache.catalina.valves.SingleSignOn
SSLAuthenticatorVALVEorg.apache.catalina.Valveorg.apache.catalina.authenticator.SSLAuthenticator
StandardContextCONTEXTorg.apache.catalina.Contextorg.apache.catalina.core.StandardContext
StandardContextValveVALVEorg.apache.catalina.Valveorg.apache.catalina.core.StandardContextValve
StandardEngineENGINEorg.apache.catalina.Engineorg.apache.catalina.core.StandardEngine
StandardEngineValveVALVEorg.apache.catalina.Valveorg.apache.catalina.core.StandardEngineValve
StandardHostHOSTorg.apache.catalina.Hostorg.apache.catalina.core.StandardHost
StandardHostValveVALVEorg.apache.catalina.Valveorg.apache.catalina.core.StandardHostValve
StandardManagerMANAGERorg.apache.catalina.Managerorg.apache.catalina.session.StandardManager
StandardServerSERVERorg.apache.catalina.Serverorg.apache.catalina.core.StandardServer
StandardServiceSERVICEorg.apache.catalina.Serviceorg.apache.catalina.core.StandardService
StandardWrapperWRAPPERorg.apache.catalina.Wrapperorg.apache.catalina.core.StandardWrapper
StandardWrapperValveVALVEorg.apache.catalina.Valveorg.apache.catalina.core.StandardWrapperValve
UserUSERorg.apache.catalina.Userorg.apache.catalina.User
UserDatabaseRealmREALMorg.apache.catalina.Realmorg.apache.catalina.realm.UserDatabaseRealm
WebappLoaderLOADERorg.apache.catalina.Loaderorg.apache.catalina.loader.WebappLoader
JSR-77 Cross Reference

The managed objects in the JSR-77 object hierarchy correspond to the specified MBean names or groups as follows:

JSR-77 Managed ObjectMBean Name or GroupComments
J2EEServer${SERVICE} 
Node${SERVICE}Tomcat supports a single node only.
Port${CONNECTOR} 
Servlet${WRAPPER} 
WebModule${CONTEXT} 
JSR-88 Cross Reference

The deployment objects in the JSR-88 API object hierarchy correspond to the specified MBean names or groups as follows:

JSR-88 API ObjectMBean Name or GroupComments
DeployableObject${CONTEXT}Context deployment info plus the corresponding WAR file
Target${HOST} 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值