[id='enabling-jmx_{context}']
= Configuring {brandname} to Register JMX MBeans
{brandname} can register JMX MBeans that you can use to collect statistics and
perform administrative operations.
You must enable statistics separately to JMX otherwise {brandname} provides `0` values for all statistic attributes.

.Procedure

Modify your cache container configuration to enable JMX in one of the following ways:

* Declarative: Add the `<jmx enabled="true" />` element to the cache container.
* Programmatic: Call the `.jmx().enable()` method.

.Declarative
[source,xml,options="nowrap",subs=attributes+,role="primary"]
----
include::config_examples/jmx_enabled_cache_container.xml[]
----

.Programmatic
[source,java,options="nowrap",subs=attributes+,role="secondary"]
----
include::code_examples/JmxGlobalConfigurationBuilder.java[]
----
