[id='registering-jmx-mbean-servers-{context}']
= Registering MBeans in custom MBean servers
{brandname} includes an `MBeanServerLookup` interface that you can use to
register MBeans in custom MBeanServer instances.

.Prerequisites

* Create an implementation of `MBeanServerLookup` so that the `getMBeanServer()` method returns the custom MBeanServer instance.
* Configure {brandname} to register JMX MBeans.

.Procedure

. Open your {brandname} configuration for editing.
. Add the `mbean-server-lookup` attribute or field to the JMX configuration for the Cache Manager.
. Specify fully qualified name (FQN) of your `MBeanServerLookup` implementation.
. Save and close your client configuration.

[discrete]
== JMX MBean server lookup configuration

.XML
[source,xml,options="nowrap",subs=attributes+,role="primary"]
----
include::xml/jmx_mbean_server_lookup.xml[]
----

.JSON
[source,json,options="nowrap",subs=attributes+,role="secondary"]
----
include::json/jmx_mbean_server_lookup.json[]
----

.YAML
[source,yaml,options="nowrap",subs=attributes+,role="secondary"]
----
include::yaml/jmx_mbean_server_lookup.yaml[]
----

ifdef::embedded_caches[]
.GlobalConfigurationBuilder
[source,java,options="nowrap",subs=attributes+,role="secondary"]
----
include::code_examples/JmxMBeanServerLookup.java[]
----
endif::embedded_caches[]
