[id='register_mbeans-{context}']
= Registering MBeans In Custom MBean Servers
{brandname} includes an `MBeanServerLookup` interface that you can use to
register MBeans in custom MBeanServer instances.

.Procedure

. Create an implementation of `MBeanServerLookup` so that the `getMBeanServer()` method returns the custom MBeanServer instance.
. Configure {brandname} with the fully qualified name of your class, as in the following example:

.Declaratively

[source,xml,options="nowrap",subs=attributes+]
----
<cache-container>
   <jmx enabled="true" mbean-server-lookup="com.acme.MyMBeanServerLookup" />
</cache-container>
----

.Programmatically

[source,java]
----
GlobalConfiguration globalConfig = new GlobalConfigurationBuilder()
  .jmx().enable().mBeanServerLookup(new com.acme.MyMBeanServerLookup())
  .build();
----

.Reference

* link:{configdocroot}[{brandname} Configuration Schema]
* link:{javadocroot}/org/infinispan/commons/jmx/MBeanServerLookup.html[MBeanServerLookup]
