Top Fields Constructors Methods
org.apache.catalina.util

public abstract Class LifecycleMBeanBase

extends LifecycleBase
implements JmxEnabled
Class Inheritance
All Implemented Interfaces
org.apache.catalina.JmxEnabled, javax.management.MBeanRegistration
Known Direct Subclasses
org.apache.catalina.valves.ValveBase, org.apache.catalina.webresources.StandardRoot, org.apache.catalina.connector.Connector, org.apache.catalina.core.ContainerBase, org.apache.catalina.core.StandardServer, org.apache.catalina.core.StandardService, org.apache.catalina.core.StandardThreadExecutor, org.apache.catalina.core.StandardVirtualThreadExecutor, org.apache.catalina.deploy.NamingResourcesImpl, org.apache.catalina.loader.WebappLoader, org.apache.catalina.mapper.MapperListener, org.apache.catalina.realm.RealmBase, org.apache.catalina.session.ManagerBase, org.apache.catalina.startup.FailedContext
Imports
javax.management.MBeanServer, .ObjectName, org.apache.catalina.Globals, .JmxEnabled, .LifecycleException, org.apache.juli.logging.Log, .LogFactory, org.apache.tomcat.util.modeler.Registry, org.apache.tomcat.util.res.StringManager

Field Summary

Modifier and TypeField and Description
private String
private static final Log
private ObjectName
private static final StringManager

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
destroyInternal()

Implements abstract org.apache.catalina.util.LifecycleBase.destroyInternal.

Sub-classes wishing to perform additional clean-up should override this method, ensuring that super.destroyInternal() is the last call in the overriding method.

public final String
getDomain()

Implements org.apache.catalina.JmxEnabled.getDomain.

Obtain the domain under which this component will be / has been registered.

protected abstract String

Returns:

The name of the domain to use to register MBeans.
getDomainInternal
()

Method implemented by sub-classes to identify the domain in which MBeans should be registered.

public final ObjectName
getObjectName()

Implements org.apache.catalina.JmxEnabled.getObjectName.

Obtain the name under which this component has been registered with JMX.

protected abstract String

Returns:

The string representation of the key properties component of the desired ObjectName
getObjectNameKeyProperties
()

Allow sub-classes to specify the key properties component of the ObjectName that will be used to register this component.

protected void
initInternal()

Implements abstract org.apache.catalina.util.LifecycleBase.initInternal.

Sub-classes wishing to perform additional initialization should override this method, ensuring that super.initInternal() is the first call in the overriding method.

public final void
public final void
postRegister(Boolean
Indicates whether or not the MBean has been successfully registered in the MBean server. The value false means that the registration phase has failed.
registrationDone
)

Implements javax.management.MBeanRegistration.postRegister.

Not used - NOOP.

public final void
public final ObjectName
preRegister(MBeanServer
The MBean Server in which the MBean will be registered.
server
,
ObjectName
The object name of the MBean. This name is null if the name parameter to one of the createMBean or registerMBean methods in the MBeanServer interface is null. In that case, this method must return a non-null ObjectName for the new MBean.
name
)

Implements javax.management.MBeanRegistration.preRegister.

Allows the object to be registered with an alternative MBeanServer and/or ObjectName.

protected final ObjectName

Returns:

The name used to register the object
register
(Object
The object the register
obj
,
String
The key properties component of the object name to use to register the object
objectNameKeyProperties
)

Utility method to enable sub-classes to easily register additional components that don't implement JmxEnabled with an MBean server.

public final void
setDomain(String
The name of the domain under which this component should be registered
domain
)

Implements org.apache.catalina.JmxEnabled.setDomain.

Specify the domain under which this component should be registered.

protected final void
unregister(String
The key properties component of the object name to use to unregister the object
objectNameKeyProperties
)

Utility method to enable sub-classes to easily unregister additional components that don't implement JmxEnabled with an MBean server.

protected final void
unregister(ObjectName
The name of the component to unregister
on
)

Utility method to enable sub-classes to easily unregister additional components that don't implement JmxEnabled with an MBean server.

Inherited from org.apache.catalina.util.LifecycleBase:
addLifecycleListenerdestroyfindLifecycleListenersfireLifecycleEventgetStategetStateNamegetThrowOnFailureinitremoveLifecycleListenersetStatesetStatesetThrowOnFailurestartstartInternalstopstopInternal

Field Detail

domainback to summary
private String domain
logback to summary
private static final Log log

Hides org.apache.catalina.util.LifecycleBase.log.

onameback to summary
private ObjectName oname
smback to summary
private static final StringManager sm

Hides org.apache.catalina.util.LifecycleBase.sm.

Constructor Detail

LifecycleMBeanBaseback to summary
public LifecycleMBeanBase()

Method Detail

destroyInternalback to summary
protected void destroyInternal() throws LifecycleException

Implements abstract org.apache.catalina.util.LifecycleBase.destroyInternal.

Sub-classes wishing to perform additional clean-up should override this method, ensuring that super.destroyInternal() is the last call in the overriding method.

