public abstract class LifecycleMBeanBase extends LifecycleBase implements JmxEnabled
Lifecycle.SingleUse
Modifier and Type | Field and Description |
---|---|
protected MBeanServer |
mserver |
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 and Description |
---|
LifecycleMBeanBase() |
Modifier and Type | Method and Description |
---|---|
protected void |
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.
|
String |
getDomain()
Obtain the domain under which this component will be / has been
registered.
|
protected abstract String |
getDomainInternal()
Method implemented by sub-classes to identify the domain in which MBeans
should be registered.
|
ObjectName |
getObjectName()
Obtain the name under which this component has been registered with JMX.
|
protected abstract String |
getObjectNameKeyProperties()
Allow sub-classes to specify the key properties component of the
ObjectName that will be used to register this component. |
protected void |
initInternal()
Sub-classes wishing to perform additional initialization should override
this method, ensuring that super.initInternal() is the first call in the
overriding method.
|
void |
postDeregister()
Not used - NOOP.
|
void |
postRegister(Boolean registrationDone)
Not used - NOOP.
|
void |
preDeregister()
Not used - NOOP.
|
ObjectName |
preRegister(MBeanServer server,
ObjectName name)
Allows the object to be registered with an alternative
MBeanServer and/or ObjectName . |
protected 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. |
void |
setDomain(String domain)
Specify the domain under which this component should be registered.
|
protected void |
unregister(ObjectName on)
Utility method to enable sub-classes to easily unregister additional
components that don't implement
JmxEnabled with an MBean server. |
addLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, removeLifecycleListener, setState, setState, setThrowOnFailure, start, startInternal, stop, stopInternal
protected MBeanServer mserver
protected void initInternal() throws LifecycleException
initInternal
in class LifecycleBase
LifecycleException
- If the initialisation failsprotected void destroyInternal() throws LifecycleException
destroyInternal
in class LifecycleBase
LifecycleException
- If the destruction failspublic final void setDomain(String domain)
setDomain
in interface JmxEnabled
domain
- The name of the domain under which this component should be
registeredpublic final String getDomain()
getDomain
in interface JmxEnabled
protected abstract String getDomainInternal()
public final ObjectName getObjectName()
getObjectName
in interface JmxEnabled
protected abstract String getObjectNameKeyProperties()
ObjectName
that will be used to register this component.ObjectName
protected final ObjectName register(Object obj, String objectNameKeyProperties)
JmxEnabled
with an MBean server.
initInternal()
has
been called and before destroyInternal()
has been called.obj
- The object the registerobjectNameKeyProperties
- The key properties component of the
object name to use to register the
objectprotected final void unregister(ObjectName on)
JmxEnabled
with an MBean server.
initInternal()
has
been called and before destroyInternal()
has been called.on
- The name of the component to unregisterpublic final void postDeregister()
postDeregister
in interface MBeanRegistration
public final void postRegister(Boolean registrationDone)
postRegister
in interface MBeanRegistration
public final void preDeregister() throws Exception
preDeregister
in interface MBeanRegistration
Exception
public final ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception
MBeanServer
and/or ObjectName
.preRegister
in interface MBeanRegistration
Exception
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.