Skip to content

Fix deprecated property in MBeanExporter documentation #1991

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions src/docs/asciidoc/integration.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3440,33 +3440,32 @@ The following table summarizes these registration behaviors:
|===
| Registration behavior | Explanation

| `REGISTRATION_FAIL_ON_EXISTING`
| `FAIL_ON_EXISTING`
| This is the default registration behavior. If an `MBean` instance has already been
registered under the same `ObjectName`, the `MBean` that is being registered is not
registered, and an `InstanceAlreadyExistsException` is thrown. The existing
`MBean` is unaffected.

| `REGISTRATION_IGNORE_EXISTING`
| `IGNORE_EXISTING`
| If an `MBean` instance has already been registered under the same `ObjectName`, the
`MBean` that is being registered is not registered. The existing `MBean` is
unaffected, and no `Exception` is thrown. This is useful in settings where
multiple applications want to share a common `MBean` in a shared `MBeanServer`.

| `REGISTRATION_REPLACE_EXISTING`
| `REPLACE_EXISTING`
| If an `MBean` instance has already been registered under the same `ObjectName`, the
existing `MBean` that was previously registered is unregistered, and the new
`MBean` is registered in its place (the new `MBean` effectively replaces the
previous instance).
|===

The values in the preceding table are defined as constants on the `MBeanRegistrationSupport` class (the
`MBeanExporter` class derives from this superclass). If you want to change the default
registration behavior, you need to set the value of the
`registrationBehaviorName` property on your `MBeanExporter` definition to one of those
The values in the preceding table are defined as enums on the `RegistrationPolicy` class.
If you want to change the default registration behavior, you need to set the value of the
`registrationPolicy` property on your `MBeanExporter` definition to one of those
values.

The following example shows how to change from the default registration
behavior to the `REGISTRATION_REPLACE_EXISTING` behavior:
behavior to the `REPLACE_EXISTING` behavior:

====
[source,xml,indent=0]
Expand All @@ -3480,7 +3479,7 @@ behavior to the `REGISTRATION_REPLACE_EXISTING` behavior:
<entry key="bean:name=testBean1" value-ref="testBean"/>
</map>
</property>
<property name="registrationBehaviorName" value="REGISTRATION_REPLACE_EXISTING"/>
<property name="registrationPolicy" value="REPLACE_EXISTING"/>
</bean>

<bean id="testBean" class="org.springframework.jmx.JmxTestBean">
Expand Down