[jbosscache-commits] JBoss Cache SVN: r7027 - core/trunk/src/main/docbook/userguide/en/modules.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Wed Oct 29 09:36:30 EDT 2008


Author: manik.surtani at jboss.com
Date: 2008-10-29 09:36:30 -0400 (Wed, 29 Oct 2008)
New Revision: 7027

Modified:
   core/trunk/src/main/docbook/userguide/en/modules/deployment.xml
Log:
Corrected code sample to remove deprecated classes

Modified: core/trunk/src/main/docbook/userguide/en/modules/deployment.xml
===================================================================
--- core/trunk/src/main/docbook/userguide/en/modules/deployment.xml	2008-10-29 13:21:40 UTC (rev 7026)
+++ core/trunk/src/main/docbook/userguide/en/modules/deployment.xml	2008-10-29 13:36:30 UTC (rev 7027)
@@ -219,33 +219,28 @@
             <title>With a Cache instance</title>
             <para>
                Simplest way to do this is to create your <literal>Cache</literal> and pass it to the
-               <literal>CacheJmxWrapper</literal> constructor.
+               <literal>JmxRegistrationManager</literal> constructor.
             </para>
 
             <programlisting role="JAVA"><![CDATA[
    CacheFactory factory = new DefaultCacheFactory();
    // Build but don't start the cache
    // (although it would work OK if we started it)
-   Cache cache = factory.createCache("cache-configuration.xml", false);
+   Cache cache = factory.createCache("cache-configuration.xml");
 
-   CacheJmxWrapperMBean wrapper = new CacheJmxWrapper(cache);
    MBeanServer server = getMBeanServer(); // however you do it
    ObjectName on = new ObjectName("jboss.cache:service=Cache");
-   server.registerMBean(wrapper, on);
+   
+   JmxRegistrationManager jmxManager = new JmxRegistrationManager(server, cache, on);
+   jmxManager.registerAllMBeans();
 
-   // Invoking lifecycle methods on the wrapper results
-   // in a call through to the cache
-   wrapper.create();
-   wrapper.start();
-
    ... use the cache
 
    ... on application shutdown
 
-   // Invoking lifecycle methods on the wrapper results
-   // in a call through to the cache
-   wrapper.stop();
-   wrapper.destroy();
+   jmxManager.unregisterAllMBeans();
+   cache.stop();
+
             ]]></programlisting>
                </section>
 




More information about the jbosscache-commits mailing list