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 #unregisterBeans() method.
Sub-classes can receive notifications when an MBean is registered or
unregistered by overriding the onRegister(ObjectName) and
onUnregister(ObjectName) methods respectively.
By default, the registration process will fail if attempting to
register an MBean using a javax. that is
already used.
By setting the registrationPolicy
property to RegistrationPolicy#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 registrationPolicy property
to RegistrationPolicy#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.
setServer, setRegistrationPolicy, org.springframework.jmx.export.MBeanExporter
| Modifier and Type | Field and Description |
|---|---|
| protected final Log | logger
|
| private final Set | registeredBeans
The beans that have been registered by this exporter. |
| private RegistrationPolicy | registrationPolicy
The policy used when registering an MBean and finding that it already exists. |
| protected MBeanServer | server
The |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | doRegister(Object
the MBean instance mbean, ObjectName the suggested ObjectName for the MBean objectName)Actually register the MBean with the server. |
| protected void | doUnregister(ObjectName
the suggested ObjectName for the MBean objectName)Actually unregister the specified MBean from the server. |
| protected final ObjectName[] | |
| public final MBeanServer | |
| protected void | onRegister(ObjectName
the actual objectName, Object ObjectName that the MBean was registered withthe registered MBean instance mbean)Called when an MBean is registered under the given |
| protected void | onRegister(ObjectName
the actual objectName)ObjectName that the MBean was registered withCalled when an MBean is registered under the given |
| protected void | onUnregister(ObjectName
the objectName)ObjectName that the MBean was registered withCalled when an MBean is unregistered under the given |
| public void | setRegistrationPolicy(RegistrationPolicy
the policy to use registrationPolicy)The policy to use when attempting to register an MBean
under an |
| public void | setServer(MBeanServer server)
Specify the |
| protected void |
| logger | back to summary |
|---|---|
| protected final Log logger
| |
| registeredBeans | back to summary |
|---|---|
| private final Set<ObjectName> registeredBeans The beans that have been registered by this exporter. | |
| registrationPolicy | back to summary |
|---|---|
| private RegistrationPolicy registrationPolicy The policy used when registering an MBean and finding that it already exists. By default an exception is raised. | |
| server | back to summary |
|---|---|
| protected MBeanServer server The | |
| MBeanRegistrationSupport | back to summary |
|---|---|
| public MBeanRegistrationSupport() | |
| doRegister | back to summary |
|---|---|
| protected void doRegister(Object mbean, ObjectName objectName) throws JMException Actually register the MBean with the server. The behavior when encountering
an existing MBean can be configured using
| |
| doUnregister | back to summary |
|---|---|
| protected void doUnregister(ObjectName objectName) Actually unregister the specified MBean from the server.
| |
| getRegisteredObjectNames | back to summary |
|---|---|
| protected final ObjectName[] getRegisteredObjectNames() Return the | |
| getServer | back to summary |
|---|---|
| public final MBeanServer getServer() Return the
| |
| onRegister | back to summary |
|---|---|
| protected void onRegister(ObjectName objectName, Object mbean) Called when an MBean is registered under the given The default implementation delegates to
| |
| onRegister | back to summary |
|---|---|
| protected void onRegister(ObjectName objectName) Called when an MBean is registered under the given The default implementation is empty. Can be overridden in subclasses.
| |
| onUnregister | back to summary |
|---|---|
| protected void onUnregister(ObjectName objectName) Called when an MBean is unregistered under the given The default implementation is empty. Can be overridden in subclasses.
| |
| setRegistrationPolicy | back to summary |
|---|---|
| public void setRegistrationPolicy(RegistrationPolicy registrationPolicy) The policy to use when attempting to register an MBean
under an
| |
| setServer | back to summary |
|---|---|
| public void setServer(MBeanServer server) Specify the | |
| unregisterBeans | back to summary |
|---|---|
| protected void unregisterBeans() Unregisters all beans that have been registered by an instance of this class. | |