[jboss-cvs] JBossCache/tests/interop/org/jboss/cache/interop ...

Brian Stansberry brian.stansberry at jboss.com
Thu Jul 20 17:43:57 EDT 2006


  User: bstansberry
  Date: 06/07/20 17:43:57

  Modified:    tests/interop/org/jboss/cache/interop  Main.java
  Log:
  Use the factory to create the cache
  
  Revision  Changes    Path
  1.4       +17 -9     JBossCache/tests/interop/org/jboss/cache/interop/Main.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Main.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/interop/org/jboss/cache/interop/Main.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- Main.java	20 Jul 2006 16:52:46 -0000	1.3
  +++ Main.java	20 Jul 2006 21:43:57 -0000	1.4
  @@ -22,11 +22,6 @@
   
   package org.jboss.cache.interop;
   
  -import org.apache.commons.logging.Log;
  -import org.apache.commons.logging.LogFactory;
  -import org.jboss.cache.TreeCache;
  -import org.jboss.cache.factories.XmlConfigurationParser;
  -
   import java.io.BufferedInputStream;
   import java.io.ObjectInputStream;
   import java.io.ObjectOutputStream;
  @@ -34,6 +29,14 @@
   import java.net.ServerSocket;
   import java.net.Socket;
   
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogFactory;
  +import org.jboss.cache.Cache;
  +import org.jboss.cache.config.Configuration;
  +import org.jboss.cache.factories.CacheFactory;
  +import org.jboss.cache.factories.DefaultCacheFactory;
  +import org.jboss.cache.factories.XmlConfigurationParser;
  +
   /**
    * Starts a JBossCache instance and then listens on a socket for
    * a call from {@link Shutdown}.
  @@ -51,7 +54,7 @@
      private int listenerPort_ = 11111;
      private String bindAddressString_;
      private ServerSocket srvSock_;
  -   private TreeCache cache_;
  +   private Cache cache_;
      private Thread listenerThread_;
      private boolean stopped;
   
  @@ -170,8 +173,13 @@
      {
         if (cache_ == null)
         {
  -         cache_ = new TreeCache();
  -         cache_.setConfiguration(new XmlConfigurationParser().parseFile(configFile_));
  +         
  +         XmlConfigurationParser parser = new XmlConfigurationParser();
  +         Configuration c = parser.parseFile(configFile_);
  +         
  +         CacheFactory factory = new DefaultCacheFactory();
  +         cache_ = factory.createCache(c, false);
  +         
            cache_.create();
            cache_.start();
   
  
  
  



More information about the jboss-cvs-commits mailing list