Package org.apache.catalina.util
Class LifecycleMBeanBase
- java.lang.Object
-
- org.apache.catalina.util.LifecycleBase
-
- org.apache.catalina.util.LifecycleMBeanBase
-
- All Implemented Interfaces:
javax.management.MBeanRegistration,JmxEnabled,Lifecycle
- Direct Known Subclasses:
Connector,ContainerBase,FailedContext,ManagerBase,MapperListener,NamingResourcesImpl,RealmBase,SimpleTcpCluster,StandardRoot,StandardServer,StandardService,StandardThreadExecutor,StandardVirtualThreadExecutor,ValveBase,WebappLoader
public abstract class LifecycleMBeanBase extends LifecycleBase implements JmxEnabled
-
-
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
Constructors Constructor Description LifecycleMBeanBase()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voiddestroyInternal()Sub-classes implement this method to perform any instance destruction required.java.lang.StringgetDomain()protected abstract java.lang.StringgetDomainInternal()Method implemented by sub-classes to identify the domain in which MBeans should be registered.javax.management.ObjectNamegetObjectName()protected abstract java.lang.StringgetObjectNameKeyProperties()Allow sub-classes to specify the key properties component of theObjectNamethat will be used to register this component.protected voidinitInternal()Sub-classes implement this method to perform any instance initialisation required.voidpostDeregister()Not used - NOOP.voidpostRegister(java.lang.Boolean registrationDone)Not used - NOOP.voidpreDeregister()Not used - NOOP.javax.management.ObjectNamepreRegister(javax.management.MBeanServer server, javax.management.ObjectName name)protected javax.management.ObjectNameregister(java.lang.Object obj, java.lang.String objectNameKeyProperties)Utility method to enable sub-classes to easily register additional components that don't implementJmxEnabledwith an MBean server.voidsetDomain(java.lang.String domain)Specify the domain under which this component should be registered.protected voidunregister(java.lang.String objectNameKeyProperties)Utility method to enable sub-classes to easily unregister additional components that don't implementJmxEnabledwith an MBean server.protected voidunregister(javax.management.ObjectName on)Utility method to enable sub-classes to easily unregister additional components that don't implementJmxEnabledwith 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
-
-
-
-
Method Detail
-
initInternal
protected void initInternal() throws LifecycleExceptionDescription copied from class:LifecycleBaseSub-classes implement this method to perform any instance initialisation required.- Specified by:
initInternalin classLifecycleBase- Throws:
LifecycleException- If the initialisation fails
-
destroyInternal
protected void destroyInternal() throws LifecycleExceptionDescription copied from class:LifecycleBaseSub-classes implement this method to perform any instance destruction required.- Specified by:
destroyInternalin classLifecycleBase- Throws:
LifecycleException- If the destruction fails
-
setDomain
public final void setDomain(java.lang.String domain)
Description copied from interface:JmxEnabledSpecify 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:
setDomainin interfaceJmxEnabled- Parameters:
domain- The name of the domain under which this component should be registered
-
getDomain
public final java.lang.String getDomain()
- Specified by:
getDomainin interfaceJmxEnabled- Returns:
- the domain under which this component will be / has been registered.
-
getDomainInternal
protected abstract java.lang.String 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
public final javax.management.ObjectName getObjectName()
- Specified by:
getObjectNamein interfaceJmxEnabled- Returns:
- the name under which this component has been registered with JMX.
-
getObjectNameKeyProperties
protected abstract java.lang.String getObjectNameKeyProperties()
Allow sub-classes to specify the key properties component of theObjectNamethat will be used to register this component.- Returns:
- The string representation of the key properties component of the desired
ObjectName
-
register
protected final javax.management.ObjectName register(java.lang.Object obj, java.lang.String objectNameKeyProperties)Utility method to enable sub-classes to easily register additional components that don't implementJmxEnabledwith 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
protected final void unregister(java.lang.String objectNameKeyProperties)
Utility method to enable sub-classes to easily unregister additional components that don't implementJmxEnabledwith 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
protected final void unregister(javax.management.ObjectName on)
Utility method to enable sub-classes to easily unregister additional components that don't implementJmxEnabledwith 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:
postDeregisterin interfacejavax.management.MBeanRegistration
-
postRegister
public final void postRegister(java.lang.Boolean registrationDone)
Not used - NOOP.- Specified by:
postRegisterin interfacejavax.management.MBeanRegistration
-
preDeregister
public final void preDeregister() throws java.lang.ExceptionNot used - NOOP.- Specified by:
preDeregisterin interfacejavax.management.MBeanRegistration- Throws:
java.lang.Exception
-
preRegister
public final javax.management.ObjectName preRegister(javax.management.MBeanServer server, javax.management.ObjectName name) throws java.lang.Exception- Specified by:
preRegisterin interfacejavax.management.MBeanRegistration- Throws:
java.lang.Exception
-
-