5 Replies Latest reply on Jan 29, 2007 1:05 PM by Manik Surtani

    Clearing cache contents in JBoss using GUI

    suman291857 Newbie

      Can anyone advise me how to clear cache using JMX Mbeans.This is the xml file which iam loading

      <?xml version="1.0" encoding="UTF-8" ?>
       <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar" />
       <!-- ==================================================================== -->
       <!-- Defines TreeCache configuration -->
       <!-- ==================================================================== -->
       <mbean code="org.jboss.cache.TreeCache" name="jboss.cache:service=CustomTreeCache">
       <!-- Configure the TransactionManager -->
       <attribute name="TransactionManagerLookupClass">org.jboss.cache.JBossTransactionManagerLookup</attribute>
       Node locking level : SERIALIZABLE
       REPEATABLE_READ (default)
       <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
       <!-- Valid modes are LOCAL
       <attribute name="CacheMode">LOCAL</attribute>
       <!-- The max amount of time (in milliseconds) we wait until the
       initial state (ie. the contents of the cache) are retrieved from
       existing members in a clustered environment
       <attribute name="InitialStateRetrievalTimeout">5000</attribute>
       <!-- Number of milliseconds to wait until all responses for a
       synchronous call have been received.
       <attribute name="SyncReplTimeout">10000</attribute>
       <!-- Max number of milliseconds to wait for a lock acquisition -->
       <attribute name="LockAcquisitionTimeout">15000</attribute>
       <mbean code="org.jboss.cache.TreeCacheView" name="jboss.cache:service=TreeCacheView">
       <attribute name="CacheService">jboss.cache:service=CustomTreeCache</attribute>

      And i have TreeCacheGUI from the JMX console.Even on deleting the Node from TreeCacheGUI ,my code still seems to pick up the old cache contents.
      Hers the code snippet
      ClassPathXmlApplicationContext context = ApplicationContextSingleton.getSpringApplicationContext();
       TreeCacheMBean cacheObj = (TreeCacheMBean)context.getBean(CACHE_SPRING_BEAN_NAME);
      (List<Offer>)cacheObj.get(path, key);

      Can anyone kindly advise?

      Many Thanks