Questo contenuto non è disponibile nella lingua selezionata.

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

Formazione

Prova, acquista e vendi

Community

Informazioni sulla documentazione di Red Hat

Aiutiamo gli utenti Red Hat a innovarsi e raggiungere i propri obiettivi con i nostri prodotti e servizi grazie a contenuti di cui possono fidarsi. Esplora i nostri ultimi aggiornamenti.

Rendiamo l’open source più inclusivo

Red Hat si impegna a sostituire il linguaggio problematico nel codice, nella documentazione e nelle proprietà web. Per maggiori dettagli, visita il Blog di Red Hat.

Informazioni su Red Hat

Forniamo soluzioni consolidate che rendono più semplice per le aziende lavorare su piattaforme e ambienti diversi, dal datacenter centrale all'edge della rete.

Theme

© 2026 Red Hat
Torna in cima