Provides supporting infrastructure for registering MBeans with an
javax.management.MBeanServer . The behavior when encountering
an existing MBean at a given
ObjectName is fully configurable
allowing for flexible registration settings.
All registered MBeans are tracked and can be unregistered by calling
the #
MBeanRegistrationSupport.unregisterBeans() method.
Sub-classes can receive notifications when an MBean is registered or
unregistered by overriding the
MBeanRegistrationSupport.onRegister(ObjectName) and
MBeanRegistrationSupport.onUnregister(ObjectName) methods respectively.
By default, the registration process will fail if attempting to
register an MBean using a
javax.management.ObjectName that is
already used.
By setting the
MBeanRegistrationSupport.setRegistrationBehaviorName(String) registrationBehaviorName property to REGISTRATION_IGNORE_EXISTING the registration process
will simply ignore existing MBeans leaving them registered. This is useful in settings
where multiple applications want to share a common MBean in a shared
MBeanServer .
Setting
MBeanRegistrationSupport.setRegistrationBehaviorName(String) registrationBehaviorName property
to REGISTRATION_REPLACE_EXISTING will cause existing MBeans to be replaced
during registration if necessary. This is useful in situations where you can't guarantee
the state of your
MBeanServer .
author: Rob Harrop author: Juergen Hoeller since: 2.0 See Also: MBeanRegistrationSupport.setServer See Also: MBeanRegistrationSupport.setRegistrationBehaviorName See Also: org.springframework.jmx.export.MBeanExporter |