[jboss-cvs] JBossCache/src/org/jboss/cache/factories ...

Manik Surtani msurtani at jboss.com
Wed Sep 13 12:04:49 EDT 2006


  User: msurtani
  Date: 06/09/13 12:04:49

  Modified:    src/org/jboss/cache/factories   CacheFactory.java
                        DefaultCacheFactory.java
  Log:
  JBCACHE-762
  
  Revision  Changes    Path
  1.3       +42 -33    JBossCache/src/org/jboss/cache/factories/CacheFactory.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CacheFactory.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/factories/CacheFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- CacheFactory.java	9 Aug 2006 14:50:00 -0000	1.2
  +++ CacheFactory.java	13 Sep 2006 16:04:49 -0000	1.3
  @@ -6,34 +6,42 @@
    */
   package org.jboss.cache.factories;
   
  +import org.jboss.cache.Cache;
   import org.jboss.cache.config.Configuration;
   import org.jboss.cache.config.ConfigurationException;
  -import org.jboss.cache.Cache;
   
   /**
    * This factory constructs a cache from a given configuration set, and is also responsible for managing the lifecycle
    * of the cache.
  - *
  + * <p/>
    * Typical usage would be:
  - *
  + * <p/>
    * <pre>
    *   CacheFactory factory = new CacheFactoryImpl();
    *   Cache cache = factory.createCache("replSync-service.xml"); // expects this file to be in classpath
  - *
  + * <p/>
    *     ...
    *     ...
  - *
  + * <p/>
    *   factory.stopCache( cache );
    * </pre>
    *
  + * @author <a href="mailto:manik at jboss.org">Manik Surtani (manik at jboss.org)</a>
    * @see org.jboss.cache.Cache
    * @since 2.0.0
  - * @author <a href="mailto:manik at jboss.org">Manik Surtani (manik at jboss.org)</a>
    */
   public interface CacheFactory
   {
       /**
  +    * Creates and starts a {@link Cache} instance using default configuration settings.  See {@link Configuration} for default values.
  +    *
  +    * @throws ConfigurationException
  +    */
  +   Cache createCache() throws ConfigurationException;
  +
  +   /**
        * Creates and starts a {@link org.jboss.cache.Cache} instance
  +    *
        * @param configFileName the named XML file should exist in the classpath.
        * @return a running {@link org.jboss.cache.Cache} instance
        */
  @@ -41,6 +49,7 @@
   
       /**
        * Creates {@link Cache} instance, and optionally starts it.
  +    *
        * @param configFileName the named XML file should exist in the classpath.
        * @param start if true, the cache is started before returning.
        * @return an optionally running {@link Cache} instance
  @@ -49,6 +58,7 @@
   
       /**
        * Creates a {@link Cache} instance
  +    *
        * @param configuration the {@link Configuration} object that is passed in to configure the {@link Cache}.
        * @return a running {@link Cache} instance
        */
  @@ -56,11 +66,10 @@
   
       /**
        * Creates {@link Cache} instance, and optionally starts it.
  +    *
        * @param configuration the {@link Configuration} object that is passed in to configure the {@link Cache}.
        * @param start if true, the cache is started before returning.
        * @return an optionally running {@link Cache} instance
        */
       Cache createCache(Configuration configuration, boolean start) throws ConfigurationException;
  -
  -    // TODO: Should there be a way to construct a cache using an existing (and perhaps running) JGroups Channel?
   }
  
  
  
  1.9       +5 -0      JBossCache/src/org/jboss/cache/factories/DefaultCacheFactory.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: DefaultCacheFactory.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/factories/DefaultCacheFactory.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -b -r1.8 -r1.9
  --- DefaultCacheFactory.java	6 Sep 2006 15:30:55 -0000	1.8
  +++ DefaultCacheFactory.java	13 Sep 2006 16:04:49 -0000	1.9
  @@ -18,6 +18,11 @@
    */
   public class DefaultCacheFactory implements CacheFactory
   {
  +   public Cache createCache() throws ConfigurationException
  +   {
  +      return createCache(new Configuration());
  +   }
  +
      public Cache createCache(String configFileName) throws ConfigurationException
      {
         return createCache(configFileName, true);
  
  
  



More information about the jboss-cvs-commits mailing list