Package com.zfabrik.management
Class MBeanHub
java.lang.Object
com.zfabrik.management.MBeanHub
A convenient place to manage MBeans for resources that may be subject to garbage collection.
Any call to reregister will first unregister all Mbeans that depended on a collected resource.
Register an mbean specifying the dependency resource.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectInstance
registerMBean(IResourceHandle dependency, Object mbean, ObjectName name)
Register an mbean specifying the dependency resource.
-
Constructor Details
-
MBeanHub
public MBeanHub()
-
-
Method Details
-
registerMBean
public static ObjectInstance registerMBean(IResourceHandle dependency, Object mbean, ObjectName name) throws JMExceptionRegister an mbean specifying the dependency resource. If the dependency gets collected, eventually the mbean will be unregistered. If an mbean for the given name was registered before, it will be unregistered before the new mbean gets registered.- Parameters:
dependency
-mbean
-name
-- Returns:
- Throws:
JMException
-