Annotations
@Override
Exceptions
LifecycleException:

Doc from org.apache.catalina.util.LifecycleBase.destroyInternal.

If the destruction fails

getDomainback to summary
public final String getDomain()

Implements org.apache.catalina.JmxEnabled.getDomain.

Obtain the domain under which this component will be / has been registered.

Returns:String

Doc from org.apache.catalina.JmxEnabled.getDomain.

the domain under which this component will be / has been registered.

Annotations
@Override
getDomainInternalback to summary
protected abstract String getDomainInternal()

Method implemented by sub-classes to identify the domain in which MBeans should be registered.

Returns:String

The name of the domain to use to register MBeans.

getObjectNameback to summary
public final ObjectName getObjectName()

Implements org.apache.catalina.JmxEnabled.getObjectName.

Obtain the name under which this component has been registered with JMX.

Returns:ObjectName

Doc from org.apache.catalina.JmxEnabled.getObjectName.

the name under which this component has been registered with JMX.

Annotations
@Override
getObjectNameKeyPropertiesback to summary
protected abstract String getObjectNameKeyProperties()

Allow sub-classes to specify the key properties component of the ObjectName that will be used to register this component.

Returns:String

The string representation of the key properties component of the desired ObjectName

initInternalback to summary
protected void initInternal() throws LifecycleException

Implements abstract org.apache.catalina.util.LifecycleBase.initInternal.

Sub-classes wishing to perform additional initialization should override this method, ensuring that super.initInternal() is the first call in the overriding method.

Annotations
@Override
Exceptions
LifecycleException:

Doc from org.apache.catalina.util.LifecycleBase.initInternal.

If the initialisation fails

postDeregisterback to summary
public final void postDeregister()

Implements javax.management.MBeanRegistration.postDeregister.

Not used - NOOP.

Annotations
@Override
postRegisterback to summary
public final void postRegister(Boolean registrationDone)

Implements javax.management.MBeanRegistration.postRegister.

Not used - NOOP.

Parameters
registrationDone:Boolean

Doc from javax.management.MBeanRegistration.postRegister.

Indicates whether or not the MBean has been successfully registered in the MBean server. The value false means that the registration phase has failed.

Annotations
@Override
preDeregisterback to summary
public final void preDeregister() throws Exception

Implements javax.management.MBeanRegistration.preDeregister.

Not used - NOOP.

Annotations
@Override
Exceptions
Exception:

Doc from javax.management.MBeanRegistration.preDeregister.

This exception will be caught by the MBean server and re-thrown as an MBeanRegistrationException.

preRegisterback to summary
public final ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception

Implements javax.management.MBeanRegistration.preRegister.

Allows the object to be registered with an alternative MBeanServer and/or ObjectName.

Parameters
server:MBeanServer

Doc from javax.management.MBeanRegistration.preRegister.

The MBean Server in which the MBean will be registered.

name:ObjectName

Doc from javax.management.MBeanRegistration.preRegister.

The object name of the MBean. This name is null if the name parameter to one of the createMBean or registerMBean methods in the MBeanServer interface is null. In that case, this method must return a non-null ObjectName for the new MBean.

Returns:ObjectName

Doc from javax.management.MBeanRegistration.preRegister.

The name under which the MBean is to be registered. This value must not be null. If the name parameter is not null, it will usually but not necessarily be the returned value.

Annotations
@Override
Exceptions
Exception:

Doc from javax.management.MBeanRegistration.preRegister.

This exception will be caught by the MBean Server and re-thrown as an MBeanRegistrationException.

registerback to summary
protected final ObjectName register(Object obj, String objectNameKeyProperties)

Utility method to enable sub-classes to easily register additional components that don't implement JmxEnabled with an MBean server.

Note

This method should only be used once initInternal() has been called and before destroyInternal() has been called.

Parameters
obj:Object

The object the register

objectNameKeyProperties:String

The key properties component of the object name to use to register the object

Returns:ObjectName

The name used to register the object

setDomainback to summary
public final void setDomain(String domain)

Implements org.apache.catalina.JmxEnabled.setDomain.

Specify the domain under which this component should be registered. Used with components that cannot (easily) navigate the component hierarchy to determine the correct domain to use.

Parameters
domain:String

Doc from org.apache.catalina.JmxEnabled.setDomain.

The name of the domain under which this component should be registered

Annotations
@Override
unregisterback to summary
protected final void unregister(String objectNameKeyProperties)

Utility method to enable sub-classes to easily unregister additional components that don't implement JmxEnabled with an MBean server.

Note

This method should only be used once initInternal() has been called and before destroyInternal() has been called.

Parameters
objectNameKeyProperties:String

The key properties component of the object name to use to unregister the object

unregisterback to summary
protected final void unregister(ObjectName on)

Utility method to enable sub-classes to easily unregister additional components that don't implement JmxEnabled with an MBean server.

Note

This method should only be used once initInternal() has been called and before destroyInternal() has been called.

Parameters
on:ObjectName

The name of the component to unregister