Class MBeanRegistry
java.lang.Object
org.jolokia.server.core.service.impl.MBeanRegistry
Handler for finding and merging various MBeanServers locally when used
as an agent.
- Since:
- Jun 15, 2009
- Author:
- roland
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voiddestroy()Unregister all previously registered MBean.final ObjectNameregisterMBean(Object pMBean, String... pOptionalName) Register a MBean under a certain name to the platform MBeanServervoidunregisterMBean(ObjectName pObjectName) Unregister a formerly registered MBean.
-
Constructor Details
-
MBeanRegistry
public MBeanRegistry()
-
-
Method Details
-
registerMBean
public final ObjectName registerMBean(Object pMBean, String... pOptionalName) throws MalformedObjectNameException, NotCompliantMBeanException, InstanceAlreadyExistsException, MBeanRegistrationException Register a MBean under a certain name to the platform MBeanServer- Parameters:
pMBean- MBean to registerpOptionalName- optional name under which the bean should be registered. If not provided, it depends on whether the MBean to register implementsMBeanRegistrationor not.- Returns:
- the name under which the MBean is registered.
- Throws:
MalformedObjectNameExceptionNotCompliantMBeanExceptionInstanceAlreadyExistsExceptionMBeanRegistrationException
-
unregisterMBean
Unregister a formerly registered MBean. If the MBean was not registered, the call will be simply ignored- Parameters:
pObjectName- objectname to unregister- Throws:
MBeanRegistrationException- if something fails during unregistration
-
destroy
Unregister all previously registered MBean. This is tried for all previously registered MBeans- Throws:
JMException- if an exception occurs during unregistration
-