19.7. Multiple JMX Domains
Multiple JMX domains are used when multiple
CacheManager
instances exist on a single virtual machine, or if the names of cache instances in different CacheManagers
clash.
To resolve this issue, name each
CacheManager
in manner that allows it to be easily identified and used by monitoring tools such as JMX and JBoss Operations Network.
Set a CacheManager Name Declaratively
Add the following snippet to the relevant CacheManager
configuration:
<globalJmxStatistics enabled="true" cacheManagerName="Hibernate2LC"/>
Set a CacheManager Name Programmatically
Add the following code to set the CacheManager
name programmatically:
GlobalConfiguration globalConfiguration = ... globalConfiguration.setExposeGlobalJmxStatistics(true); globalConfiguration.setCacheManagerName("Hibernate2LC");