Este conteúdo não está disponível no idioma selecionado.

5.4.2. Registering the CacheJmxWrapper with the MBeanServer


The best way to ensure the CacheJmxWrapper is registered in JMX depends on how you are deploying your cache.

5.4.2.1. Programatic Registration with a Cache instance

Simplest way to do this is to create your Cache and pass it to the JmxRegistrationManager constructor.
   CacheFactory factory = new DefaultCacheFactory();
   // Build but do not start the cache
   // (although it would work OK if we started it)
   Cache cache = factory.createCache("cache-configuration.xml");

   MBeanServer server = getMBeanServer(); // however you do it
   ObjectName on = new ObjectName("jboss.cache:service=Cache");
   
   JmxRegistrationManager jmxManager = new JmxRegistrationManager(server, cache, on);
   jmxManager.registerAllMBeans();

   ... use the cache

   ... on application shutdown

   jmxManager.unregisterAllMBeans();
   cache.stop();

Copy to Clipboard Toggle word wrap
Red Hat logoGithubredditYoutubeTwitter

Aprender

Experimente, compre e venda

Comunidades

Sobre a documentação da Red Hat

Ajudamos os usuários da Red Hat a inovar e atingir seus objetivos com nossos produtos e serviços com conteúdo em que podem confiar. Explore nossas atualizações recentes.

Tornando o open source mais inclusivo

A Red Hat está comprometida em substituir a linguagem problemática em nosso código, documentação e propriedades da web. Para mais detalhes veja o Blog da Red Hat.

Sobre a Red Hat

Fornecemos soluções robustas que facilitam o trabalho das empresas em plataformas e ambientes, desde o data center principal até a borda da rede.

Theme

© 2026 Red Hat
Voltar ao topo