|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.plugin.jmx.AbstractJmxBridge<MXBean>
public abstract class AbstractJmxBridge<MXBean>
An base class for managing registration and unregistration of a JMX MXBean.
This implementation keeps a weak reference to the underlying implementation so that failing to unregister from the platform MBean server does not leak implementation instances. In the event of usage after the implementation is garbage collected, anIllegalStateException is thrown.
The idiomatic usage of this class is to subclass, pass the MXBean interface type as parameter, directly implement the MXBean
using a strong reference to the required system components, and override getMXBean() to return this. The
register() method will construct a proxy which weakly references this implementation.
| Constructor Summary | |
|---|---|
AbstractJmxBridge(ObjectName objectName,
Class<MXBean> mxBeanClass)
Construct given JMX ObjectName and interface class. |
|
| Method Summary | |
|---|---|
protected abstract MXBean |
getMXBean()
Obtain the actual MXBean implementation. |
ObjectName |
getObjectName()
|
void |
register()
Register the MXBean with the platform MBean server. |
void |
unregister()
Unregister the MXBean from the platform MBean server. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractJmxBridge(ObjectName objectName,
Class<MXBean> mxBeanClass)
objectName - the ObjectName to register under.mxBeanClass - the interface class for the MXBean.| Method Detail |
|---|
protected abstract MXBean getMXBean()
public void register()
public ObjectName getObjectName()
public void unregister()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||