jtaylor     02/05/23 08:22:23

  Modified:    src/experimental/org/apache/jcs/auxiliary/lateral/http/server
                        AbstractDeleteCacheServlet.java
                        LateralCacheServletReciever.java
               src/experimental/org/apache/jcs/auxiliary/lateral/javagroups
                        LateralCacheJGListener.java
                        LateralGroupCacheJGListener.java
               src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp
                        LateralCacheUDPListener.java
                        LateralGroupCacheUDPListener.java
               src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc
                        LateralCacheXMLRPCListener.java
                        LateralGroupCacheXMLRPCListener.java
               src/java/org/apache/jcs JCS.java JCSComponent.java
               src/java/org/apache/jcs/access CacheAccess.java
                        GroupCacheAccess.java
               src/java/org/apache/jcs/access/monitor MonitorAccess.java
               src/java/org/apache/jcs/admin/servlet JCSAdminServlet.java
               src/java/org/apache/jcs/auxiliary/lateral/socket/tcp
                        LateralTCPListener.java
               src/java/org/apache/jcs/auxiliary/remote
                        RemoteCacheListener.java
               src/java/org/apache/jcs/auxiliary/remote/group
                        RemoteGroupCacheListener.java
               src/java/org/apache/jcs/auxiliary/remote/server
                        RemoteCacheServer.java
                        RemoteCacheServerListener.java
               src/java/org/apache/jcs/auxiliary/remote/server/group
                        RemoteGroupCacheServer.java
               src/java/org/apache/jcs/engine/control
                        CompositeCacheConfigurator.java
               src/java/org/apache/jcs/engine/control/group GroupCache.java
                        GroupCacheHub.java
               src/java/org/apache/jcs/engine/memory MemoryCache.java
               src/java/org/apache/jcs/engine/memory/behavior
                        IMemoryCache.java
               src/java/org/apache/jcs/engine/memory/lru
                        LRUMemoryCache.java
               src/java/org/apache/jcs/engine/memory/mru
                        MRUMemoryCache.java
               src/test/org/apache/jcs/engine/control
                        CompositeCacheManagerTester.java
               src/test/org/apache/jcs/servlet ListTestCacheServlet.java
  Added:       src/java/org/apache/jcs/engine/control CompositeCache.java
                        CompositeCacheManager.java
  Removed:     src/java/org/apache/jcs/engine/control Cache.java
                        CacheHub.java
  Log:
  Renamed Cache -> CompositeCache, CacheHub -> CompositeCacheManager.
  
  Revision  Changes    Path
  1.2       +2 -2      
jakarta-turbine-jcs/src/experimental/org/apache/jcs/auxiliary/lateral/http/server/AbstractDeleteCacheServlet.java
  
  Index: AbstractDeleteCacheServlet.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-jcs/src/experimental/org/apache/jcs/auxiliary/lateral/http/server/AbstractDeleteCacheServlet.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractDeleteCacheServlet.java   17 May 2002 14:02:39 -0000      1.1
  +++ AbstractDeleteCacheServlet.java   23 May 2002 15:22:21 -0000      1.2
  @@ -23,7 +23,7 @@
   import org.apache.jcs.engine.control.group.GroupCacheHub;
   import org.apache.jcs.engine.control.group.GroupCacheHub;
   import org.apache.jcs.engine.control.group.GroupCacheHub;
  -import org.apache.jcs.engine.control.CacheHub;
  +import org.apache.jcs.engine.control.CompositeCacheManager;
   import org.apache.jcs.engine.CacheConstants;
   
   import org.apache.commons.logging.Log;
  @@ -44,7 +44,7 @@
           LogFactory.getLog( AbstractDeleteCacheServlet.class );
   
       /** Description of the Field */
  -    protected CacheHub cacheMgr;
  +    protected CompositeCacheManager cacheMgr;
       private BasicHttpAuthenticator authenticator;
   
   
  
  
  
  1.3       +6 -6      
