Package org.apache.catalina.util
Class LifecycleMBeanBase
java.lang.Object
org.apache.catalina.util.LifecycleBase
org.apache.catalina.util.LifecycleMBeanBase
- All Implemented Interfaces:
MBeanRegistration
,JmxEnabled
,Lifecycle
- Direct Known Subclasses:
Connector
,ContainerBase
,FailedContext
,ManagerBase
,MapperListener
,NamingResourcesImpl
,RealmBase
,SimpleTcpCluster
,StandardRoot
,StandardServer
,StandardService
,StandardThreadExecutor
,StandardVirtualThreadExecutor
,ValveBase
,WebappLoader
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.catalina.Lifecycle
Lifecycle.SingleUse
-
Field Summary
Fields inherited from interface org.apache.catalina.Lifecycle
AFTER_DESTROY_EVENT, AFTER_INIT_EVENT, AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_DESTROY_EVENT, BEFORE_INIT_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, CONFIGURE_START_EVENT, CONFIGURE_STOP_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Sub-classes implement this method to perform any instance destruction required.final String
protected abstract String
Method implemented by sub-classes to identify the domain in which MBeans should be registered.final ObjectName
protected abstract String
Allow sub-classes to specify the key properties component of theObjectName
that will be used to register this component.protected void
Sub-classes implement this method to perform any instance initialisation required.final void
Not used - NOOP.final void
postRegister
(Boolean registrationDone) Not used - NOOP.final void
Not used - NOOP.final ObjectName
preRegister
(MBeanServer server, ObjectName name) protected final ObjectName
Utility method to enable sub-classes to easily register additional components that don't implementJmxEnabled
with an MBean server.final void
Specify the domain under which this component should be registered.protected final void
unregister
(String objectNameKeyProperties) Utility method to enable sub-classes to easily unregister additional components that don't implementJmxEnabled
with an MBean server.protected final void
unregister
(ObjectName on) Utility method to enable sub-classes to easily unregister additional components that don't implementJmxEnabled
with an MBean server.Methods inherited from class org.apache.catalina.util.LifecycleBase
addLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, removeLifecycleListener, setState, setState, setThrowOnFailure, start, startInternal, stop, stopInternal
-
Field Details
-
mserver
Deprecated.
-
-
Constructor Details
-
LifecycleMBeanBase
public LifecycleMBeanBase()
-
-
Method Details
-
initInternal
Description copied from class:LifecycleBase
Sub-classes implement this method to perform any instance initialisation required.- Specified by:
initInternal
in classLifecycleBase
- Throws:
LifecycleException
- If the initialisation fails
-
destroyInternal
Description copied from class:LifecycleBase
Sub-classes implement this method to perform any instance destruction required.- Specified by:
destroyInternal
in classLifecycleBase
- Throws:
LifecycleException
- If the destruction fails
-
setDomain
Description copied from interface:JmxEnabled
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.- Specified by:
setDomain
in interfaceJmxEnabled
- Parameters:
domain
- The name of the domain under which this component should be registered
-
getDomain
- Specified by:
getDomain
in interfaceJmxEnabled
- Returns:
- the domain under which this component will be / has been registered.
-
getDomainInternal
Method implemented by sub-classes to identify the domain in which MBeans should be registered.- Returns:
- The name of the domain to use to register MBeans.
-
getObjectName
- Specified by:
getObjectName
in interfaceJmxEnabled
- Returns:
- the name under which this component has been registered with JMX.
-
getObjectNameKeyProperties
Allow sub-classes to specify the key properties component of theObjectName
that will be used to register this component.- Returns:
- The string representation of the key properties component of the desired
ObjectName
-
register
Utility method to enable sub-classes to easily register additional components that don't implementJmxEnabled
with an MBean server.
Note: This method should only be used onceinitInternal()
has been called and beforedestroyInternal()
has been called.- Parameters:
obj
- The object the registerobjectNameKeyProperties
- The key properties component of the object name to use to register the object- Returns:
- The name used to register the object
-
unregister
Utility method to enable sub-classes to easily unregister additional components that don't implementJmxEnabled
with an MBean server.
Note: This method should only be used onceinitInternal()
has been called and beforedestroyInternal()
has been called.- Parameters:
objectNameKeyProperties
- The key properties component of the object name to use to unregister the object
-
unregister
Utility method to enable sub-classes to easily unregister additional components that don't implementJmxEnabled
with an MBean server.
Note: This method should only be used onceinitInternal()
has been called and beforedestroyInternal()
has been called.- Parameters:
on
- The name of the component to unregister
-
postDeregister
public final void postDeregister()Not used - NOOP.- Specified by:
postDeregister
in interfaceMBeanRegistration
-
postRegister
Not used - NOOP.- Specified by:
postRegister
in interfaceMBeanRegistration
-
preDeregister
Not used - NOOP.- Specified by:
preDeregister
in interfaceMBeanRegistration
- Throws:
Exception
-
preRegister
- Specified by:
preRegister
in interfaceMBeanRegistration
- Throws:
Exception
-