Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 18. Monitoring
generate_statistics
property in the configuration.
18.1. About Java Management Extensions (JMX) Copier lienLien copié sur presse-papiers!
MBeans
.
18.1.1. Using JMX with Red Hat JBoss Data Grid Copier lienLien copié sur presse-papiers!
18.1.2. Enable JMX for Cache Instances Copier lienLien copié sur presse-papiers!
Add the following code to programmatically enable JMX at the cache level:
Configuration configuration = new ConfigurationBuilder().jmxStatistics().enable().build();
Configuration configuration = new
ConfigurationBuilder().jmxStatistics().enable().build();
18.1.3. Enable JMX for CacheManagers Copier lienLien copié sur presse-papiers!
CacheManager
level, JMX statistics can be enabled either declaratively or programmatically, as follows.
Add the following code to programmatically enable JMX at the CacheManager
level:
GlobalConfiguration globalConfiguration = new GlobalConfigurationBuilder()..globalJmxStatistics().enable().build();
GlobalConfiguration globalConfiguration = new
GlobalConfigurationBuilder()..globalJmxStatistics().enable().build();
18.1.4. Multiple JMX Domains Copier lienLien copié sur presse-papiers!
CacheManager
instances exist on a single virtual machine, or if the names of cache instances in different CacheManagers
clash.
CacheManager
in manner that allows it to be easily identified and used by monitoring tools such as JMX and JBoss Operations Network.
Add the following code to set the CacheManager
name programmatically:
GlobalConfiguration globalConfiguration = new GlobalConfigurationBuilder().globalJmxStatistics().enable(). cacheManagerName("Hibernate2LC").build();
GlobalConfiguration globalConfiguration = new
GlobalConfigurationBuilder().globalJmxStatistics().enable().
cacheManagerName("Hibernate2LC").build();
18.1.5. Registering MBeans in Non-Default MBean Servers Copier lienLien copié sur presse-papiers!
getMBeanServer()
method returns the desired (non default) MBeanServer.
Add the following code:
GlobalConfiguration globalConfiguration = new GlobalConfigurationBuilder().globalJmxStatistics().enable(). mBeanServerLookup("com.acme.MyMBeanServerLookup").build();
GlobalConfiguration globalConfiguration = new
GlobalConfigurationBuilder().globalJmxStatistics().enable().
mBeanServerLookup("com.acme.MyMBeanServerLookup").build();