jakarta-turbine-jcs/src/experimental/org/apache/jcs/auxiliary/lateral/http/server/LateralCacheServletReciever.java
  
  Index: LateralCacheServletReciever.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-jcs/src/experimental/org/apache/jcs/auxiliary/lateral/http/server/LateralCacheServletReciever.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- LateralCacheServletReciever.java  18 May 2002 02:11:31 -0000      1.2
  +++ LateralCacheServletReciever.java  23 May 2002 15:22:21 -0000      1.3
  @@ -14,8 +14,8 @@
   
   import org.apache.jcs.engine.behavior.ICacheElement;
   
  -import org.apache.jcs.engine.control.Cache;
  -import org.apache.jcs.engine.control.CacheHub;
  +import org.apache.jcs.engine.control.CompositeCache;
  +import org.apache.jcs.engine.control.CompositeCacheManager;
   
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  @@ -30,13 +30,13 @@
       private final static Log log =
           LogFactory.getLog( LateralCacheServletReciever.class );
   
  -    private static CacheHub cacheMgr;
  +    private static CompositeCacheManager cacheMgr;
   
       /** Description of the Method */
       public void init( ServletConfig config )
           throws ServletException
       {
  -        cacheMgr = CacheHub.getInstance();
  +        cacheMgr = CompositeCacheManager.getInstance();
   
           super.init( config );
       }
  @@ -51,7 +51,7 @@
   
           if ( cacheMgr == null )
           {
  -            cacheMgr = CacheHub.getInstance();
  +            cacheMgr = CompositeCacheManager.getInstance();
               log.debug( "cacheMgr was null in LateralCacheServlet" );
           }
   
  @@ -90,7 +90,7 @@
               log.debug( "item read in = " + item );
               log.debug( "item.getKey = " + item.getKey() );
   
  -            Cache cache = ( Cache ) cacheMgr.getCache( hashtableName );
  +            CompositeCache cache = ( CompositeCache ) cacheMgr.getCache( 
hashtableName );
               try
               {
                   // need to set as from lateral
  
  
  
  1.2       +4 -4      
jakarta-turbine-jcs/src/experimental/org/apache/jcs/auxiliary/lateral/javagroups/LateralCacheJGListener.java
  
  Index: LateralCacheJGListener.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-jcs/src/experimental/org/apache/jcs/auxiliary/lateral/javagroups/LateralCacheJGListener.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LateralCacheJGListener.java       17 May 2002 14:02:39 -0000      1.1
  +++ LateralCacheJGListener.java       23 May 2002 15:22:21 -0000      1.2
  @@ -67,7 +67,7 @@
   import org.apache.jcs.engine.behavior.ICache;
   import org.apache.jcs.engine.behavior.ICacheElement;
   import org.apache.jcs.engine.behavior.ICompositeCache;
  -import org.apache.jcs.engine.control.CacheHub;
  +import org.apache.jcs.engine.control.CompositeCacheManager;
   import org.apache.jcs.engine.CacheConstants;
   
   import org.apache.commons.logging.Log;
  @@ -89,7 +89,7 @@
       /**
        * Description of the Field
        */
  -    protected static transient CacheHub cacheMgr;
  +    protected static transient CompositeCacheManager cacheMgr;
       /**
        * Description of the Field
        */
  @@ -313,7 +313,7 @@
           {
               log.debug( "handleDispose> cacheName=" + cacheName );
           }
  -        CacheHub cm = ( CacheHub ) cacheMgr;
  +        CompositeCacheManager cm = ( CompositeCacheManager ) cacheMgr;
           cm.freeCache( cacheName, true );
       }
   
  @@ -326,7 +326,7 @@
       {
           if ( cacheMgr == null )
           {
  -            cacheMgr = CacheHub.getInstance();
  +            cacheMgr = CompositeCacheManager.getInstance();
   
               if ( log.isDebugEnabled() )
               {
  
  
  
  1.2       +2 -2      
jakarta-turbine-jcs/src/experimental/org/apache/jcs/auxiliary/lateral/javagroups/LateralGroupCacheJGListener.java
  
  Index: LateralGroupCacheJGListener.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-jcs/src/experimental/org/apache/jcs/auxiliary/lateral/javagroups/LateralGroupCacheJGListener.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LateralGroupCacheJGListener.java  17 May 2002 14:02:39 -0000      1.1
  +++ LateralGroupCacheJGListener.java  23 May 2002 15:22:21 -0000      1.2
  @@ -57,7 +57,7 @@
   import org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheListener;
   import org.apache.jcs.auxiliary.lateral.javagroups.behavior.ILateralCacheJGListener;
   
  -import org.apache.jcs.engine.control.CacheHub;
  +import org.apache.jcs.engine.control.CompositeCacheManager;
   
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  @@ -128,7 +128,7 @@
           {
               if ( cacheMgr == null )
               {
  -                cacheMgr = CacheHub.getInstance();
  +                cacheMgr = CompositeCacheManager.getInstance();
                   if ( log.isDebugEnabled() )
                   {
                       log.debug( " groupcache cacheMgr = " + cacheMgr );
  
  
  
  1.2       +4 -4      
jakarta-turbine-jcs/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralCacheUDPListener.java
  
  Index: LateralCacheUDPListener.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-jcs/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralCacheUDPListener.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LateralCacheUDPListener.java      17 May 2002 14:02:39 -0000      1.1
  +++ LateralCacheUDPListener.java      23 May 2002 15:22:21 -0000      1.2
  @@ -14,7 +14,7 @@
   import org.apache.jcs.engine.behavior.ICacheElement;
   import org.apache.jcs.engine.behavior.ICompositeCache;
   
  -import org.apache.jcs.engine.control.CacheHub;
  +import org.apache.jcs.engine.control.CompositeCacheManager;
   import org.apache.jcs.engine.CacheConstants;
   
   import org.apache.commons.logging.Log;
  @@ -34,7 +34,7 @@
           LogFactory.getLog( LateralCacheUDPListener.class );
   
       /** Description of the Field */
  -    protected static transient CacheHub cacheMgr;
  +    protected static transient CompositeCacheManager cacheMgr;
   
       /** Description of the Field */
       protected final static HashMap instances = new HashMap();
  @@ -197,7 +197,7 @@
           {
               log.debug( "handleDispose> cacheName=" + cacheName );
           }
  -        CacheHub cm = ( CacheHub ) cacheMgr;
  +        CompositeCacheManager cm = ( CompositeCacheManager ) cacheMgr;
           cm.freeCache( cacheName, true );
       }
   
  @@ -210,7 +210,7 @@
       {
           if ( cacheMgr == null )
           {
  -            cacheMgr = CacheHub.getInstance();
  +            cacheMgr = CompositeCacheManager.getInstance();
   
               if ( log.isDebugEnabled() )
               {
  
  
  
  1.2       +2 -2      
jakarta-turbine-jcs/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralGroupCacheUDPListener.java
  
  Index: LateralGroupCacheUDPListener.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-jcs/src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralGroupCacheUDPListener.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LateralGroupCacheUDPListener.java 17 May 2002 14:02:40 -0000      1.1
  +++ LateralGroupCacheUDPListener.java 23 May 2002 15:22:21 -0000      1.2
  @@ -9,7 +9,7 @@
   import org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheListener;
   import org.apache.jcs.engine.behavior.ICacheElement;
   import org.apache.jcs.engine.behavior.ICompositeCache;
  -import org.apache.jcs.engine.control.CacheHub;
  +import org.apache.jcs.engine.control.CompositeCacheManager;
   import org.apache.jcs.engine.control.group.GroupAttrName;
   
   /**
  @@ -116,7 +116,7 @@
           {
               if ( cacheMgr == null )
               {
  -                cacheMgr = CacheHub.getInstance();
  +                cacheMgr = CompositeCacheManager.getInstance();
   
                   if ( log.isDebugEnabled() )
                   {
  
  
  
  1.2       +4 -4      
jakarta-turbine-jcs/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralCacheXMLRPCListener.java
  
  Index: LateralCacheXMLRPCListener.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-jcs/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralCacheXMLRPCListener.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LateralCacheXMLRPCListener.java   17 May 2002 14:02:40 -0000      1.1
  +++ LateralCacheXMLRPCListener.java   23 May 2002 15:22:21 -0000      1.2
  @@ -67,7 +67,7 @@
   import org.apache.jcs.engine.behavior.ICache;
   import org.apache.jcs.engine.behavior.ICacheElement;
   import org.apache.jcs.engine.behavior.ICompositeCache;
  -import org.apache.jcs.engine.control.CacheHub;
  +import org.apache.jcs.engine.control.CompositeCacheManager;
   import org.apache.jcs.engine.CacheConstants;
   
   import org.apache.commons.logging.Log;
  @@ -87,7 +87,7 @@
           LogFactory.getLog( LateralCacheXMLRPCListener.class );
   
       /** Description of the Field */
  -    protected static transient CacheHub cacheMgr;
  +    protected static transient CompositeCacheManager cacheMgr;
       /** Description of the Field */
       protected final static HashMap instances = new HashMap();
   
  @@ -267,7 +267,7 @@
           {
               log.debug( "handleDispose> cacheName=" + cacheName );
           }
  -        CacheHub cm = ( CacheHub ) cacheMgr;
  +        CompositeCacheManager cm = ( CompositeCacheManager ) cacheMgr;
           cm.freeCache( cacheName, CacheConstants.REMOTE_INVOKATION );
       }
   
  @@ -280,7 +280,7 @@
       {
           if ( cacheMgr == null )
           {
  -            cacheMgr = CacheHub.getInstance();
  +            cacheMgr = CompositeCacheManager.getInstance();
               if ( log.isDebugEnabled() )
               {
                   log.debug( "cacheMgr = " + cacheMgr );
  
  
  
  1.2       +2 -2      
jakarta-turbine-jcs/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralGroupCacheXMLRPCListener.java
  
  Index: LateralGroupCacheXMLRPCListener.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-jcs/src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralGroupCacheXMLRPCListener.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LateralGroupCacheXMLRPCListener.java      17 May 2002 14:02:40 -0000      1.1
  +++ LateralGroupCacheXMLRPCListener.java      23 May 2002 15:22:21 -0000      1.2
  @@ -57,7 +57,7 @@
   import org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheListener;
   import org.apache.jcs.auxiliary.lateral.xmlrpc.behavior.ILateralCacheXMLRPCListener;
   
  -import org.apache.jcs.engine.control.CacheHub;
  +import org.apache.jcs.engine.control.CompositeCacheManager;
   
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  @@ -128,7 +128,7 @@
           {
               if ( cacheMgr == null )
               {
  -                cacheMgr = CacheHub.getInstance();
  +                cacheMgr = CompositeCacheManager.getInstance();
                   if ( log.isDebugEnabled() )
                   {
                       log.debug( " groupcache cacheMgr = " + cacheMgr );
  
  
  
  1.5       +7 -7      jakarta-turbine-jcs/src/java/org/apache/jcs/JCS.java
  
  Index: JCS.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-jcs/src/java/org/apache/jcs/JCS.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- JCS.java  12 Apr 2002 01:39:57 -0000      1.4
  +++ JCS.java  23 May 2002 15:22:22 -0000      1.5
  @@ -57,8 +57,8 @@
   import org.apache.jcs.access.GroupCacheAccess;
   import org.apache.jcs.access.exception.CacheException;
   import org.apache.jcs.engine.behavior.ICompositeCacheAttributes;
  -import org.apache.jcs.engine.control.Cache;
  -import org.apache.jcs.engine.control.CacheHub;
  +import org.apache.jcs.engine.control.CompositeCache;
  +import org.apache.jcs.engine.control.CompositeCacheManager;
   import org.apache.jcs.engine.control.group.GroupCacheHub;
   
   /**
  @@ -71,20 +71,20 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Aaron Smuts</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>James Taylor</a>
  - * @version $Id: JCS.java,v 1.4 2002/04/12 01:39:57 jtaylor Exp $
  + * @version $Id: JCS.java,v 1.5 2002/05/23 15:22:22 jtaylor Exp $
    */
   public class JCS extends GroupCacheAccess
   {
       private static String configFilename = null;
   
  -    private static CacheHub cacheMgr;
  +    private static CompositeCacheManager cacheMgr;
   
       /**
        * Protected constructor for use by the static factory methods.
        *
        * @param cacheControl Cache which the instance will provide access to
        */
  -    protected JCS( Cache cacheControl )
  +    protected JCS( CompositeCache cacheControl )
       {
           super( cacheControl );
       }
  @@ -101,7 +101,7 @@
       {
           ensureCacheManager();
   
  -        return new JCS( ( Cache ) cacheMgr.getCache( region ) );
  +        return new JCS( ( CompositeCache ) cacheMgr.getCache( region ) );
       }
   
       /**
  @@ -118,7 +118,7 @@
       {
           ensureCacheManager();
   
  -        return new JCS( ( Cache ) cacheMgr.getCache( region, icca ) );
  +        return new JCS( ( CompositeCache ) cacheMgr.getCache( region, icca ) );
       }
   
       /**
  
  
  
  1.3       +3 -3      jakarta-turbine-jcs/src/java/org/apache/jcs/JCSComponent.java
  
  Index: JCSComponent.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-jcs/src/java/org/apache/jcs/JCSComponent.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JCSComponent.java 19 Apr 2002 08:26:28 -0000      1.2
  +++ JCSComponent.java 23 May 2002 15:22:22 -0000      1.3
  @@ -1,7 +1,7 @@
   package org.apache.jcs;
   
   import org.apache.commons.lang.exception.NestableException;
  -import org.apache.jcs.engine.control.CacheHub;
  +import org.apache.jcs.engine.control.CompositeCacheManager;
   import org.apache.jcs.engine.control.group.GroupCacheHub;
   import org.apache.commons.configuration.Configuration;
   import org.apache.commons.configuration.ConfigurationConverter;
  @@ -13,7 +13,7 @@
    * be accessed through {@link JCS}.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>James Taylor</a>
  - * @version $Id: JCSComponent.java,v 1.2 2002/04/19 08:26:28 mpoeschl Exp $
  + * @version $Id: JCSComponent.java,v 1.3 2002/05/23 15:22:22 jtaylor Exp $
    */
   public class JCSComponent
       implements Configurable, Initializable
  @@ -30,7 +30,7 @@
       /** @see Initializable#initialize */
       public void initialize() throws Exception
       {
  -        CacheHub instance = GroupCacheHub.getUnconfiguredInstance();
  +        CompositeCacheManager instance = GroupCacheHub.getUnconfiguredInstance();
   
           instance.configure(
               ConfigurationConverter.getProperties( configuration ) );
  
  
  
  1.7       +12 -12    
jakarta-turbine-jcs/src/java/org/apache/jcs/access/CacheAccess.java
  
  Index: CacheAccess.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-jcs/src/java/org/apache/jcs/access/CacheAccess.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- CacheAccess.java  17 May 2002 14:12:51 -0000      1.6
  +++ CacheAccess.java  23 May 2002 15:22:22 -0000      1.7
  @@ -69,8 +69,8 @@
   import org.apache.jcs.engine.behavior.ICompositeCacheAttributes;
   import org.apache.jcs.engine.behavior.ICacheElement;
   
  -import org.apache.jcs.engine.control.Cache;
  -import org.apache.jcs.engine.control.CacheHub;
  +import org.apache.jcs.engine.control.CompositeCache;
  +import org.apache.jcs.engine.control.CompositeCacheManager;
   
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  @@ -82,7 +82,7 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Aaron Smuts</a>
    * @created February 13, 2002
  - * @version $Id: CacheAccess.java,v 1.6 2002/05/17 14:12:51 jtaylor Exp $
  + * @version $Id: CacheAccess.java,v 1.7 2002/05/23 15:22:22 jtaylor Exp $
    */
   public class CacheAccess implements ICacheAccess
   {
  @@ -92,20 +92,20 @@
       /**
        * Cache manager use by the various forms of defineRegion and getAccess
        */
  -    private static CacheHub cacheMgr;
  +    private static CompositeCacheManager cacheMgr;
   
       /**
        * Cache that a given instance of this class provides access to. Should this
        * be the inteface?
        */
  -    protected Cache cacheControl;
  +    protected CompositeCache cacheControl;
   
       /**
        * Constructor for the CacheAccess object.
        *
        * @param cacheControl The cache which the created instance accesses
        */
  -    protected CacheAccess( Cache cacheControl )
  +    protected CacheAccess( CompositeCache cacheControl )
       {
           this.cacheControl = cacheControl;
       }
  @@ -130,7 +130,7 @@
       {
           ensureCacheManager();
   
  -        return new CacheAccess( ( Cache ) cacheMgr.getCache( name ) );
  +        return new CacheAccess( ( CompositeCache ) cacheMgr.getCache( name ) );
       }
   
       /**
  @@ -147,7 +147,7 @@
       {
           ensureCacheManager();
   
  -        return new CacheAccess( ( Cache ) cacheMgr.getCache( name, cattr ) );
  +        return new CacheAccess( ( CompositeCache ) cacheMgr.getCache( name, cattr ) 
);
       }
   
       /**
  @@ -168,7 +168,7 @@
           ensureCacheManager();
   
           return new CacheAccess(
  -            ( Cache ) cacheMgr.getCache( name, cattr, attr ) );
  +            ( CompositeCache ) cacheMgr.getCache( name, cattr, attr ) );
       }
   
       /**
  @@ -183,7 +183,7 @@
       {
           ensureCacheManager();
   
  -        return new CacheAccess( ( Cache ) cacheMgr.getCache( region ) );
  +        return new CacheAccess( ( CompositeCache ) cacheMgr.getCache( region ) );
       }
   
       /**
  @@ -201,7 +201,7 @@
       {
           ensureCacheManager();
   
  -        return new CacheAccess( ( Cache ) cacheMgr.getCache( region, icca ) );
  +        return new CacheAccess( ( CompositeCache ) cacheMgr.getCache( region, icca 
) );
       }
   
       /**
  @@ -216,7 +216,7 @@
               {
                   if ( cacheMgr == null )
                   {
  -                    cacheMgr = CacheHub.getInstance();
  +                    cacheMgr = CompositeCacheManager.getInstance();
                   }
               }
           }
  
  
  
  1.6       +6 -6      
jakarta-turbine-jcs/src/java/org/apache/jcs/access/GroupCacheAccess.java
  
  Index: GroupCacheAccess.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-jcs/src/java/org/apache/jcs/access/GroupCacheAccess.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- GroupCacheAccess.java     6 May 2002 19:01:52 -0000       1.5
  +++ GroupCacheAccess.java     23 May 2002 15:22:22 -0000      1.6
  @@ -68,8 +68,8 @@
   import org.apache.jcs.engine.behavior.ICompositeCacheAttributes;
   import org.apache.jcs.engine.behavior.IElementAttributes;
   import org.apache.jcs.engine.behavior.ICacheElement;
  -import org.apache.jcs.engine.control.Cache;
  -import org.apache.jcs.engine.control.CacheHub;
  +import org.apache.jcs.engine.control.CompositeCache;
  +import org.apache.jcs.engine.control.CompositeCacheManager;
   import org.apache.jcs.engine.control.group.GroupAttrName;
   import org.apache.jcs.engine.control.group.GroupCacheHub;
   import org.apache.jcs.engine.control.group.GroupId;
  @@ -88,14 +88,14 @@
       private static boolean SET_ATTR_INVOCATION = true;
       private static boolean REMOVE_ATTR_INVOCATION = false;
   
  -    private static CacheHub cacheMgr;
  +    private static CompositeCacheManager cacheMgr;
   
       /**
        * Constructor for the GroupCacheAccess object
        *
        * @param cacheControl
        */
  -    protected GroupCacheAccess( Cache cacheControl )
  +    protected GroupCacheAccess( CompositeCache cacheControl )
       {
           super( cacheControl );
       }
  @@ -118,7 +118,7 @@
                   }
               }
           }
  -        return new GroupCacheAccess( ( Cache ) cacheMgr.getCache( region ) );
  +        return new GroupCacheAccess( ( CompositeCache ) cacheMgr.getCache( region ) 
);
       }
   
       /**
  @@ -140,7 +140,7 @@
               }
           }
   
  -        return new GroupCacheAccess( ( Cache ) cacheMgr.getCache( region, icca ) );
  +        return new GroupCacheAccess( ( CompositeCache ) cacheMgr.getCache( region, 
icca ) );
       }
   
       /**
  
  
  
  1.5       +2 -2      
jakarta-turbine-jcs/src/java/org/apache/jcs/access/monitor/MonitorAccess.java
  
  Index: MonitorAccess.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-jcs/src/java/org/apache/jcs/access/monitor/MonitorAccess.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- MonitorAccess.java        10 Apr 2002 15:00:59 -0000      1.4
  +++ MonitorAccess.java        23 May 2002 15:22:22 -0000      1.5
  @@ -10,7 +10,7 @@
   import org.apache.commons.logging.LogFactory;
   import org.apache.jcs.access.GroupCacheAccess;
   import org.apache.jcs.engine.behavior.ICache;
  -import org.apache.jcs.engine.control.CacheHub;
  +import org.apache.jcs.engine.control.CompositeCacheManager;
   import org.apache.jcs.engine.control.group.GroupCacheHub;
   import org.apache.jcs.engine.CacheConstants;
   
  @@ -26,7 +26,7 @@
           LogFactory.getLog( MonitorAccess.class );
   
       /** Description of the Field */
  -    protected CacheHub cacheMgr;
  +    protected CompositeCacheManager cacheMgr;
   
       /** Constructor for the MonitorAccess object */
       public MonitorAccess()
  
  
  
  1.2       +8 -8      
jakarta-turbine-jcs/src/java/org/apache/jcs/admin/servlet/JCSAdminServlet.java
  
  Index: JCSAdminServlet.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-jcs/src/java/org/apache/jcs/admin/servlet/JCSAdminServlet.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JCSAdminServlet.java      20 May 2002 17:05:23 -0000      1.1
  +++ JCSAdminServlet.java      23 May 2002 15:22:22 -0000      1.2
  @@ -14,8 +14,8 @@
   import org.apache.jcs.engine.memory.MemoryCache;
   import org.apache.jcs.engine.memory.MemoryElementDescriptor;
   import org.apache.jcs.engine.behavior.ICache;
  -import org.apache.jcs.engine.control.CacheHub;
  -import org.apache.jcs.engine.control.Cache;
  +import org.apache.jcs.engine.control.CompositeCacheManager;
  +import org.apache.jcs.engine.control.CompositeCache;
   import org.apache.velocity.Template;
   import org.apache.velocity.context.Context;
   import org.apache.velocity.servlet.VelocityServlet;
  @@ -47,7 +47,7 @@
    *        precedence.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>James Taylor</a>
  - * @version $Id: JCSAdminServlet.java,v 1.1 2002/05/20 17:05:23 jtaylor Exp $
  + * @version $Id: JCSAdminServlet.java,v 1.2 2002/05/23 15:22:22 jtaylor Exp $
    */
   public class JCSAdminServlet extends VelocityServlet
   {
  @@ -72,7 +72,7 @@
       private static final String REMOVE_ACTION = "remove";
       private static final String DETAIL_ACTION = "detail";
   
  -    private CacheHub cacheHub = CacheHub.getInstance();
  +    private CompositeCacheManager cacheHub = CompositeCacheManager.getInstance();
   
       /** @see org.apache.velocity.servlet.VelocityServlet#handleRequest */
       protected Template handleRequest( HttpServletRequest request,
  @@ -150,7 +150,7 @@
   
       private Object[] getSortedKeys( String cacheName )
       {
  -        Cache cache = ( Cache ) cacheHub.getCache( cacheName );
  +        CompositeCache cache = ( CompositeCache ) cacheHub.getCache( cacheName );
   
           Object[] keys = cache.getMemoryCache().getKeyArray();
   
  @@ -168,11 +168,11 @@
           LinkedList cacheInfo = new LinkedList();
   
           CacheRegionInfo regionInfo;
  -        Cache cache;
  +        CompositeCache cache;
   
           for ( int i = 0; i < cacheNames.length; i++ )
           {
  -            cache = ( Cache ) cacheHub.getCache( cacheNames[ i ] );
  +            cache = ( CompositeCache ) cacheHub.getCache( cacheNames[ i ] );
   
               regionInfo = new CacheRegionInfo();
   
  @@ -187,7 +187,7 @@
           return cacheInfo;
       }
   
  -    public int getByteCount( Cache cache )
  +    public int getByteCount( CompositeCache cache )
           throws Exception
       {
           MemoryCache memCache = cache.getMemoryCache();
  
  
  
  1.3       +5 -5      
jakarta-turbine-jcs/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPListener.java
  
  Index: LateralTCPListener.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-jcs/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPListener.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- LateralTCPListener.java   18 May 2002 02:11:31 -0000      1.2
  +++ LateralTCPListener.java   23 May 2002 15:22:22 -0000      1.3
  @@ -72,13 +72,13 @@
   import org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheListener;
   import org.apache.jcs.engine.behavior.ICacheElement;
   import org.apache.jcs.engine.behavior.ICompositeCache;
  -import org.apache.jcs.engine.control.CacheHub;
  +import org.apache.jcs.engine.control.CompositeCacheManager;
   
   /**
    * Listens for connections from other TCP lateral caches and handles them.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Aaron Smuts</a>
  - * @version $Id: LateralTCPListener.java,v 1.2 2002/05/18 02:11:31 jtaylor Exp $
  + * @version $Id: LateralTCPListener.java,v 1.3 2002/05/23 15:22:22 jtaylor Exp $
    */
   public class LateralTCPListener
       implements ILateralCacheListener, Serializable
  @@ -90,7 +90,7 @@
       private final static int acceptTimeOut = 0;
   
       /** The CacheHub this listener is associated with */
  -    protected static transient CacheHub cacheMgr;
  +    protected static transient CompositeCacheManager cacheMgr;
   
       /** Map of available instances, keyed by port */
       protected final static HashMap instances = new HashMap();
  @@ -258,7 +258,7 @@
               log.debug( "handleDispose> cacheName=" + cacheName );
           }
   
  -        CacheHub cm = ( CacheHub ) cacheMgr;
  +        CompositeCacheManager cm = ( CompositeCacheManager ) cacheMgr;
           cm.freeCache( cacheName, true );
       }
   
  @@ -269,7 +269,7 @@
       {
           if ( cacheMgr == null )
           {
  -            cacheMgr = CacheHub.getInstance();
  +            cacheMgr = CompositeCacheManager.getInstance();
   
               if ( log.isDebugEnabled() )
               {
  
  
  
  1.5       +6 -6      
jakarta-turbine-jcs/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheListener.java
  
  Index: RemoteCacheListener.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-jcs/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheListener.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- RemoteCacheListener.java  17 May 2002 14:12:52 -0000      1.4
  +++ RemoteCacheListener.java  23 May 2002 15:22:22 -0000      1.5
  @@ -17,9 +17,9 @@
   import org.apache.jcs.engine.behavior.ICacheManager;
   import org.apache.jcs.engine.behavior.ICompositeCache;
   
  -import org.apache.jcs.engine.control.Cache;
  +import org.apache.jcs.engine.control.CompositeCache;
   
  -import org.apache.jcs.engine.control.CacheHub;
  +import org.apache.jcs.engine.control.CompositeCacheManager;
   import org.apache.jcs.engine.CacheConstants;
   
   import org.apache.commons.logging.Log;
  @@ -41,7 +41,7 @@
           LogFactory.getLog( RemoteCacheListener.class );
   
       /** Description of the Field */
  -    protected static transient CacheHub cacheMgr;
  +    protected static transient CompositeCacheManager cacheMgr;
   
       /** Description of the Field */
       protected static IRemoteCacheListener instance;
  @@ -230,7 +230,7 @@
           }
   
           getCacheManager();
  -        Cache cache = ( Cache ) cacheMgr.getCache( cacheName );
  +        CompositeCache cache = ( CompositeCache ) cacheMgr.getCache( cacheName );
   
           cache.localRemove( key );
       }
  @@ -258,7 +258,7 @@
           {
               log.debug( "handleDispose> cacheName=" + cacheName );
           }
  -        CacheHub cm = ( CacheHub ) cacheMgr;
  +        CompositeCacheManager cm = ( CompositeCacheManager ) cacheMgr;
           cm.freeCache( cacheName, true);
       }
   
  @@ -271,7 +271,7 @@
       {
           if ( cacheMgr == null )
           {
  -            cacheMgr = CacheHub.getInstance();
  +            cacheMgr = CompositeCacheManager.getInstance();
               log.debug( "had to get cacheMgr" );
               if ( log.isDebugEnabled() )
               {
  
  
  
  1.5       +2 -2      
jakarta-turbine-jcs/src/java/org/apache/jcs/auxiliary/remote/group/RemoteGroupCacheListener.java
  
  Index: RemoteGroupCacheListener.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-jcs/src/java/org/apache/jcs/auxiliary/remote/group/RemoteGroupCacheListener.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- RemoteGroupCacheListener.java     17 May 2002 14:12:52 -0000      1.4
  +++ RemoteGroupCacheListener.java     23 May 2002 15:22:22 -0000      1.5
  @@ -26,7 +26,7 @@
   import org.apache.jcs.engine.control.group.GroupCache;
   import org.apache.jcs.engine.control.group.GroupCache;
   import org.apache.jcs.engine.control.group.GroupCache;
  -import org.apache.jcs.engine.control.CacheHub;
  +import org.apache.jcs.engine.control.CompositeCacheManager;
   import org.apache.jcs.engine.CacheConstants;
   
   import org.apache.commons.logging.Log;
  @@ -215,7 +215,7 @@
           {
               if ( cacheMgr == null )
               {
  -                cacheMgr = CacheHub.getInstance();
  +                cacheMgr = CompositeCacheManager.getInstance();
                   if ( log.isDebugEnabled() )
                   {
                       log.debug( " groupcache cacheMgr = " + cacheMgr );
  
  
  
  1.7       +4 -4      
jakarta-turbine-jcs/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServer.java
  
  Index: RemoteCacheServer.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-jcs/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServer.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- RemoteCacheServer.java    17 May 2002 14:12:52 -0000      1.6
  +++ RemoteCacheServer.java    23 May 2002 15:22:22 -0000      1.7
  @@ -33,7 +33,7 @@
   import org.apache.jcs.engine.behavior.ICacheListener;
   import org.apache.jcs.engine.behavior.ICompositeCache;
   
  -import org.apache.jcs.engine.control.CacheHub;
  +import org.apache.jcs.engine.control.CompositeCacheManager;
   
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  @@ -65,7 +65,7 @@
       // association of listeners (regions).
       private final Hashtable cacheListenersMap = new Hashtable();
       private final Hashtable clusterListenersMap = new Hashtable();
  -    private CacheHub cacheManager;
  +    private CompositeCacheManager cacheManager;
   
       // relates listener id with a type
       private final Hashtable idTypeMap = new Hashtable();
  @@ -120,9 +120,9 @@
       /**
        * Subclass can overrdie this method to create the specific cache manager.
        */
  -    protected CacheHub createCacheManager( String prop )
  +    protected CompositeCacheManager createCacheManager( String prop )
       {
  -        CacheHub hub = CacheHub.getUnconfiguredInstance();
  +        CompositeCacheManager hub = CompositeCacheManager.getUnconfiguredInstance();
   
           if ( prop == null )
           {
  
  
  
  1.5       +6 -6      
jakarta-turbine-jcs/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerListener.java
  
  Index: RemoteCacheServerListener.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-jcs/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerListener.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- RemoteCacheServerListener.java    17 May 2002 14:12:52 -0000      1.4
  +++ RemoteCacheServerListener.java    23 May 2002 15:22:22 -0000      1.5
  @@ -17,8 +17,8 @@
   import org.apache.jcs.engine.behavior.ICacheManager;
   import org.apache.jcs.engine.behavior.ICompositeCache;
   
  -import org.apache.jcs.engine.control.Cache;
  -import org.apache.jcs.engine.control.CacheHub;
  +import org.apache.jcs.engine.control.CompositeCache;
  +import org.apache.jcs.engine.control.CompositeCacheManager;
   import org.apache.jcs.engine.CacheConstants;
   
   import org.apache.commons.logging.Log;
  @@ -39,7 +39,7 @@
           LogFactory.getLog( RemoteCacheServerListener.class );
   
       /** Description of the Field */
  -    protected static transient CacheHub cacheMgr;
  +    protected static transient CompositeCacheManager cacheMgr;
   
       /** Description of the Field */
       protected static IRemoteCacheListener instance;
  @@ -213,7 +213,7 @@
           getCacheManager();
           // interface limitation here
   
  -        Cache cache = ( Cache ) cacheMgr.getCache( cacheName );
  +        CompositeCache cache = ( CompositeCache ) cacheMgr.getCache( cacheName );
           cache.localRemove( key );
       }
   
  @@ -240,7 +240,7 @@
           {
               log.debug( "handleDispose> cacheName=" + cacheName );
           }
  -        CacheHub cm = ( CacheHub ) cacheMgr;
  +        CompositeCacheManager cm = ( CompositeCacheManager ) cacheMgr;
           cm.freeCache( cacheName, true );
       }
   
  @@ -253,7 +253,7 @@
       {
           if ( cacheMgr == null )
           {
  -            cacheMgr = CacheHub.getInstance();
  +            cacheMgr = CompositeCacheManager.getInstance();
   
               if ( log.isDebugEnabled() )
               {
  
  
  
  1.4       +2 -2      
jakarta-turbine-jcs/src/java/org/apache/jcs/auxiliary/remote/server/group/RemoteGroupCacheServer.java
  
  Index: RemoteGroupCacheServer.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-jcs/src/java/org/apache/jcs/auxiliary/remote/server/group/RemoteGroupCacheServer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RemoteGroupCacheServer.java       8 Apr 2002 18:27:49 -0000       1.3
  +++ RemoteGroupCacheServer.java       23 May 2002 15:22:22 -0000      1.4
  @@ -7,7 +7,7 @@
   
   import org.apache.jcs.auxiliary.remote.server.RemoteCacheServer;
   
  -import org.apache.jcs.engine.control.CacheHub;
  +import org.apache.jcs.engine.control.CompositeCacheManager;
   import org.apache.jcs.engine.control.group.GroupCacheHub;
   import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheServiceAdmin;
   import org.apache.jcs.auxiliary.remote.server.behavior.IRemoteCacheServerAttributes;
  @@ -35,7 +35,7 @@
   
   
       /** Description of the Method */
  -    protected CacheHub createCacheManager( String prop )
  +    protected CompositeCacheManager createCacheManager( String prop )
       {
           return GroupCacheHub.getInstance( prop == null ? "/remote.cache.ccf" : prop 
);
       }
  
  
  
  1.5       +2 -2      
jakarta-turbine-jcs/src/java/org/apache/jcs/engine/control/CompositeCacheConfigurator.java
  
  Index: CompositeCacheConfigurator.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-jcs/src/java/org/apache/jcs/engine/control/CompositeCacheConfigurator.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- CompositeCacheConfigurator.java   12 Apr 2002 13:03:12 -0000      1.4
  +++ CompositeCacheConfigurator.java   23 May 2002 15:22:22 -0000      1.5
  @@ -40,14 +40,14 @@
       final static String CACHE_ATTRIBUTE_PREFIX = ".cacheattributes";
       final static String ELEMENT_ATTRIBUTE_PREFIX = ".elementattributes";
   
  -    private CacheHub ccMgr;
  +    private CompositeCacheManager ccMgr;
   
       /**
        * Constructor for the CompositeCacheConfigurator object
        *
        * @param ccMgr
        */
  -    public CompositeCacheConfigurator( CacheHub ccMgr )
  +    public CompositeCacheConfigurator( CompositeCacheManager ccMgr )
       {
           this.ccMgr = ccMgr;
       }
  
  
  
  1.1                  
jakarta-turbine-jcs/src/java/org/apache/jcs/engine/control/CompositeCache.java
  
  Index: CompositeCache.java
  ===================================================================
  package org.apache.jcs.engine.control;
  
  /*
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2001 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   * notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   * notice, this list of conditions and the following disclaimer in
   * the documentation and/or other materials provided with the
   * distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   * any, must include the following acknowlegement:
   * "This product includes software developed by the
   * Apache Software Foundation (http://www.apache.org/)."
   * Alternately, this acknowlegement may appear in the software itself,
   * if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Velocity", and "Apache Software
   * Foundation" must not be used to endorse or promote products derived
   * from this software without prior written permission. For written
   * permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache"
   * nor may "Apache" appear in their names without prior written
   * permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  import java.io.IOException;
  import java.io.Serializable;
  import java.util.ArrayList;
  import java.util.Iterator;
  import java.util.Map;
  
  import org.apache.commons.logging.Log;
  import org.apache.commons.logging.LogFactory;
  import org.apache.jcs.access.exception.CacheException;
  import org.apache.jcs.access.exception.ObjectNotFoundException;
  import org.apache.jcs.auxiliary.AuxiliaryCache;
  import org.apache.jcs.engine.CacheConstants;
  import org.apache.jcs.engine.CacheElement;
  import org.apache.jcs.engine.behavior.ICache;
  import org.apache.jcs.engine.behavior.ICacheElement;
  import org.apache.jcs.engine.behavior.ICacheType;
  import org.apache.jcs.engine.behavior.ICompositeCache;
  import org.apache.jcs.engine.behavior.ICompositeCacheAttributes;
  import org.apache.jcs.engine.behavior.IElementAttributes;
  
  import org.apache.jcs.engine.memory.MemoryCache;
  import org.apache.jcs.engine.memory.MemoryElementDescriptor;
  import org.apache.jcs.engine.memory.lru.LRUMemoryCache;
  
  import org.apache.jcs.engine.control.event.ElementEvent;
  import org.apache.jcs.engine.control.event.behavior.IElementEventHandler;
  import org.apache.jcs.engine.control.event.behavior.IElementEvent;
  import org.apache.jcs.engine.control.event.behavior.IElementEventConstants;
  import org.apache.jcs.engine.control.event.behavior.IElementEventQueue;
  import org.apache.jcs.engine.control.event.ElementEventQueue;
  
  /**
   *  This is the primary hub for a single cache/region. It control the flow of
   *  items through the cache. The auxiliary and memory caches are plugged in
   *  here.
   *
   *@author     <a href="mailto:[EMAIL PROTECTED]";>Aaron Smuts</a>
   *@author     <a href="mailto:[EMAIL PROTECTED]";>James Taylor</a>
   *@version    $Id: CompositeCache.java,v 1.1 2002/05/23 15:22:22 jtaylor Exp $
   */
  public class CompositeCache
       implements ICache, ICompositeCache, Serializable
  {
      private final static Log log = LogFactory.getLog( CompositeCache.class );
  
      // Auxiliary caches.
      private AuxiliaryCache[] auxCaches;
      // track hit counts for each
      private int[] auxHit;
  
      private boolean alive = true;
  
      // this is int he cacheAttr, shouldn't be used, remove
      final String cacheName;
  
      /**
       *  Region Elemental Attributes, default
       */
      public IElementAttributes attr;
  
      /**
       *  Cache Attributes, for hub and memory auxiliary
       */
      public ICompositeCacheAttributes cacheAttr;
  
      /**
       *  Cache Attributes, for hub and memory auxiliary
       */
      public IElementEventQueue elementEventQ;
  
      // Statistics
      // FIXME: Provide accessors for these for instrumentation
  
      private static int numInstances;
  
      private int ramHit;
      private int miss;
  
      /**
       *  The cache hub can only have one memory cache. This could be made more
       *  flexible in the future, but they are tied closely together. More than
       *  one doesn't make much sense.
       */
      MemoryCache memCache;
  
      /**
       *  Constructor for the Cache object
       *
       *@param  cacheName  The name of the region
       *@param  auxCaches  The auxiliary caches to be used by this region
       *@param  cattr      The cache attribute
       *@param  attr       The default element attributes
       */
      public CompositeCache( String cacheName,
                    AuxiliaryCache[] auxCaches,
                    ICompositeCacheAttributes cattr,
                    IElementAttributes attr )
      {
          numInstances++;
  
          this.cacheName = cacheName;
  
          this.auxCaches = auxCaches;
  
          if ( auxCaches != null )
          {
              this.auxHit = new int[auxCaches.length];
          }
  
          this.attr = attr;
          this.cacheAttr = cattr;
  
          elementEventQ = new ElementEventQueue( cacheName );
  
          createMemoryCache( cattr );
  
          if ( log.isDebugEnabled() )
          {
              log.debug( "Constructed cache with name " + cacheName +
                  " and cache attributes: " + cattr );
          }
          else if ( log.isInfoEnabled() )
          {
              log.info( "Constructed cache with name: " + cacheName );
          }
      }
  
      /**
       *  Standard update method
       *
       *@param  ce
       *@exception  IOException
       */
      public synchronized void update( ICacheElement ce )
          throws IOException
      {
          update( ce, false );
      }
  
      /**
       *  Standard update method
       *
       *@param  ce
       *@exception  IOException
       */
      public synchronized void localUpdate( ICacheElement ce )
          throws IOException
      {
          update( ce, true );
      }
  
      /**
       *  Description of the Method
       *
       *@param  ce
       *@param  updateRemoteCache
       *@exception  IOException
       */
      protected synchronized void update( ICacheElement ce, boolean localOnly )
          throws IOException
      {
  
          if ( ce.getKey() instanceof String
               && ce.getKey().toString().endsWith( 
CacheConstants.NAME_COMPONENT_DELIMITER ) )
          {
              throw new IllegalArgumentException( "key must not end with "
                   + CacheConstants.NAME_COMPONENT_DELIMITER
                   + " for a put operation" );
          }
  
          log.debug( "Updating memory cache" );
  
          memCache.update( ce );
  
          // Updates to all auxiliary caches -- remote and laterals, can add as many 
of each
          // as necessary.
          // could put the update criteria in each but it would a bit cumbersome
          // the disk cache would have to check the cache size, the lateral
          // would have to check the region cattr configuration
  
          // UPDATE AUXILLIARY CACHES
          // There are 3 types of auxiliary caches: remote, lateral, and disk
          // more can be added if future auxiliary caches don't fit the model
          // You could run a database cache as either a remote or a local disk.
          // The types would describe the purpose.
  
          if ( log.isDebugEnabled() )
          {
              if ( auxCaches.length > 0 )
              {
                  log.debug( "Updating auxilliary caches" );
              }
              else
              {
                  log.debug( "No auxilliary cache to update" );
              }
          }
  
          for ( int i = 0; i < auxCaches.length; i++ )
          {
              ICache aux = auxCaches[i];
  
              if ( log.isDebugEnabled() )
              {
                  log.debug( "Auxilliary cache type: " + aux.getCacheType() );
              }
  
              // SEND TO REMOTE STORE
              if ( aux != null && aux.getCacheType() == ICache.REMOTE_CACHE )
              {
                  if ( log.isDebugEnabled() )
                  {
                      log.debug( "ce.getElementAttributes().getIsRemote() = "
                           + ce.getElementAttributes().getIsRemote() );
                  }
  
                  if ( ce.getElementAttributes().getIsRemote()
                       && ! localOnly )
                  {
                      try
                      {
                          // need to make sure the group cache understands that the
                          // key is a group attribute on update
                          aux.update( ce );
                          if ( log.isDebugEnabled() )
                          {
                              log.debug( "Updated remote store for "
                                   + ce.getKey() + ce );
                          }
                      }
                      catch ( IOException ex )
                      {
                          log.error( "Failure in updateExclude", ex );
                      }
                  }
                  // SEND LATERALLY
              }
              else if ( aux != null
                   && aux.getCacheType() == ICache.LATERAL_CACHE )
              {
                  // lateral can't do the checking since it is dependent on the cache 
region
                  // restrictions
                  if ( log.isDebugEnabled() )
                  {
                      log.debug( "lateralcache in aux list: cattr " +
                          cacheAttr.getUseLateral() );
                  }
                  if ( cacheAttr.getUseLateral()
                       && ce.getElementAttributes().getIsLateral()
                       && ! localOnly )
                  {
                      // later if we want a multicast, possibly delete abnormal 
broadcaster
                      // DISTRIBUTE LATERALLY
                      // Currently always multicast even if the value is unchanged,
                      // just to cause the cache item to move to the front.
                      aux.update( ce );
                      if ( log.isDebugEnabled() )
                      {
                          log.debug( "updated lateral cache for " + ce.getKey() );
                      }
                  }
              }
              else if ( aux != null && aux.getCacheType() == ICache.DISK_CACHE )
              {
                  // do nothing, the memory manager will call spool where necesary
                  // TODO: add option to put all element on disk
              }
          }
  
          return;
      }
  
      /**
       *  Writes the specified element to any disk auxilliaries Might want to
       *  rename this "overflow" incase the hub wants to do something else.
       *
       *@param  ce  The CacheElement
       */
      public void spoolToDisk( ICacheElement ce )
      {
  
          boolean diskAvailable = false;
  
          // SPOOL TO DISK.
          for ( int i = 0; i < auxCaches.length; i++ )
          {
              ICache aux = auxCaches[i];
  
              if ( aux != null && aux.getCacheType() == ICache.DISK_CACHE )
              {
  
                  diskAvailable = true;
  
                  // write the last item to disk.2
                  try
                  {
                      // handle event, might move to a new method
                      ArrayList eventHandlers = 
ce.getElementAttributes().getElementEventHandlers();
                      if ( eventHandlers != null )
                      {
                          if ( log.isDebugEnabled() )
                          {
                              log.debug( "Handlers are registered.  Event -- 
ELEMENT_EVENT_SPOOLED_DISK_AVAILABLE" );
                          }
                          IElementEvent event = new ElementEvent( ce, 
IElementEventConstants.ELEMENT_EVENT_SPOOLED_DISK_AVAILABLE );
                          Iterator hIt = eventHandlers.iterator();
                          while ( hIt.hasNext() )
                          {
                              IElementEventHandler hand = ( IElementEventHandler ) 
hIt.next();
                              //hand.handleElementEvent( event );
                              addElementEvent( hand, event );
                          }
                      }
  
                      aux.update( ce );
                  }
                  catch ( IOException ex )
                  {
                      // impossible case.
                      ex.printStackTrace();
                      throw new IllegalStateException( ex.getMessage() );
                  }
                  catch ( Exception oee )
                  {
                  }
                  if ( log.isDebugEnabled() )
                  {
                      log.debug( "spoolToDisk done for: " + ce.getKey() + " on disk 
cache[" + i + "]" );
                  }
              }
          }
  
          if ( !diskAvailable )
          {
  
              try
              {
  
                  // handle event, might move to a new method
                  ArrayList eventHandlers = 
ce.getElementAttributes().getElementEventHandlers();
                  if ( eventHandlers != null )
                  {
                      if ( log.isDebugEnabled() )
                      {
                          log.debug( "Handlers are registered.  Event -- 
ELEMENT_EVENT_SPOOLED_DISK_NOT_AVAILABLE" );
                      }
                      IElementEvent event = new ElementEvent( ce, 
IElementEventConstants.ELEMENT_EVENT_SPOOLED_DISK_NOT_AVAILABLE );
                      Iterator hIt = eventHandlers.iterator();
                      while ( hIt.hasNext() )
                      {
                          IElementEventHandler hand = ( IElementEventHandler ) 
hIt.next();
                          //hand.handleElementEvent( event );
                          addElementEvent( hand, event );
                      }
                  }
  
              }
              catch ( Exception e )
              {
                  log.error( "Trouble handling the event", e );
              }
  
          }
  
      }
  
      /**
       * @see ICache#get
       */
      public ICacheElement get( Serializable key )
      {
          return get( key, false );
      }
  
      /**
       * @see ICompositeCache#localGet
       */
      public ICacheElement localGet( Serializable key )
      {
          return get( key, true );
      }
  
      /**
       *  Description of the Method
       *
       *@param  key
       *@param  localOnly
       *@return
       */
      protected ICacheElement get( Serializable key, boolean localOnly )
      {
          ICacheElement element = null;
  
          if ( log.isDebugEnabled() )
          {
              log.debug( "get: key = " + key + ", localOnly = " + localOnly );
          }
  
          try
          {
              // First look in memory cache
  
              element = memCache.get( key );
  
              if ( element == null )
              {
                  // Item not found in memory. If local invocation look in aux
                  // caches, even if not local look in disk auxiliaries
  
                  for ( int i = 0; i < auxCaches.length; i++ )
                  {
                      AuxiliaryCache aux = auxCaches[i];
  
                      if ( aux != null )
                      {
                          long cacheType = aux.getCacheType();
  
                          if ( ! localOnly || cacheType == aux.DISK_CACHE )
                          {
                              if ( log.isDebugEnabled() )
                              {
                                  log.debug( "Attempting to get from aux: "
                                       + aux.getCacheName()
                                       + " which is of type: "
                                       + cacheType );
                              }
  
                              try
                              {
                                  element = aux.get( key );
                              }
                              catch ( IOException ex )
                              {
                                  log.error( "Error getting from aux", ex );
                              }
                          }
  
                          if ( log.isDebugEnabled() )
                          {
                              log.debug( "Got CacheElement: " + element );
                          }
  
                          if ( element != null )
                          {
                              log.debug(
                                  cacheName + " - Aux cache[" + i + "] hit" );
  
                              // Item found in one of the auxiliary caches.
                              auxHit[i]++;
  
                              // Spool the item back into memory
                              memCache.update( element );
  
                              break;
                          }
                      }
                  }
              }
              else
              {
                  ramHit++;
  
                  if ( log.isDebugEnabled() )
                  {
                      log.debug( cacheName + " - Memory cache hit" );
                  }
              }
  
          }
          catch ( Exception e )
          {
              log.error( e );
          }
  
          if ( element == null )
          {
              miss++;
  
              if ( log.isDebugEnabled() )
              {
                  log.debug( cacheName + " - Miss" );
              }
  
              return null;
          }
  
          // If an element was found, we still need to deal with expiration.
  
          try
          {
              IElementAttributes attributes = element.getElementAttributes();
  
              if ( !attributes.getIsEternal() )
              {
                  long now = System.currentTimeMillis();
  
                  // Remove if maxLifeSeconds exceeded
  
                  long maxLifeSeconds = attributes.getMaxLifeSeconds();
                  long createTime = attributes.getCreateTime();
  
                  if ( maxLifeSeconds != -1
                       && ( now - createTime ) > ( maxLifeSeconds * 1000 ) )
                  {
                      if ( log.isDebugEnabled() )
                      {
                          log.debug( "Exceeded maxLife: " + element.getKey() );
                      }
  
                      remove( key );
  
                      return null;
                  }
                  else
                  {
                      long idleTime = attributes.getIdleTime();
                      long lastAccessTime = attributes.getLastAccessTime();
  
                      // Remove if maxIdleTime exceeded
                      // FIXME: Does this really belong here?
  
                      if ( ( idleTime != -1 )
                           && ( now - lastAccessTime ) > ( idleTime * 1000 ) )
                      {
                          if ( log.isDebugEnabled() )
                          {
                              log.info( "Exceeded maxIdle: " + element.getKey() );
                          }
  
                          remove( key );
  
                          return null;
                      }
                  }
              }
  
          }
          catch ( Exception e )
          {
              log.error( "Error determining expiration period", e );
              return null;
          }
  
          return element;
      }
  
      /**
       * @see ICache#remove
       */
      public boolean remove( Serializable key )
      {
          return remove( key, false );
      }
  
      /**
       * @see ICompositeCache#localRemove
       */
      public boolean localRemove( Serializable key )
      {
          return remove( key, true );
      }
  
      /**
       *  fromRemote: If a remove call was made on a cache with both, then the
       *  remote should have been called. If it wasn't then the remote is down.
       *  we'll assume it is down for all. If it did come from the remote then the
       *  caceh is remotely configured and lateral removal is unncessary. If it
       *  came laterally then lateral removal is unnecessary. Does this assumes
       *  that there is only one lateral and remote for the cache? Not really, the
       *  intial removal should take care of the problem if the source cache was
       *  similiarly configured. Otherwise the remote cache, if it had no
       *  laterals, would remove all the elements from remotely configured caches,
       *  but if those caches had some other wierd laterals that were not remotely
       *  configured, only laterally propagated then they would go out of synch.
       *  The same could happen for multiple remotes. If this looks necessary we
       *  will need to build in an identifier to specify the source of a removal.
       *
       *@param  key
       *@param  localOnly
       *@return
       */
  
      protected synchronized boolean remove( Serializable key,
                                             boolean localOnly )
      {
          boolean removed = false;
  
          try
          {
              removed = memCache.remove( key );
          }
          catch ( IOException e )
          {
              log.error( e );
          }
  
          // Removes from all auxiliary caches.
          for ( int i = 0; i < auxCaches.length; i++ )
          {
              ICache aux = auxCaches[i];
  
              if ( aux == null )
              {
                  continue;
              }
  
              int cacheType = aux.getCacheType();
  
              // for now let laterals call remote remove but not vice versa
  
              if ( localOnly && ( cacheType == REMOTE_CACHE || cacheType == 
LATERAL_CACHE ) )
              {
                  continue;
              }
              try
              {
  
                  if ( log.isDebugEnabled() )
                  {
                    log.debug( "Removing " + key + " from cacheType" + cacheType );
                  }
  
                  boolean b = aux.remove( key );
  
                  // Don't take the remote removal into account.
                  if ( !removed && cacheType != REMOTE_CACHE )
                  {
                      removed = b;
                  }
              }
              catch ( IOException ex )
              {
                  log.error( "Failure removing from aux", ex );
              }
          }
          return removed;
      }
  
      /**
       * @see ICache#removeAll
       */
      public void removeAll()
          throws IOException
      {
          removeAll( false );
      }
  
      /**
       * @see ICompositeCache#removeAll
       */
      public void localRemoveAll()
          throws IOException
      {
          removeAll( true );
      }
  
      /**
       * Removes all cached items.
       */
      protected synchronized void removeAll( boolean localOnly )
          throws IOException
      {
  
          try
          {
              memCache.removeAll();
          }
          catch ( IOException ex )
          {
              log.error( ex );
          }
  
          // Removes from all auxiliary disk caches.
          for ( int i = 0; i < auxCaches.length; i++ )
          {
              ICache aux = auxCaches[i];
  
              int cacheType = aux.getCacheType();
  
              if ( aux != null
                   && ( cacheType == ICache.DISK_CACHE || ! localOnly ) )
              {
                  try
                  {
                      aux.removeAll();
                  }
                  catch ( IOException ex )
                  {
                      log.error( "Failure removing all from aux", ex );
                  }
              }
          }
          return;
      }
  
      /**
       *  Flushes all cache items from memory to auxilliary caches and close the
       *  auxilliary caches.
       */
      public void dispose()
      {
          dispose( false );
      }
  
      /**
       *  invoked only by CacheManager.
       *
       *@param  fromRemote
       */
      protected void dispose( boolean fromRemote )
      {
          if ( !alive )
          {
              return;
          }
          synchronized ( this )
          {
              if ( !alive )
              {
                  return;
              }
              alive = false;
  
              for ( int i = 0; i < auxCaches.length; i++ )
              {
                  try
                  {
                      ICache aux = auxCaches[i];
  
                      if ( aux == null || fromRemote && aux.getCacheType() == 
REMOTE_CACHE )
                      {
                          continue;
                      }
                      if ( aux.getStatus() == CacheConstants.STATUS_ALIVE )
                      {
  
                          if ( log.isDebugEnabled() )
                          {
                              log.debug( "size = " + memCache.getSize() );
                          }
  
                          if ( !( aux.getCacheType() == ICacheType.LATERAL_CACHE && 
!this.cacheAttr.getUseLateral() ) )
                          {
  
                              Iterator itr = memCache.getIterator();
  
                              while ( itr.hasNext() )
                              {
                                  Map.Entry entry = ( Map.Entry ) itr.next();
  
                                  MemoryElementDescriptor me = ( 
MemoryElementDescriptor ) entry.getValue();
                                  try
                                  {
                                      if ( aux.getCacheType() == 
ICacheType.LATERAL_CACHE && !me.ce.getElementAttributes().getIsLateral() )
                                      {
                                          continue;
                                      }
                                      aux.update( me.ce );
                                  }
                                  catch ( Exception e )
                                  {
                                      log.error( e );
                                  }
                              }
                          }
                          if ( aux.getCacheType() == ICache.DISK_CACHE )
                          {
                              aux.dispose();
                          }
                      }
                  }
                  catch ( IOException ex )
                  {
                      log.error( "Failure disposing of aux", ex );
                  }
              }
          }
  
          log.warn( "Called close for " + cacheName );
  
      }
  
      /**
       *  Though this put is extremely fast, this could bog the cache and should
       *  be avoided. The dispose method should call a version of this. Good for
       *  testing.
       */
      public void save()
      {
          if ( !alive )
          {
              return;
          }
          synchronized ( this )
          {
              if ( !alive )
              {
                  return;
              }
              alive = false;
  
              for ( int i = 0; i < auxCaches.length; i++ )
              {
                  try
                  {
                      ICache aux = auxCaches[i];
  
                      if ( aux.getStatus() == CacheConstants.STATUS_ALIVE )
                      {
  
                          Iterator itr = memCache.getIterator();
  
                          while ( itr.hasNext() )
                          {
                              Map.Entry entry = ( Map.Entry ) itr.next();
  
                              MemoryElementDescriptor me = ( MemoryElementDescriptor ) 
entry.getValue();
  
                              aux.update( me.ce );
                          }
                      }
                  }
                  catch ( IOException ex )
                  {
                      log.error( "Failure saving aux caches", ex );
                  }
              }
          }
          if ( log.isDebugEnabled() )
          {
              log.debug( "Called save for " + cacheName );
          }
      }
  
      /**
       *  Gets the size attribute of the Cache object
       *
       *@return    The size value
       */
      public int getSize()
      {
          return memCache.getSize();
      }
  
      /**
       *  Gets the cacheType attribute of the Cache object
       *
       *@return    The cacheType value
       */
      public int getCacheType()
      {
          return CACHE_HUB;
      }
  
      /**
       *  Gets the status attribute of the Cache object
       *
       *@return    The status value
       */
      public int getStatus()
      {
          return alive ? CacheConstants.STATUS_ALIVE : CacheConstants.STATUS_DISPOSED;
      }
  
      /**
       *  Gets the cacheName attribute of the Cache object
       *
       *@return    The cacheName value
       */
      public String getCacheName()
      {
          return cacheName;
      }
  
      /**
       *  Gets the default element attribute of the Cache object
       *
       * Should this return a copy?
       *
       *@return    The attributes value
       */
      public IElementAttributes getElementAttributes()
      {
          return attr;
      }
  
      /**
       *  Sets the default element attribute of the Cache object
       *
       *@return    The attributes value
       */
      public void setElementAttributes( IElementAttributes attr)
      {
          this.attr = attr;
      }
  
  
      /**
       *  Gets the ICompositeCacheAttributes attribute of the Cache object
       *
       *@return    The ICompositeCacheAttributes value
       */
      public ICompositeCacheAttributes getCacheAttributes()
      {
          return this.cacheAttr;
      }
  
      /**
       *  Sets the ICompositeCacheAttributes attribute of the Cache object
       *
       *@param  cattr  The new ICompositeCacheAttributes value
       */
      public void setCacheAttributes( ICompositeCacheAttributes cattr )
      {
          this.cacheAttr = cattr;
          // need a better way to do this, what if it is in error
          this.memCache.initialize( this );
      }
  
      /**
       *  Gets the elementAttributes attribute of the Cache object
       *
       *@param  key
       *@return                     The elementAttributes value
       *@exception  CacheException
       *@exception  IOException
       */
      public IElementAttributes getElementAttributes( Serializable key )
          throws CacheException, IOException
      {
          CacheElement ce = ( CacheElement ) get( key );
          if ( ce == null )
          {
              throw new ObjectNotFoundException( "key " + key + " is not found" );
          }
          return ce.getElementAttributes();
      }
  
  
      /**
       *  Adds an ElementEvent to be handled
       *
       *@param  hand             The IElementEventHandler
       *@param  event            The IElementEventHandler IElementEvent event
       *@exception  IOException  Description of the Exception
       */
      public void addElementEvent( IElementEventHandler hand, IElementEvent event )
          throws IOException
      {
          if ( log.isDebugEnabled() )
          {
              log.debug( "Adding to Q" );
          }
          elementEventQ.addElementEvent( hand, event );
      }
  
  
      /**
       *  Create the MemoryCache based on the config parameters. TODO: consider
       *  making this an auxiliary, despite its close tie to the CacheHub. TODO:
       *  might want to create a memory cache config file separate from that of
       *  the hub -- ICompositeCacheAttributes
       *
       *@param  cattr
       */
      private void createMemoryCache( ICompositeCacheAttributes cattr )
      {
          if ( memCache == null )
          {
              try
              {
                  Class c = Class.forName( cattr.getMemoryCacheName() );
                  memCache = ( MemoryCache ) c.newInstance();
                  memCache.initialize( this );
              }
              catch ( Exception e )
              {
                  log.warn( "Failed to init mem cache, using: LRUMemoryCache", e );
  
                  this.memCache = new LRUMemoryCache();
                  this.memCache.initialize( this );
              }
          }
          else
          {
              log.warn( "Refusing to create memory cache -- already exists." );
          }
      }
  
      /**
       *  Access to the memory cache for instrumentation.
       *
       *@return    The memoryCache value
       */
      public MemoryCache getMemoryCache()
      {
          return memCache;
      }
  }
  
  
  
  1.3       +162 -145  
jakarta-turbine-jcs/src/java/org/apache/jcs/engine/control/CompositeCacheManager.java
  
  
  
  
  1.8       +2 -2      
jakarta-turbine-jcs/src/java/org/apache/jcs/engine/control/group/GroupCache.java
  
  Index: GroupCache.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-jcs/src/java/org/apache/jcs/engine/control/group/GroupCache.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- GroupCache.java   17 May 2002 14:12:53 -0000      1.7
  +++ GroupCache.java   23 May 2002 15:22:22 -0000      1.8
  @@ -69,7 +69,7 @@
   import org.apache.jcs.engine.behavior.ICompositeCache;
   import org.apache.jcs.engine.behavior.ICompositeCacheAttributes;
   import org.apache.jcs.engine.behavior.IElementAttributes;
  -import org.apache.jcs.engine.control.Cache;
  +import org.apache.jcs.engine.control.CompositeCache;
   import org.apache.jcs.utils.locking.ReadWriteLockManager;
   import org.apache.jcs.auxiliary.AuxiliaryCache;
   
  @@ -84,7 +84,7 @@
    *
    * @author asmuts
    */
  -public class GroupCache extends Cache implements ICompositeCache
  +public class GroupCache extends CompositeCache implements ICompositeCache
   {
       private final static Log log = LogFactory.getLog( GroupCache.class );
   
  
  
  
  1.4       +9 -9      
jakarta-turbine-jcs/src/java/org/apache/jcs/engine/control/group/GroupCacheHub.java
  
  Index: GroupCacheHub.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-jcs/src/java/org/apache/jcs/engine/control/group/GroupCacheHub.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- GroupCacheHub.java        12 Apr 2002 13:03:12 -0000      1.3
  +++ GroupCacheHub.java        23 May 2002 15:22:22 -0000      1.4
  @@ -8,27 +8,27 @@
   import org.apache.jcs.engine.behavior.ICompositeCache;
   import org.apache.jcs.engine.behavior.ICompositeCacheAttributes;
   import org.apache.jcs.engine.behavior.IElementAttributes;
  -import org.apache.jcs.engine.control.Cache;
  -import org.apache.jcs.engine.control.CacheHub;
  +import org.apache.jcs.engine.control.CompositeCache;
  +import org.apache.jcs.engine.control.CompositeCacheManager;
   import org.apache.jcs.auxiliary.AuxiliaryCache;
   
   /** */
   public class GroupCacheHub
  -    extends CacheHub
  +    extends CompositeCacheManager
       implements Serializable
   {
       /**
  -     * @see CacheHub#createInstance
  +     * @see CompositeCacheManager#createInstance
        */
  -    protected static CacheHub createInstance()
  +    protected static CompositeCacheManager createInstance()
       {
           return new GroupCacheHub();
       }
   
       /**
  -     * @see CacheHub#createSystemCache
  +     * @see CompositeCacheManager#createSystemCache
        */
  -    protected Cache createSystemCache( String cacheName,
  +    protected CompositeCache createSystemCache( String cacheName,
                                          AuxiliaryCache[] auxCaches,
                                          ICompositeCacheAttributes cattr,
                                          IElementAttributes attr )
  @@ -41,9 +41,9 @@
       }
   
       /**
  -     * @see CacheHub#createCache
  +     * @see CompositeCacheManager#createCache
        */
  -    protected Cache createCache( String cacheName,
  +    protected CompositeCache createCache( String cacheName,
                                    AuxiliaryCache[] auxCaches,
                                    ICompositeCacheAttributes cattr,
                                    IElementAttributes attr )
  
  
  
  1.7       +3 -3      
jakarta-turbine-jcs/src/java/org/apache/jcs/engine/memory/MemoryCache.java
  
  Index: MemoryCache.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-jcs/src/java/org/apache/jcs/engine/memory/MemoryCache.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- MemoryCache.java  13 May 2002 22:16:18 -0000      1.6
  +++ MemoryCache.java  23 May 2002 15:22:23 -0000      1.7
  @@ -7,7 +7,7 @@
   import org.apache.jcs.engine.behavior.ICacheElement;
   import org.apache.jcs.engine.behavior.ICompositeCacheAttributes;
   import org.apache.jcs.engine.behavior.ICompositeCache;
  -import org.apache.jcs.engine.control.Cache;
  +import org.apache.jcs.engine.control.CompositeCache;
   
   /**
    *  For the framework. Insures methods a MemoryCache needs to access. Not sure
  @@ -17,7 +17,7 @@
    *@author     <a href="mailto:[EMAIL PROTECTED]";>Aaron Smuts</a>
    *@author     <a href="mailto:[EMAIL PROTECTED]";>James Taylor</a>
    *@created    May 13, 2002
  - *@version    $Id: MemoryCache.java,v 1.6 2002/05/13 22:16:18 asmuts Exp $
  + *@version    $Id: MemoryCache.java,v 1.7 2002/05/23 15:22:23 jtaylor Exp $
    */
   public interface MemoryCache
   {
  @@ -26,7 +26,7 @@
        *
        *@param  cache  The cache (region) this memory store is attached to.
        */
  -    public void initialize( Cache cache );
  +    public void initialize( CompositeCache cache );
   
       /**
        *  Get the number of elements contained in the memory store
  
  
  
  1.6       +2 -2      
jakarta-turbine-jcs/src/java/org/apache/jcs/engine/memory/behavior/IMemoryCache.java
  
  Index: IMemoryCache.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-jcs/src/java/org/apache/jcs/engine/memory/behavior/IMemoryCache.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- IMemoryCache.java 13 May 2002 22:16:18 -0000      1.5
  +++ IMemoryCache.java 23 May 2002 15:22:23 -0000      1.6
  @@ -12,7 +12,7 @@
   import org.apache.jcs.engine.behavior.ICompositeCache;
   
   import org.apache.jcs.engine.memory.MemoryElementDescriptor;
  -import org.apache.jcs.engine.control.Cache;
  +import org.apache.jcs.engine.control.CompositeCache;
   
   /**
    *  For the framework. Insures methods a MemoryCache needs to access.
  @@ -33,7 +33,7 @@
        */
       public void initialize( String cacheName,
                               ICompositeCacheAttributes cattr,
  -                            Cache cache );
  +                            CompositeCache cache );
   
       // TODO: need a setCacheAttributes or reInitialize method
   
  
  
  
  1.10      +4 -4      
jakarta-turbine-jcs/src/java/org/apache/jcs/engine/memory/lru/LRUMemoryCache.java
  
  Index: LRUMemoryCache.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-jcs/src/java/org/apache/jcs/engine/memory/lru/LRUMemoryCache.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- LRUMemoryCache.java       13 May 2002 22:16:18 -0000      1.9
  +++ LRUMemoryCache.java       23 May 2002 15:22:23 -0000      1.10
  @@ -15,7 +15,7 @@
   import org.apache.jcs.engine.behavior.ICompositeCacheAttributes;
   import org.apache.jcs.engine.behavior.ICompositeCache;
   import org.apache.jcs.engine.behavior.IElementAttributes;
  -import org.apache.jcs.engine.control.Cache;
  +import org.apache.jcs.engine.control.CompositeCache;
   import org.apache.jcs.engine.memory.MemoryCache;
   import org.apache.jcs.engine.memory.MemoryElementDescriptor;
   import org.apache.jcs.engine.memory.shrinking.ShrinkerThread;
  @@ -34,7 +34,7 @@
    *@author     <a href="mailto:[EMAIL PROTECTED]";>Aaron Smuts</a>
    *@author     <a href="mailto:[EMAIL PROTECTED]";>James Taylor</a>
    *@created    May 13, 2002
  - *@version    $Id: LRUMemoryCache.java,v 1.9 2002/05/13 22:16:18 asmuts Exp $
  + *@version    $Id: LRUMemoryCache.java,v 1.10 2002/05/23 15:22:23 jtaylor Exp $
    */
   public class LRUMemoryCache implements MemoryCache, Serializable
   {
  @@ -67,7 +67,7 @@
       /**
        *  The cache region this store is associated with
        */
  -    Cache cache;
  +    CompositeCache cache;
   
       // status
       private int status = CacheConstants.STATUS_ERROR;
  @@ -93,7 +93,7 @@
        *
        *@param  hub
        */
  -    public synchronized void initialize( Cache hub )
  +    public synchronized void initialize( CompositeCache hub )
       {
           this.cacheName = hub.getCacheName();
           this.cattr = hub.getCacheAttributes();
  
  
  
  1.7       +4 -4      
jakarta-turbine-jcs/src/java/org/apache/jcs/engine/memory/mru/MRUMemoryCache.java
  
  Index: MRUMemoryCache.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-jcs/src/java/org/apache/jcs/engine/memory/mru/MRUMemoryCache.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- MRUMemoryCache.java       13 May 2002 22:16:18 -0000      1.6
  +++ MRUMemoryCache.java       23 May 2002 15:22:23 -0000      1.7
  @@ -15,7 +15,7 @@
   import org.apache.jcs.engine.behavior.ICompositeCacheAttributes;
   import org.apache.jcs.engine.behavior.ICompositeCache;
   import org.apache.jcs.engine.behavior.IElementAttributes;
  -import org.apache.jcs.engine.control.Cache;
  +import org.apache.jcs.engine.control.CompositeCache;
   import org.apache.jcs.engine.memory.MemoryCache;
   import org.apache.jcs.engine.memory.MemoryElementDescriptor;
   import org.apache.jcs.engine.memory.shrinking.ShrinkerThread;
  @@ -29,7 +29,7 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Aaron Smuts</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>James Taylor</a>
  - * @version $Id: MRUMemoryCache.java,v 1.6 2002/05/13 22:16:18 asmuts Exp $
  + * @version $Id: MRUMemoryCache.java,v 1.7 2002/05/23 15:22:23 jtaylor Exp $
    */
   public class MRUMemoryCache
       implements MemoryCache, Serializable
  @@ -67,7 +67,7 @@
       public ICompositeCacheAttributes cattr;
   
       // The HUB
  -    Cache cache;
  +    CompositeCache cache;
   
       // status
       private int status;
  @@ -93,7 +93,7 @@
        *
        * @param cache
        */
  -    public synchronized void initialize( Cache cache )
  +    public synchronized void initialize( CompositeCache cache )
       {
           this.cacheName = cache.getCacheName();
           this.cattr = cache.getCacheAttributes();
  
  
  
  1.4       +1 -1      
jakarta-turbine-jcs/src/test/org/apache/jcs/engine/control/CompositeCacheManagerTester.java
  
  Index: CompositeCacheManagerTester.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-jcs/src/test/org/apache/jcs/engine/control/CompositeCacheManagerTester.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CompositeCacheManagerTester.java  12 Apr 2002 02:13:33 -0000      1.3
  +++ CompositeCacheManagerTester.java  23 May 2002 15:22:23 -0000      1.4
  @@ -21,7 +21,7 @@
               propsFile = args[0];
           }
   
  -        CacheHub hub = new CacheHub();
  +        CompositeCacheManager hub = new CompositeCacheManager();
   
           hub.configure( propsFile );
       }
  
  
  
  1.4       +1 -1      
jakarta-turbine-jcs/src/test/org/apache/jcs/servlet/ListTestCacheServlet.java
  
  Index: ListTestCacheServlet.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-jcs/src/test/org/apache/jcs/servlet/ListTestCacheServlet.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ListTestCacheServlet.java 12 Apr 2002 02:19:26 -0000      1.3
  +++ ListTestCacheServlet.java 23 May 2002 15:22:23 -0000      1.4
  @@ -28,7 +28,7 @@
   import org.apache.jcs.engine.behavior.ICache;
   import org.apache.jcs.engine.behavior.ICompositeCacheAttributes;
   
  -import org.apache.jcs.engine.control.CacheHub;
  +import org.apache.jcs.engine.control.CompositeCacheManager;
   import org.apache.jcs.engine.control.group.GroupCacheHub;
   
   import org.apache.commons.logging.Log;
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to