Search

26.2.2. Deployment Via a -service.xml File

download PDF
As in JBoss Enterprise Application Platform 4.x, you can also deploy a JBoss Cache instance as an MBean service via a -service.xml file. The primary difference from JBoss Enterprise Application Platform 4.x is the value of the code attribute in the mbean element. In JBoss Enterprise Application Platform 4.x, this was org.jboss.cache.TreeCache; in JBoss Enterprise Application Platform 5.x it is org.jboss.cache.jmx.CacheJmxWrapper. Here's an example:
<?xml version="1.0" encoding="UTF-8"?>

<server>
  <mbean code="org.jboss.cache.jmx.CacfheJmxWrapper" 
         name="foo:service=ExampleCacheJmxWrapper">
      
     <attribute name="TransactionManagerLookupClass">
       org.jboss.cache.transaction.JBossTransactionManagerLookup
     </attribute>
     
     <attribute name="MuxChannelFactory"><inject bean="JChannelFactory"/></attribute>
     
     <attribute name="MultiplexerStack">udp</attribute>
     <attribute name="ClusterName">Example-EntityCache</attribute>        
     <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
     <attribute name="CacheMode">REPL_SYNC</attribute>
     <attribute name="InitialStateRetrievalTimeout">15000</attribute>
     <attribute name="SyncReplTimeout">20000</attribute>
     <attribute name="LockAcquisitionTimeout">15000</attribute>
     <attribute name="ExposeManagementStatistics">true</attribute>
         
  </mbean>
</server>
The CacheJmxWrapper is not the cache itself (i.e. you can't store stuff in it). Rather, as it's name implies, it's a wrapper around an org.jboss.cache.Cache that handles integration with JMX. CacheJmxWrapper exposes the org.jboss.cache.Cache via its CacheJmxWrapperMBean MBean interfaces Cache attribute; services that need the cache can obtain a reference to it via that attribute.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.