commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t.@apache.org
Subject svn commit: r1299873 [1/3] - in /commons/proper/jcs/branches/generics-interface/src: java/org/apache/jcs/ java/org/apache/jcs/access/ java/org/apache/jcs/access/behavior/ java/org/apache/jcs/auxiliary/disk/block/ java/org/apache/jcs/auxiliary/disk/inde...
Date Mon, 12 Mar 2012 21:21:05 GMT
Author: tv
Date: Mon Mar 12 21:21:03 2012
New Revision: 1299873

URL: http://svn.apache.org/viewvc?rev=1299873&view=rev
Log:
The code compiles now.
Intermediate commit to save the first chunk of test adjustments to Generics

Removed:
    commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/engine/memory/MemoryCache.java
Modified:
    commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/JCS.java
    commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/access/GroupCacheAccess.java
    commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/access/behavior/IGroupCacheAccess.java
    commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/disk/block/BlockDiskCache.java
    commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCache.java
    commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/AbstractRemoteAuxiliaryCache.java
    commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheManager.java
    commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheNoWait.java
    commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheClient.java
    commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheDispatcher.java
    commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheClient.java
    commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheMonitor.java
    commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteCacheServiceAdaptor.java
    commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/util/RemoteCacheRequestFactory.java
    commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/engine/control/CompositeCache.java
    commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/engine/memory/AbstractDoulbeLinkedListMemoryCache.java
    commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/engine/memory/AbstractMemoryCache.java
    commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/engine/memory/shrinking/ShrinkerThread.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/access/CacheAccessUnitTest.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/MockAuxiliaryCacheFactory.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheKeyStoreUnitTest.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheManagerUnitTest.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheRandomConcurrentTestUtil.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheSteadyLoadTest.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskElementDescriptorUnitTest.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/file/FileDiskCacheFactoryUnitTest.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/indexed/DiskTestObjectUtil.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexDiskCacheUnitTest.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheConcurrentUnitTest.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheKeyStoreUnitTest.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheManagerUnitTest.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheConcurrentUnitTest.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheUnitTest.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPConcurrentRandomTestUtil.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPFilterRemoveHashCodeUnitTest.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPIssueRemoveOnPutUnitTest.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/TestTCPLateralUnitTest.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/MockRemoteCacheClient.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheNoWaitUnitTest.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/RemoteCacheUnitTest.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/TestRemoteCache.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/ZombieRemoteCacheServiceUnitTest.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheClientUnitTest.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerUnitTest.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/engine/CacheEventQueueFactoryUnitTest.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/engine/MockCacheEventQueue.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/engine/ZombieCacheServiceNonLocalUnitTest.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/engine/control/CacheManagerStatsUnitTest.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/engine/control/CompositeCacheConfiguratorUnitTest.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/engine/control/CompositeCacheUnitTest.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/engine/control/MockCompositeCacheManager.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/engine/memory/MockMemoryCache.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/engine/memory/fifo/FIFOMemoryCacheUnitTest.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/engine/memory/lru/LHMLRUMemoryCacheConcurrentUnitTest.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/engine/memory/lru/LHMLRUMemoryCacheUnitTest.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/engine/memory/lru/LRUMemoryCacheConcurrentUnitTest.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/engine/memory/mru/MRUMemoryCacheUnitTest.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/engine/memory/shrinking/ShrinkerThreadUnitTest.java
    commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/utils/serialization/SerializationConversionUtilUnitTest.java

Modified: commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/JCS.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/JCS.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/JCS.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/JCS.java Mon Mar 12 21:21:03 2012
@@ -27,7 +27,6 @@ import org.apache.jcs.access.exception.C
 import org.apache.jcs.engine.behavior.ICompositeCacheAttributes;
 import org.apache.jcs.engine.control.CompositeCache;
 import org.apache.jcs.engine.control.CompositeCacheManager;
-import org.apache.jcs.engine.control.group.GroupAttrName;
 
 /**
  * Simple class for using JCS. To use JCS in your application, you can use the static methods of
@@ -53,7 +52,7 @@ public class JCS<K extends Serializable,
      * <p>
      * @param cacheControl Cache which the instance will provide access to
      */
-    protected JCS( CompositeCache<GroupAttrName<K>, V> cacheControl )
+    protected JCS( CompositeCache<K, V> cacheControl )
     {
         super( cacheControl );
     }
@@ -68,7 +67,7 @@ public class JCS<K extends Serializable,
     public static <K extends Serializable, V extends Serializable> JCS<K, V> getInstance( String region )
         throws CacheException
     {
-        CompositeCache<GroupAttrName<K>, V> cache = getCacheManager().getCache( region );
+        CompositeCache<K, V> cache = getCacheManager().getCache( region );
         return new JCS<K, V>( cache );
     }
 
@@ -83,7 +82,7 @@ public class JCS<K extends Serializable,
     public static <K extends Serializable, V extends Serializable> JCS<K, V> getInstance( String region, ICompositeCacheAttributes icca )
         throws CacheException
     {
-        CompositeCache<GroupAttrName<K>, V> cache = getCacheManager().getCache( region, icca );
+        CompositeCache<K, V> cache = getCacheManager().getCache( region, icca );
         return new JCS<K, V>( cache );
     }
 

Modified: commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/access/GroupCacheAccess.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/access/GroupCacheAccess.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/access/GroupCacheAccess.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/access/GroupCacheAccess.java Mon Mar 12 21:21:03 2012
@@ -25,6 +25,8 @@ import java.util.Set;
 
 import org.apache.jcs.access.behavior.IGroupCacheAccess;
 import org.apache.jcs.access.exception.CacheException;
+import org.apache.jcs.access.exception.InvalidArgumentException;
+import org.apache.jcs.engine.CacheElement;
 import org.apache.jcs.engine.behavior.ICacheElement;
 import org.apache.jcs.engine.behavior.ICompositeCacheAttributes;
 import org.apache.jcs.engine.behavior.IElementAttributes;
@@ -36,17 +38,24 @@ import org.apache.jcs.engine.control.gro
  * Access for groups.
  */
 public class GroupCacheAccess<K extends Serializable, V extends Serializable>
-    extends CacheAccess<GroupAttrName<K>, V>
+    extends CacheAccess<K, V>
     implements IGroupCacheAccess<K, V>
 {
+    /** a typesafe copy of the group cache */
+    private final CompositeCache<GroupAttrName<K>, V> groupCache;
+
     /**
      * Constructor for the GroupCacheAccess object
      * <p>
      * @param cacheControl
      */
-    public GroupCacheAccess( CompositeCache<GroupAttrName<K>, V> cacheControl )
+    @SuppressWarnings("unchecked")
+    public GroupCacheAccess( CompositeCache<K, V> cacheControl )
     {
         super( cacheControl );
+
+        // This is a HACK to allow different types of keys in group caches
+        this.groupCache = (CompositeCache<GroupAttrName<K>, V>) this.cacheControl;
     }
 
     /**
@@ -59,7 +68,7 @@ public class GroupCacheAccess<K extends 
     public static <K extends Serializable, V extends Serializable> GroupCacheAccess<K, V> getGroupAccess( String region )
         throws CacheException
     {
-        CompositeCache<GroupAttrName<K>, V> cache = getCacheManager().getCache( region );
+        CompositeCache<K, V> cache = getCacheManager().getCache( region );
         return new GroupCacheAccess<K, V>( cache );
     }
 
@@ -74,7 +83,7 @@ public class GroupCacheAccess<K extends 
     public static <K extends Serializable, V extends Serializable> GroupCacheAccess<K, V> getGroupAccess( String region, ICompositeCacheAttributes icca )
         throws CacheException
     {
-        CompositeCache<GroupAttrName<K>, V> cache = getCacheManager().getCache( region, icca );
+        CompositeCache<K, V> cache = getCacheManager().getCache( region, icca );
         return new GroupCacheAccess<K, V>( cache );
     }
 
@@ -89,7 +98,7 @@ public class GroupCacheAccess<K extends 
      */
     public V getFromGroup( K name, String group )
     {
-        ICacheElement<GroupAttrName<K>, V> element = this.cacheControl.get( getGroupAttrName( group, name ) );
+        ICacheElement<GroupAttrName<K>, V> element = this.groupCache.get( getGroupAttrName( group, name ) );
         return ( element != null ) ? element.getVal() : null;
     }
 
@@ -143,17 +152,37 @@ public class GroupCacheAccess<K extends 
     public void putInGroup( K name, String groupName, V value, IElementAttributes attr )
         throws CacheException
     {
+        if ( name == null )
+        {
+            throw new InvalidArgumentException( "Key must not be null" );
+        }
+
+        if ( value == null )
+        {
+            throw new InvalidArgumentException( "Value must not be null" );
+        }
+
         // unbind object first if any.
         remove( name, groupName );
 
-        if ( attr == null )
+        // Create the element and update. This may throw an IOException which
+        // should be wrapped by cache access.
+        try
         {
-            put( getGroupAttrName( groupName, name ), value );
+            GroupAttrName<K> key = getGroupAttrName( groupName, name );
+            CacheElement<GroupAttrName<K>, V> ce =
+                new CacheElement<GroupAttrName<K>, V>( this.groupCache.getCacheName(), key, value );
+
+            IElementAttributes attributes = (attr == null) ? this.groupCache.getElementAttributes() : attr;
+            ce.setElementAttributes( attributes );
+
+            this.groupCache.update( ce );
         }
-        else
+        catch ( Exception e )
         {
-            put( getGroupAttrName( groupName, name ), value, attr );
+            throw new CacheException( e );
         }
+
     }
 
     /**
@@ -163,7 +192,7 @@ public class GroupCacheAccess<K extends 
     public void remove( K name, String group )
     {
         GroupAttrName<K> key = getGroupAttrName( group, name );
-        this.cacheControl.remove( key );
+        this.groupCache.remove( key );
     }
 
     /**
@@ -176,7 +205,7 @@ public class GroupCacheAccess<K extends 
     {
         Set<K> groupKeys = new HashSet<K>();
 
-        for (GroupAttrName<K> gan : this.cacheControl.getGroupKeys( group ))
+        for (GroupAttrName<K> gan : this.groupCache.getGroupKeys( group ))
         {
             groupKeys.add(gan.attrName);
         }
@@ -192,6 +221,6 @@ public class GroupCacheAccess<K extends 
      */
     public void invalidateGroup( String group )
     {
-        this.cacheControl.remove( new GroupId( this.cacheControl.getCacheName(), group ) );
+        this.groupCache.remove(getGroupAttrName(group, null));
     }
 }

Modified: commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/access/behavior/IGroupCacheAccess.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/access/behavior/IGroupCacheAccess.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/access/behavior/IGroupCacheAccess.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/access/behavior/IGroupCacheAccess.java Mon Mar 12 21:21:03 2012
@@ -24,14 +24,12 @@ import java.util.Set;
 
 import org.apache.jcs.access.exception.CacheException;
 import org.apache.jcs.engine.behavior.IElementAttributes;
-import org.apache.jcs.engine.control.group.GroupAttrName;
 
 /**
  * IGroupCacheAccess defines group specific behavior for the client access
  * classes.
  */
 public interface IGroupCacheAccess<K extends Serializable, V extends Serializable>
-    extends ICacheAccess<GroupAttrName<K>, V>
 {
     /**
      * Gets the g attribute of the IGroupCacheAccess object

Modified: commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/disk/block/BlockDiskCache.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/disk/block/BlockDiskCache.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/disk/block/BlockDiskCache.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/disk/block/BlockDiskCache.java Mon Mar 12 21:21:03 2012
@@ -220,9 +220,9 @@ public class BlockDiskCache<K extends Se
         {
             for ( K key : this.keyStore.keySet())
             {
-                if ( key instanceof GroupAttrName && ( (GroupAttrName) key ).groupId.equals( groupId ) )
+                if ( key instanceof GroupAttrName && ( (GroupAttrName<K>) key ).groupId.equals( groupId ) )
                 {
-                    keys.add( (Serializable)( (GroupAttrName) key ).attrName );
+                    keys.add( ( (GroupAttrName<K>) key ).attrName );
                 }
             }
         }
@@ -458,7 +458,7 @@ public class BlockDiskCache<K extends Se
                     Map.Entry<K, int[]> entry = iter.next();
                     K k = entry.getKey();
 
-                    if ( k instanceof GroupAttrName && ( (GroupAttrName) k ).groupId.equals( key ) )
+                    if ( k instanceof GroupAttrName && ( (GroupAttrName<K>) k ).groupId.equals( key ) )
                     {
                         int[] ded = this.keyStore.get( key );
                         this.dataFile.freeBlocks( ded );

Modified: commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCache.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCache.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCache.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCache.java Mon Mar 12 21:21:03 2012
@@ -748,16 +748,12 @@ public class IndexedDiskCache<K extends 
 
             for (Serializable k : keyHash.keySet())
             {
-                if ( k instanceof GroupAttrName && ( (GroupAttrName) k ).groupId.equals( groupId ) )
+                if ( k instanceof GroupAttrName && ( (GroupAttrName<K>) k ).groupId.equals( groupId ) )
                 {
-                    keys.add( (Serializable) ( (GroupAttrName) k ).attrName );
+                    keys.add( ( (GroupAttrName<K>) k ).attrName );
                 }
             }
         }
-        catch ( Exception e )
-        {
-            log.error( logCacheName + "Failure getting from disk, group = " + groupName, e );
-        }
         finally
         {
             storageLock.readLock().unlock();

Modified: commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/AbstractRemoteAuxiliaryCache.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/AbstractRemoteAuxiliaryCache.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/AbstractRemoteAuxiliaryCache.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/AbstractRemoteAuxiliaryCache.java Mon Mar 12 21:21:03 2012
@@ -623,15 +623,16 @@ public abstract class AbstractRemoteAuxi
      * <p>
      * @param restoredRemote IRemoteCacheService -- the remote server or proxy to the remote server
      */
-    public void fixCache( IRemoteCacheService<K, V> restoredRemote )
+    public void fixCache( IRemoteCacheService<?, ?> restoredRemote )
     {
+        IRemoteCacheService<K, V> remote = (IRemoteCacheService<K, V>)restoredRemote;
         if ( getRemoteCacheService() != null && getRemoteCacheService() instanceof ZombieRemoteCacheService )
         {
-            ZombieRemoteCacheService zombie = (ZombieRemoteCacheService) getRemoteCacheService();
-            setRemoteCacheService( restoredRemote );
+            ZombieRemoteCacheService<K, V> zombie = (ZombieRemoteCacheService<K, V>) getRemoteCacheService();
+            setRemoteCacheService( remote );
             try
             {
-                zombie.propagateEvents( restoredRemote );
+                zombie.propagateEvents( remote );
             }
             catch ( Exception e )
             {
@@ -648,7 +649,7 @@ public abstract class AbstractRemoteAuxi
         }
         else
         {
-            setRemoteCacheService( restoredRemote );
+            setRemoteCacheService( remote );
         }
     }
 

Modified: commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheManager.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheManager.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheManager.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheManager.java Mon Mar 12 21:21:03 2012
@@ -91,7 +91,7 @@ public class RemoteCacheManager
     private final IElementSerializer elementSerializer;
 
     /** Handle to the remote cache service; or a zombie handle if failed to connect. */
-    private IRemoteCacheService<?, ?> remoteService;
+    private IRemoteCacheService<? extends Serializable, ? extends Serializable> remoteService;
 
     /**
      * Wrapper of the remote cache watch service; or wrapper of a zombie service if failed to
@@ -511,7 +511,7 @@ public class RemoteCacheManager
      * @param remoteService
      * @param remoteWatch
      */
-    public void fixCaches( IRemoteCacheService<?, ?> remoteService, IRemoteCacheObserver remoteWatch )
+    public void fixCaches( IRemoteCacheService<? extends Serializable, ? extends Serializable> remoteService, IRemoteCacheObserver remoteWatch )
     {
         if ( log.isInfoEnabled() )
         {
@@ -521,7 +521,7 @@ public class RemoteCacheManager
         {
             this.remoteService = remoteService;
             this.remoteWatch.setCacheWatch( remoteWatch );
-            for (RemoteCacheNoWait<?, ?> c : caches.values())
+            for (RemoteCacheNoWait<? extends Serializable, ? extends Serializable> c : caches.values())
             {
                 c.fixCache( this.remoteService );
             }

Modified: commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheNoWait.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheNoWait.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheNoWait.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheNoWait.java Mon Mar 12 21:21:03 2012
@@ -79,7 +79,7 @@ public class RemoteCacheNoWait<K extends
     /** The remote cache client */
     private final IRemoteCacheClient<K, V> remoteCacheClient;
 
-    /** Event queue for queueing up calls like put and remove. */
+    /** Event queue for queuing up calls like put and remove. */
     private ICacheEventQueue<K, V> cacheEventQueue;
 
     /** how many times get has been called. */
@@ -392,7 +392,7 @@ public class RemoteCacheNoWait<K extends
      * <p>
      * @param remote
      */
-    public void fixCache( IRemoteCacheService<K, V> remote )
+    public void fixCache( IRemoteCacheService<?, ?> remote )
     {
         remoteCacheClient.fixCache( remote );
         resetEventQ();

Modified: commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheClient.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheClient.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheClient.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheClient.java Mon Mar 12 21:21:03 2012
@@ -40,7 +40,7 @@ public interface IRemoteCacheClient<K ex
      * <p>
      * @param remote IRemoteCacheService -- the remote server or proxy to the remote server
      */
-    public void fixCache( IRemoteCacheService<K, V> remote );
+    public void fixCache( IRemoteCacheService<?, ?> remote );
 
     /**
      * Gets the listenerId attribute of the RemoteCacheListener object.

Modified: commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheDispatcher.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheDispatcher.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheDispatcher.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheDispatcher.java Mon Mar 12 21:21:03 2012
@@ -1,6 +1,7 @@
 package org.apache.jcs.auxiliary.remote.behavior;
 
 import java.io.IOException;
+import java.io.Serializable;
 
 import org.apache.jcs.auxiliary.remote.value.RemoteCacheRequest;
 import org.apache.jcs.auxiliary.remote.value.RemoteCacheResponse;
@@ -21,6 +22,7 @@ public interface IRemoteCacheDispatcher
      * @return RemoteCacheResponse
      * @throws IOException
      */
-    RemoteCacheResponse dispatchRequest( RemoteCacheRequest remoteCacheRequest )
-        throws IOException;
+    <K extends Serializable, V extends Serializable, KK extends Serializable, VV extends Serializable>
+        RemoteCacheResponse<K, V> dispatchRequest( RemoteCacheRequest<KK, VV> remoteCacheRequest )
+            throws IOException;
 }

Modified: commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheClient.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheClient.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheClient.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheClient.java Mon Mar 12 21:21:03 2012
@@ -387,7 +387,7 @@ public class RemoteHttpCacheClient<K ext
             throw new IOException( message );
         }
 
-        RemoteCacheRequest<K, V> remoteHttpCacheRequest =
+        RemoteCacheRequest<String, String> remoteHttpCacheRequest =
             RemoteCacheRequestFactory.createGetGroupKeysRequest( cacheName, groupName, 0 );
 
         RemoteCacheResponse<K, V> remoteHttpCacheResponse = getRemoteDispatcher().dispatchRequest( remoteHttpCacheRequest );

Modified: commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheMonitor.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheMonitor.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheMonitor.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheMonitor.java Mon Mar 12 21:21:03 2012
@@ -19,6 +19,7 @@ package org.apache.jcs.auxiliary.remote.
  * under the License.
  */
 
+import java.io.Serializable;
 import java.util.HashSet;
 import java.util.Set;
 
@@ -45,7 +46,7 @@ public class RemoteHttpCacheMonitor
     private static long idlePeriod = 3 * 1000;
 
     /** Set of remote caches to monitor. This are added on error, if not before. */
-    private final Set<RemoteHttpCache> remoteHttpCaches = new HashSet<RemoteHttpCache>();
+    private final Set<RemoteHttpCache<?, ?>> remoteHttpCaches = new HashSet<RemoteHttpCache<?, ?>>();
 
     /**
      * Must make sure RemoteCacheMonitor is started before any remote error can be detected!
@@ -102,7 +103,7 @@ public class RemoteHttpCacheMonitor
      * <p>
      * @param remoteCache
      */
-    public void notifyError( RemoteHttpCache remoteCache )
+    public void notifyError( RemoteHttpCache<?, ?> remoteCache )
     {
         if ( log.isInfoEnabled() )
         {
@@ -176,7 +177,7 @@ public class RemoteHttpCacheMonitor
                 // ignore;
             }
 
-            // The "alright" flag must be false here.
+            // The "allright" flag must be false here.
             // Simply presume we can fix all the errors until proven otherwise.
             synchronized ( this )
             {
@@ -184,16 +185,20 @@ public class RemoteHttpCacheMonitor
             }
 
             // Make a copy
-            Set<RemoteHttpCache> remoteCachesToExamine = new HashSet<RemoteHttpCache>();
+            Set<RemoteHttpCache<Serializable, Serializable>> remoteCachesToExamine =
+                new HashSet<RemoteHttpCache<Serializable, Serializable>>();
             synchronized ( this )
             {
-                remoteCachesToExamine.addAll( this.remoteHttpCaches );
+                for (RemoteHttpCache<?, ?> remoteCache : this.remoteHttpCaches)
+                {
+                    remoteCachesToExamine.add( (RemoteHttpCache<Serializable, Serializable>)remoteCache );
+                }
             }
             // If any cache is in error, it strongly suggests all caches
             // managed by the
             // same RmicCacheManager instance are in error. So we fix
             // them once and for all.
-            for (RemoteHttpCache remoteCache : remoteCachesToExamine)
+            for (RemoteHttpCache<Serializable, Serializable> remoteCache : remoteCachesToExamine)
             {
                 try
                 {
@@ -201,7 +206,7 @@ public class RemoteHttpCacheMonitor
                     {
                         RemoteHttpCacheAttributes attributes = remoteCache.getRemoteHttpCacheAttributes();
 
-                        IRemoteHttpCacheClient remoteService = RemoteHttpCacheManager.getInstance()
+                        IRemoteHttpCacheClient<Serializable, Serializable> remoteService = RemoteHttpCacheManager.getInstance()
                             .createRemoteHttpCacheClientForAttributes( attributes );
 
                         if ( log.isInfoEnabled() )

Modified: commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteCacheServiceAdaptor.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteCacheServiceAdaptor.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteCacheServiceAdaptor.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteCacheServiceAdaptor.java Mon Mar 12 21:21:03 2012
@@ -137,7 +137,8 @@ public class RemoteCacheServiceAdaptor<K
                         {
                             groupKeys = Collections.emptySet();
                         }
-                        response.getPayload().put( request.getKey(), groupKeys );
+                        // FIXME: Re-enable
+                        //response.getPayload().put( request.getKey(), groupKeys );
                         break;
                     default:
                         String message = "Unknown event type.  Cannot process " + request;

Modified: commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/util/RemoteCacheRequestFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/util/RemoteCacheRequestFactory.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/util/RemoteCacheRequestFactory.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/auxiliary/remote/util/RemoteCacheRequestFactory.java Mon Mar 12 21:21:03 2012
@@ -121,9 +121,9 @@ public class RemoteCacheRequestFactory
      * @param requesterId
      * @return RemoteHttpCacheRequest
      */
-    public static <K extends Serializable, V extends Serializable> RemoteCacheRequest<K, V> createGetGroupKeysRequest( String cacheName, String groupName, long requesterId )
+    public static RemoteCacheRequest<String, String> createGetGroupKeysRequest( String cacheName, String groupName, long requesterId )
     {
-        RemoteCacheRequest<K, V> request = new RemoteCacheRequest<K, V>();
+        RemoteCacheRequest<String, String> request = new RemoteCacheRequest<String, String>();
         request.setCacheName( cacheName );
         request.setKey( groupName );
         request.setRequesterId( requesterId );

Modified: commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/engine/control/CompositeCache.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/engine/control/CompositeCache.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/engine/control/CompositeCache.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/engine/control/CompositeCache.java Mon Mar 12 21:21:03 2012
@@ -48,7 +48,7 @@ import org.apache.jcs.engine.control.eve
 import org.apache.jcs.engine.control.group.GroupId;
 import org.apache.jcs.engine.match.KeyMatcherPatternImpl;
 import org.apache.jcs.engine.match.behavior.IKeyMatcher;
-import org.apache.jcs.engine.memory.MemoryCache;
+import org.apache.jcs.engine.memory.behavior.IMemoryCache;
 import org.apache.jcs.engine.memory.lru.LRUMemoryCache;
 import org.apache.jcs.engine.memory.util.MemoryElementDescriptor;
 import org.apache.jcs.engine.stats.CacheStats;
@@ -74,7 +74,7 @@ public class CompositeCache<K extends Se
     private final static Log log = LogFactory.getLog( CompositeCache.class );
 
     /**
-     * EventQueue for handling element events. Lazy initialized. One for each region. To be more eficient, the manager
+     * EventQueue for handling element events. Lazy initialized. One for each region. To be more efficient, the manager
      * should pass a shared queue in.
      */
     public IElementEventQueue elementEventQ;
@@ -119,7 +119,7 @@ public class CompositeCache<K extends Se
      * 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.
      */
-    private MemoryCache<K, V> memCache;
+    private IMemoryCache<K, V> memCache;
 
     /** Key matcher used by the getMatching API */
     protected IKeyMatcher<K> keyMatcher = new KeyMatcherPatternImpl<K>();
@@ -1607,7 +1607,7 @@ public class CompositeCache<K extends Se
             try
             {
                 Class<?> c = Class.forName( cattr.getMemoryCacheName() );
-                memCache = (MemoryCache<K, V>) c.newInstance();
+                memCache = (IMemoryCache<K, V>) c.newInstance();
                 memCache.initialize( this );
             }
             catch ( Exception e )
@@ -1629,7 +1629,7 @@ public class CompositeCache<K extends Se
      * <p>
      * @return the MemoryCache implementation
      */
-    public MemoryCache<K, V> getMemoryCache()
+    public IMemoryCache<K, V> getMemoryCache()
     {
         return memCache;
     }

Modified: commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/engine/memory/AbstractDoulbeLinkedListMemoryCache.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/engine/memory/AbstractDoulbeLinkedListMemoryCache.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/engine/memory/AbstractDoulbeLinkedListMemoryCache.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/engine/memory/AbstractDoulbeLinkedListMemoryCache.java Mon Mar 12 21:21:03 2012
@@ -14,7 +14,6 @@ import org.apache.jcs.engine.CacheConsta
 import org.apache.jcs.engine.behavior.ICacheElement;
 import org.apache.jcs.engine.control.CompositeCache;
 import org.apache.jcs.engine.control.group.GroupAttrName;
-import org.apache.jcs.engine.control.group.GroupId;
 import org.apache.jcs.engine.memory.util.MemoryElementDescriptor;
 import org.apache.jcs.engine.stats.StatElement;
 import org.apache.jcs.engine.stats.Stats;
@@ -335,7 +334,7 @@ public abstract class AbstractDoulbeLink
                 }
             }
         }
-        else if ( key instanceof GroupId )
+        else if ( key instanceof GroupAttrName )
         {
             // remove all keys of the same name hierarchy.
             synchronized ( map )
@@ -345,7 +344,8 @@ public abstract class AbstractDoulbeLink
                     Map.Entry<K, MemoryElementDescriptor<K, V>> entry = itr.next();
                     K k = entry.getKey();
 
-                    if ( k instanceof GroupAttrName && ( (GroupAttrName) k ).groupId.equals( key ) )
+                    if ( k instanceof GroupAttrName &&
+                        ((GroupAttrName)k).groupId.equals(((GroupAttrName)key).groupId))
                     {
                         list.remove( entry.getValue() );
                         itr.remove();
@@ -691,7 +691,7 @@ public abstract class AbstractDoulbeLink
      * This returns semi-structured information on the memory cache, such as the size, put count,
      * hit count, and miss count.
      * <p>
-     * @see org.apache.jcs.engine.memory.MemoryCache#getStatistics()
+     * @see org.apache.jcs.engine.memory.IMemoryCache#getStatistics()
      */
     @Override
     public synchronized IStats getStatistics()

Modified: commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/engine/memory/AbstractMemoryCache.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/engine/memory/AbstractMemoryCache.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/engine/memory/AbstractMemoryCache.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/engine/memory/AbstractMemoryCache.java Mon Mar 12 21:21:03 2012
@@ -40,6 +40,7 @@ import org.apache.jcs.engine.behavior.IE
 import org.apache.jcs.engine.control.CompositeCache;
 import org.apache.jcs.engine.control.group.GroupAttrName;
 import org.apache.jcs.engine.control.group.GroupId;
+import org.apache.jcs.engine.memory.behavior.IMemoryCache;
 import org.apache.jcs.engine.memory.shrinking.ShrinkerThread;
 import org.apache.jcs.engine.memory.util.MemoryElementDescriptor;
 import org.apache.jcs.engine.stats.Stats;
@@ -52,7 +53,7 @@ import org.apache.jcs.engine.stats.behav
  * use the shrinker, the clock daemon will be setup to run the shrinker on this region.
  */
 public abstract class AbstractMemoryCache<K extends Serializable, V extends Serializable>
-    implements MemoryCache<K, V>, Serializable
+    implements IMemoryCache<K, V>, Serializable
 {
     /** Don't change. */
     private static final long serialVersionUID = -4494626991630099575L;
@@ -361,9 +362,9 @@ public abstract class AbstractMemoryCach
             {
                 K k = entry.getKey();
 
-                if ( k instanceof GroupAttrName && ( (GroupAttrName) k ).groupId.equals( groupId ) )
+                if ( k instanceof GroupAttrName && ( (GroupAttrName<K>) k ).groupId.equals( groupId ) )
                 {
-                    keys.add(( (GroupAttrName) k ).attrName );
+                    keys.add(( (GroupAttrName<K>) k ).attrName );
                 }
             }
         }

Modified: commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/engine/memory/shrinking/ShrinkerThread.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/engine/memory/shrinking/ShrinkerThread.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/engine/memory/shrinking/ShrinkerThread.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/java/org/apache/jcs/engine/memory/shrinking/ShrinkerThread.java Mon Mar 12 21:21:03 2012
@@ -31,7 +31,7 @@ import org.apache.jcs.engine.control.eve
 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.IElementEventHandler;
-import org.apache.jcs.engine.memory.MemoryCache;
+import org.apache.jcs.engine.memory.behavior.IMemoryCache;
 
 /**
  * A background memory shrinker. Memory problems and concurrent modification exception caused by
@@ -45,7 +45,7 @@ public class ShrinkerThread<K extends Se
     private final static Log log = LogFactory.getLog( ShrinkerThread.class );
 
     /** The MemoryCache instance which this shrinker is watching */
-    private final MemoryCache<K, V> cache;
+    private final IMemoryCache<K, V> cache;
 
     /** Maximum memory idle time for the whole cache */
     private final long maxMemoryIdleTime;
@@ -61,7 +61,7 @@ public class ShrinkerThread<K extends Se
      * <p>
      * @param cache The MemoryCache which the new shrinker should watch.
      */
-    public ShrinkerThread( MemoryCache<K, V> cache )
+    public ShrinkerThread( IMemoryCache<K, V> cache )
     {
         super();
 

Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/access/CacheAccessUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/access/CacheAccessUnitTest.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/access/CacheAccessUnitTest.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/access/CacheAccessUnitTest.java Mon Mar 12 21:21:03 2012
@@ -49,7 +49,7 @@ public class CacheAccessUnitTest
     public void testPutSafe()
         throws Exception
     {
-        CacheAccess access = CacheAccess.getAccess( "test" );
+        CacheAccess<String, String> access = CacheAccess.getAccess( "test" );
         assertNotNull( "We should have an access class", access );
 
         String key = "mykey";
@@ -57,7 +57,7 @@ public class CacheAccessUnitTest
 
         access.put( key, value );
 
-        String returnedValue1 = (String) access.get( key );
+        String returnedValue1 = access.get( key );
         assertEquals( "Wrong value returned.", value, returnedValue1 );
 
         try
@@ -71,7 +71,7 @@ public class CacheAccessUnitTest
             assertTrue( "Should have the key in the error message.", e.getMessage().indexOf( "[" + key + "]" ) != -1 );
         }
 
-        String returnedValue2 = (String) access.get( key );
+        String returnedValue2 = access.get( key );
         assertEquals( "Wrong value returned.  Shoudl still be the original.", value, returnedValue2 );
     }
 
@@ -82,7 +82,7 @@ public class CacheAccessUnitTest
     public void testPutNullKey()
         throws Exception
     {
-        CacheAccess access = CacheAccess.getAccess( "test" );
+        CacheAccess<String, String> access = CacheAccess.getAccess( "test" );
         assertNotNull( "We should have an access class", access );
 
         String key = null;
@@ -106,7 +106,7 @@ public class CacheAccessUnitTest
     public void testPutNullValue()
         throws Exception
     {
-        CacheAccess access = CacheAccess.getAccess( "test" );
+        CacheAccess<String, String> access = CacheAccess.getAccess( "test" );
         assertNotNull( "We should have an access class", access );
 
         String key = "myKey";
@@ -124,13 +124,13 @@ public class CacheAccessUnitTest
     }
 
     /**
-     * Verify that elements that go in the region after this call takethe new attributes.
+     * Verify that elements that go in the region after this call take the new attributes.
      * @throws Exception
      */
     public void testSetDefaultElementAttributes()
         throws Exception
     {
-        CacheAccess access = CacheAccess.getAccess( "test" );
+        CacheAccess<String, String> access = CacheAccess.getAccess( "test" );
         assertNotNull( "We should have an access class", access );
 
         long maxLife = 9876;
@@ -161,7 +161,7 @@ public class CacheAccessUnitTest
         throws Exception
     {
         //SETUP
-        CacheAccess access = CacheAccess.getAccess( "test" );
+        CacheAccess<String, String> access = CacheAccess.getAccess( "test" );
         assertNotNull( "We should have an access class", access );
 
         String keyOne = "mykeyone";
@@ -175,19 +175,19 @@ public class CacheAccessUnitTest
         access.put( keyTwo, valueTwo );
         access.put( keyThree, valueThree );
 
-        Set input = new HashSet();
+        Set<String> input = new HashSet<String>();
         input.add( keyOne );
         input.add( keyTwo );
 
         //DO WORK
-        Map result = access.getCacheElements( input );
+        Map<String, ICacheElement<String, String>> result = access.getCacheElements( input );
 
         //VERIFY
         assertEquals( "map size", 2, result.size() );
-        ICacheElement<String, String> elementOne = (ICacheElement) result.get( keyOne );
+        ICacheElement<String, String> elementOne = result.get( keyOne );
         assertEquals( "value one", keyOne, elementOne.getKey() );
         assertEquals( "value one", valueOne, elementOne.getVal() );
-        ICacheElement<String, String> elementTwo = (ICacheElement) result.get( keyTwo );
+        ICacheElement<String, String> elementTwo = result.get( keyTwo );
         assertEquals( "value two", keyTwo, elementTwo.getKey() );
         assertEquals( "value two", valueTwo, elementTwo.getVal() );
     }
@@ -199,7 +199,7 @@ public class CacheAccessUnitTest
     public void testRegionDefiniton()
         throws Exception
     {
-        CacheAccess access = CacheAccess.defineRegion( "test" );
+        CacheAccess<String, String> access = CacheAccess.defineRegion( "test" );
         assertNotNull( "We should have an access class", access );
     }
 
@@ -215,7 +215,7 @@ public class CacheAccessUnitTest
         long maxIdleTime = 8765;
         ca.setMaxMemoryIdleTimeSeconds( maxIdleTime );
 
-        CacheAccess access = CacheAccess.defineRegion( "testRegionDefinitonWithAttributes", ca );
+        CacheAccess<String, String> access = CacheAccess.defineRegion( "testRegionDefinitonWithAttributes", ca );
         assertNotNull( "We should have an access class", access );
 
         ICompositeCacheAttributes ca2 = access.getCacheAttributes();
@@ -239,7 +239,7 @@ public class CacheAccessUnitTest
         IElementAttributes attr = new ElementAttributes();
         attr.setMaxLifeSeconds( maxLife );
 
-        CacheAccess access = CacheAccess.defineRegion( "testRegionDefinitonWithAttributes", ca, attr );
+        CacheAccess<String, String> access = CacheAccess.defineRegion( "testRegionDefinitonWithAttributes", ca, attr );
         assertNotNull( "We should have an access class", access );
 
         ICompositeCacheAttributes ca2 = access.getCacheAttributes();
@@ -267,7 +267,7 @@ public class CacheAccessUnitTest
         IElementAttributes attr = new ElementAttributes();
         attr.setMaxLifeSeconds( maxLife );
 
-        CacheAccess access = CacheAccess.defineRegion( "testGetMatching_Normal", cattr, attr );
+        CacheAccess<String, Integer> access = CacheAccess.defineRegion( "testGetMatching_Normal", cattr, attr );
 
         // DO WORK
         int numToInsertPrefix1 = 10;
@@ -284,8 +284,8 @@ public class CacheAccessUnitTest
             access.put( keyprefix2 + String.valueOf( i ), Integer.valueOf( i ) );
         }
 
-        Map result1 = access.getMatching( keyprefix1 + ".+" );
-        Map result2 = access.getMatching( keyprefix2 + "\\S+" );
+        Map<String, Integer> result1 = access.getMatching( keyprefix1 + ".+" );
+        Map<String, Integer> result2 = access.getMatching( keyprefix2 + "\\S+" );
 
         // VERIFY
         assertEquals( "Wrong number returned 1:", numToInsertPrefix1, result1.size() );
@@ -293,8 +293,8 @@ public class CacheAccessUnitTest
         //System.out.println( result1 );
 
         // verify that the elements are unwrapped
-        Set keySet1 = result1.keySet();
-        Iterator it1 = keySet1.iterator();
+        Set<String> keySet1 = result1.keySet();
+        Iterator<String> it1 = keySet1.iterator();
         while ( it1.hasNext() )
         {
             Object key = it1.next();
@@ -324,7 +324,7 @@ public class CacheAccessUnitTest
         IElementAttributes attr = new ElementAttributes();
         attr.setMaxLifeSeconds( maxLife );
 
-        CacheAccess access = CacheAccess.defineRegion( "testGetMatching_Normal", cattr, attr );
+        CacheAccess<String, Integer> access = CacheAccess.defineRegion( "testGetMatching_Normal", cattr, attr );
 
         // DO WORK
         int numToInsertPrefix1 = 10;
@@ -341,8 +341,8 @@ public class CacheAccessUnitTest
             access.put( keyprefix2 + String.valueOf( i ), Integer.valueOf( i ) );
         }
 
-        Map result1 = access.getMatchingCacheElements( keyprefix1 + "\\S+" );
-        Map result2 = access.getMatchingCacheElements( keyprefix2 + ".+" );
+        Map<String, ICacheElement<String, Integer>> result1 = access.getMatchingCacheElements( keyprefix1 + "\\S+" );
+        Map<String, ICacheElement<String, Integer>> result2 = access.getMatchingCacheElements( keyprefix2 + ".+" );
 
         // VERIFY
         assertEquals( "Wrong number returned 1:", numToInsertPrefix1, result1.size() );
@@ -350,8 +350,8 @@ public class CacheAccessUnitTest
         //System.out.println( result1 );
 
         // verify that the elements are wrapped
-        Set keySet1 = result1.keySet();
-        Iterator it1 = keySet1.iterator();
+        Set<String> keySet1 = result1.keySet();
+        Iterator<String> it1 = keySet1.iterator();
         while ( it1.hasNext() )
         {
             Object key = it1.next();

Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/MockAuxiliaryCacheFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/MockAuxiliaryCacheFactory.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/MockAuxiliaryCacheFactory.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/MockAuxiliaryCacheFactory.java Mon Mar 12 21:21:03 2012
@@ -1,5 +1,7 @@
 package org.apache.jcs.auxiliary;
 
+import java.io.Serializable;
+
 import org.apache.jcs.engine.behavior.ICompositeCacheManager;
 import org.apache.jcs.engine.behavior.IElementSerializer;
 import org.apache.jcs.engine.logging.behavior.ICacheEventLogger;
@@ -20,10 +22,11 @@ public class MockAuxiliaryCacheFactory
      * @param elementSerializer
      * @return AuxiliaryCache
      */
-    public AuxiliaryCache createCache( AuxiliaryCacheAttributes attr, ICompositeCacheManager cacheMgr,
-                                       ICacheEventLogger cacheEventLogger, IElementSerializer elementSerializer )
+    public <K extends Serializable, V extends Serializable> AuxiliaryCache<K, V>
+        createCache( AuxiliaryCacheAttributes attr, ICompositeCacheManager cacheMgr,
+           ICacheEventLogger cacheEventLogger, IElementSerializer elementSerializer )
     {
-        MockAuxiliaryCache auxCache = new MockAuxiliaryCache();
+        MockAuxiliaryCache<K, V> auxCache = new MockAuxiliaryCache<K, V>();
         auxCache.setCacheEventLogger( cacheEventLogger );
         auxCache.setElementSerializer( elementSerializer );
         return auxCache;

Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheKeyStoreUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheKeyStoreUnitTest.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheKeyStoreUnitTest.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheKeyStoreUnitTest.java Mon Mar 12 21:21:03 2012
@@ -30,7 +30,7 @@ public class BlockDiskCacheKeyStoreUnitT
     extends TestCase
 {
     /** Directory name */
-    private String rootDirName = "target/test-sandbox/block";
+    private final String rootDirName = "target/test-sandbox/block";
 
     /**
      * Put a bunch of keys inthe key store and verify that they are present.
@@ -51,9 +51,9 @@ public class BlockDiskCacheKeyStoreUnitT
         attributes.setMaxKeySize( maxKeys );
         attributes.setBlockSizeBytes( bytesPerBlock );
 
-        BlockDiskCache blockDiskCache = new BlockDiskCache( attributes );
+        BlockDiskCache<String, String> blockDiskCache = new BlockDiskCache<String, String>( attributes );
 
-        BlockDiskKeyStore keyStore = new BlockDiskKeyStore( attributes, blockDiskCache );
+        BlockDiskKeyStore<String> keyStore = new BlockDiskKeyStore<String>( attributes, blockDiskCache );
 
         // DO WORK
         int numElements = 100;
@@ -92,9 +92,9 @@ public class BlockDiskCacheKeyStoreUnitT
         attributes.setMaxKeySize( maxKeys );
         attributes.setBlockSizeBytes( bytesPerBlock );
 
-        BlockDiskCache blockDiskCache = new BlockDiskCache( attributes );
+        BlockDiskCache<String, String> blockDiskCache = new BlockDiskCache<String, String>( attributes );
 
-        BlockDiskKeyStore keyStore = new BlockDiskKeyStore( attributes, blockDiskCache );
+        BlockDiskKeyStore<String> keyStore = new BlockDiskKeyStore<String>( attributes, blockDiskCache );
 
         // DO WORK
         int numElements = 1000;

Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheManagerUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheManagerUnitTest.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheManagerUnitTest.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheManagerUnitTest.java Mon Mar 12 21:21:03 2012
@@ -2,6 +2,7 @@ package org.apache.jcs.auxiliary.disk.bl
 
 import junit.framework.TestCase;
 
+import org.apache.jcs.auxiliary.AuxiliaryCache;
 import org.apache.jcs.auxiliary.MockCacheEventLogger;
 import org.apache.jcs.engine.behavior.IElementSerializer;
 import org.apache.jcs.engine.control.MockElementSerializer;
@@ -26,7 +27,8 @@ public class BlockDiskCacheManagerUnitTe
                                                                            elementSerializer );
 
         // DO WORK
-        BlockDiskCache cache = (BlockDiskCache) manager.getCache( cacheName );
+        AuxiliaryCache<String, String> auxcache = manager.getCache(cacheName);
+        BlockDiskCache<String, String> cache = (BlockDiskCache<String, String>) auxcache;
 
         // VERIFY
         assertEquals( "wrong cacheEventLogger", cacheEventLogger, cache.getCacheEventLogger() );

Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheRandomConcurrentTestUtil.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheRandomConcurrentTestUtil.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheRandomConcurrentTestUtil.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheRandomConcurrentTestUtil.java Mon Mar 12 21:21:03 2012
@@ -64,11 +64,11 @@ public class BlockDiskCacheRandomConcurr
 
         // make sure a simple put then get works
         // this may fail if the other tests are flooding the disk cache
-        JCS jcs = JCS.getInstance( region );
+        JCS<String, String> jcs = JCS.getInstance( region );
         String key = "testKey" + testNum;
         String data = "testData" + testNum;
         jcs.put( key, data );
-        String value = (String) jcs.get( key );
+        String value = jcs.get( key );
         assertEquals( data, value );
     }
 

Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheSteadyLoadTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheSteadyLoadTest.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheSteadyLoadTest.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheSteadyLoadTest.java Mon Mar 12 21:21:03 2012
@@ -66,7 +66,7 @@ public class BlockDiskCacheSteadyLoadTes
         int runs = 1000;
         int upperKB = 50;
 
-        JCS jcs = JCS.getInstance( ( numPerRun / 2 ) + "aSecond" );
+        JCS<String, DiskTestObject> jcs = JCS.getInstance( ( numPerRun / 2 ) + "aSecond" );
 
         ElapsedTimer timer = new ElapsedTimer();
         int numToGet = numPerRun * ( runs / 10 );

Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskElementDescriptorUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskElementDescriptorUnitTest.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskElementDescriptorUnitTest.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskElementDescriptorUnitTest.java Mon Mar 12 21:21:03 2012
@@ -44,7 +44,7 @@ public class BlockDiskElementDescriptorU
         System.out.println( "Before: " + memoryBefore );
 
         int numElements = 25000;
-        BlockDiskElementDescriptor[] elements = new BlockDiskElementDescriptor[numElements];
+        BlockDiskElementDescriptor<Integer>[] elements = new BlockDiskElementDescriptor[numElements];
 
         long memoryStart = measureMemoryUse();
         System.out.println( "Start: " + memoryStart );
@@ -52,7 +52,7 @@ public class BlockDiskElementDescriptorU
         // DO WORK
         for ( int i = 0; i < numElements; i++ )
         {
-            BlockDiskElementDescriptor descriptor = new BlockDiskElementDescriptor();
+            BlockDiskElementDescriptor<Integer> descriptor = new BlockDiskElementDescriptor<Integer>();
             descriptor.setKey( Integer.valueOf( i ) );
             descriptor.setBlocks( new int[] { 1, 2 } );
             elements[i] = descriptor;

Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/file/FileDiskCacheFactoryUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/file/FileDiskCacheFactoryUnitTest.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/file/FileDiskCacheFactoryUnitTest.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/file/FileDiskCacheFactoryUnitTest.java Mon Mar 12 21:21:03 2012
@@ -22,14 +22,14 @@ public class FileDiskCacheFactoryUnitTes
         cattr.setCacheName( cacheName );
         cattr.setDiskPath( "target/test-sandbox/FileDiskCacheFactoryUnitTest" );
 
-        ICompositeCacheManager cacheMgr = new MockCompositeCacheManager();
+        ICompositeCacheManager cacheMgr = new MockCompositeCacheManager<String, String>();
         ICacheEventLogger cacheEventLogger = new MockCacheEventLogger();
         IElementSerializer elementSerializer = new MockElementSerializer();
 
         FileDiskCacheFactory factory = new FileDiskCacheFactory();
 
         // DO WORK
-        FileDiskCache result = (FileDiskCache) factory.createCache( cattr, cacheMgr, cacheEventLogger,
+        FileDiskCache<String, String> result = (FileDiskCache) factory.createCache( cattr, cacheMgr, cacheEventLogger,
                                                                     elementSerializer );
 
         // VERIFY

Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/indexed/DiskTestObjectUtil.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/indexed/DiskTestObjectUtil.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/indexed/DiskTestObjectUtil.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/indexed/DiskTestObjectUtil.java Mon Mar 12 21:21:03 2012
@@ -20,6 +20,7 @@ package org.apache.jcs.auxiliary.disk.in
  */
 
 import java.io.IOException;
+import java.io.Serializable;
 import java.util.Random;
 
 import org.apache.jcs.auxiliary.disk.DiskTestObject;
@@ -63,7 +64,7 @@ public class DiskTestObjectUtil
      * @return size
      * @throws IOException
      */
-    public static long totalSize( ICacheElement[] elements, int endPosition )
+    public static <K extends Serializable, V extends Serializable> long totalSize( ICacheElement<K, V>[] elements, int endPosition )
         throws IOException
     {
         return totalSize( elements, 0, endPosition );
@@ -78,7 +79,7 @@ public class DiskTestObjectUtil
      * @return size
      * @throws IOException
      */
-    public static long totalSize( ICacheElement[] elements, int startPosition, int endPosition )
+    public static <K extends Serializable, V extends Serializable> long totalSize( ICacheElement<K, V>[] elements, int startPosition, int endPosition )
         throws IOException
     {
         StandardSerializer serializer = new StandardSerializer();
@@ -99,16 +100,16 @@ public class DiskTestObjectUtil
      * @param cacheName
      * @return ICacheElement[]
      */
-    public static ICacheElement[] createCacheElementsWithTestObjects( int numToCreate, int bytes, String cacheName )
+    public static ICacheElement<Integer, DiskTestObject>[] createCacheElementsWithTestObjects( int numToCreate, int bytes, String cacheName )
     {
-        ICacheElement[] elements = new ICacheElement[numToCreate];
+        ICacheElement<Integer, DiskTestObject>[] elements = new ICacheElement[numToCreate];
         for ( int i = 0; i < numToCreate; i++ )
         {
             // 24 KB
             int size = bytes * 1024;
             DiskTestObject tile = new DiskTestObject( Integer.valueOf( i ), new byte[size] );
 
-            ICacheElement<String, String> element = new CacheElement( cacheName, tile.id, tile );
+            ICacheElement<Integer, DiskTestObject> element = new CacheElement<Integer, DiskTestObject>( cacheName, tile.id, tile );
             elements[i] = element;
         }
         return elements;
@@ -121,9 +122,9 @@ public class DiskTestObjectUtil
      * @param cacheName
      * @return ICacheElement[]
      */
-    public static ICacheElement[] createCacheElementsWithTestObjectsOfVariableSizes( int numToCreate, String cacheName )
+    public static ICacheElement<Integer, DiskTestObject>[] createCacheElementsWithTestObjectsOfVariableSizes( int numToCreate, String cacheName )
     {
-        ICacheElement[] elements = new ICacheElement[numToCreate];
+        ICacheElement<Integer, DiskTestObject>[] elements = new ICacheElement[numToCreate];
         Random random = new Random( 89 );
         for ( int i = 0; i < numToCreate; i++ )
         {
@@ -132,7 +133,7 @@ public class DiskTestObjectUtil
             int size = ( bytes + 4 ) * 1024;
             DiskTestObject tile = new DiskTestObject( Integer.valueOf( i ), new byte[size] );
 
-            ICacheElement<String, String> element = new CacheElement( cacheName, tile.id, tile );
+            ICacheElement<Integer, DiskTestObject> element = new CacheElement<Integer, DiskTestObject>( cacheName, tile.id, tile );
             elements[i] = element;
         }
         return elements;

Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexDiskCacheUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexDiskCacheUnitTest.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexDiskCacheUnitTest.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexDiskCacheUnitTest.java Mon Mar 12 21:21:03 2012
@@ -27,6 +27,7 @@ import java.util.Set;
 import junit.framework.TestCase;
 
 import org.apache.jcs.auxiliary.MockCacheEventLogger;
+import org.apache.jcs.auxiliary.disk.DiskTestObject;
 import org.apache.jcs.engine.CacheElement;
 import org.apache.jcs.engine.ElementAttributes;
 import org.apache.jcs.engine.behavior.ICacheElement;
@@ -71,7 +72,7 @@ public class IndexDiskCacheUnitTest
         for ( int i = 0; i < cnt; i++ )
         {
             ICacheElement<String, String> element = disk.processGet( "key:" + i );
-            assertNotNull( "Should have recevied an element.", element );
+            assertNotNull( "Should have received an element.", element );
             assertEquals( "Element is wrong.", "data:" + i, element.getVal() );
         }
 
@@ -122,7 +123,7 @@ public class IndexDiskCacheUnitTest
         {
             disk.remove( "key:" + i );
             ICacheElement<String, String> element = disk.processGet( "key:" + i );
-            assertNull( "Should not have recevied an element.", element );
+            assertNull( "Should not have received an element.", element );
         }
     }
 
@@ -276,11 +277,11 @@ public class IndexDiskCacheUnitTest
         IndexedDiskCacheAttributes cattr = new IndexedDiskCacheAttributes();
         cattr.setCacheName( "testFileSize" );
         cattr.setDiskPath( "target/test-sandbox/UnitTest" );
-        IndexedDiskCache<String, String> disk = new IndexedDiskCache<String, String>( cattr );
+        IndexedDiskCache<Integer, DiskTestObject> disk = new IndexedDiskCache<Integer, DiskTestObject>( cattr );
 
         int numberToInsert = 20;
         int bytes = 24;
-        ICacheElement<String, String>[] elements = DiskTestObjectUtil.createCacheElementsWithTestObjects( numberToInsert, bytes, cattr
+        ICacheElement<Integer, DiskTestObject>[] elements = DiskTestObjectUtil.createCacheElementsWithTestObjects( numberToInsert, bytes, cattr
             .getCacheName() );
 
         for ( int i = 0; i < elements.length; i++ )
@@ -319,10 +320,10 @@ public class IndexDiskCacheUnitTest
         cattr.setOptimizeAtRemoveCount( numberToInsert );
         cattr.setMaxKeySize( numberToInsert * 2 );
         cattr.setMaxPurgatorySize( numberToInsert );
-        IndexedDiskCache<String, String> disk = new IndexedDiskCache<String, String>( cattr );
+        IndexedDiskCache<Integer, DiskTestObject> disk = new IndexedDiskCache<Integer, DiskTestObject>( cattr );
 
         int bytes = 24;
-        ICacheElement<String, String>[] elements = DiskTestObjectUtil.createCacheElementsWithTestObjects( numberToInsert, bytes, cattr
+        ICacheElement<Integer, DiskTestObject>[] elements = DiskTestObjectUtil.createCacheElementsWithTestObjects( numberToInsert, bytes, cattr
             .getCacheName() );
 
         for ( int i = 0; i < elements.length; i++ )
@@ -365,11 +366,11 @@ public class IndexDiskCacheUnitTest
         cattr.setOptimizeAtRemoveCount( numberToInsert );
         cattr.setMaxKeySize( numberToInsert * 2 );
         cattr.setMaxPurgatorySize( numberToInsert );
-        IndexedDiskCache<String, String> disk = new IndexedDiskCache<String, String>( cattr );
+        IndexedDiskCache<Integer, DiskTestObject> disk = new IndexedDiskCache<Integer, DiskTestObject>( cattr );
 
         // we will reuse these
         int bytes = 24;
-        ICacheElement<String, String>[] elements = DiskTestObjectUtil.createCacheElementsWithTestObjects( numberToInsert, bytes, cattr
+        ICacheElement<Integer, DiskTestObject>[] elements = DiskTestObjectUtil.createCacheElementsWithTestObjects( numberToInsert, bytes, cattr
             .getCacheName() );
 
         // Add some to the disk
@@ -418,11 +419,11 @@ public class IndexDiskCacheUnitTest
         IndexedDiskCacheAttributes cattr = new IndexedDiskCacheAttributes();
         cattr.setCacheName( "testBytesFreeSize" );
         cattr.setDiskPath( "target/test-sandbox/UnitTest" );
-        IndexedDiskCache<String, String> disk = new IndexedDiskCache<String, String>( cattr );
+        IndexedDiskCache<Integer, DiskTestObject> disk = new IndexedDiskCache<Integer, DiskTestObject>( cattr );
 
         int numberToInsert = 20;
         int bytes = 24;
-        ICacheElement<String, String>[] elements = DiskTestObjectUtil.createCacheElementsWithTestObjects( numberToInsert, bytes, cattr
+        ICacheElement<Integer, DiskTestObject>[] elements = DiskTestObjectUtil.createCacheElementsWithTestObjects( numberToInsert, bytes, cattr
             .getCacheName() );
 
         for ( int i = 0; i < elements.length; i++ )
@@ -490,7 +491,7 @@ public class IndexDiskCacheUnitTest
         for ( int i = 0; i < cnt; i++ )
         {
             ICacheElement<String, String> element = disk.processGet( i + ":key" );
-            assertNotNull( "Shoulds have recevied an element.", element );
+            assertNotNull( "Shoulds have received an element.", element );
         }
 
         // remove each
@@ -498,7 +499,7 @@ public class IndexDiskCacheUnitTest
         {
             disk.remove( i + ":" );
             ICacheElement<String, String> element = disk.processGet( i + ":key" );
-            assertNull( "Should not have recevied an element.", element );
+            assertNull( "Should not have received an element.", element );
         }
         // https://issues.apache.org/jira/browse/JCS-67
         assertEquals( "Recylenbin should not have more elements than we removed. Check for JCS-67", cnt, disk
@@ -542,13 +543,12 @@ public class IndexDiskCacheUnitTest
         {
             GroupAttrName<String> groupAttrName = getGroupAttrName( cacheName, groupName, i + ":key" );
             ICacheElement<GroupAttrName<String>, String> element = disk.processGet( groupAttrName );
-            assertNotNull( "Should have recevied an element.", element );
+            assertNotNull( "Should have received an element.", element );
         }
 
         // DO WORK
         // remove the group
-        GroupId gid = new GroupId( cacheName, groupName );
-        disk.remove( gid );
+        disk.remove( getGroupAttrName( cacheName, groupName, null ) );
 
         for ( int i = 0; i < cnt; i++ )
         {
@@ -556,7 +556,7 @@ public class IndexDiskCacheUnitTest
             ICacheElement<GroupAttrName<String>, String> element = disk.processGet( groupAttrName );
 
             // VERIFY
-            assertNull( "Should not have recevied an element.", element );
+            assertNull( "Should not have received an element.", element );
         }
 
     }

Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheConcurrentUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheConcurrentUnitTest.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheConcurrentUnitTest.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheConcurrentUnitTest.java Mon Mar 12 21:21:03 2012
@@ -135,7 +135,7 @@ public class IndexedDiskCacheConcurrentU
     public void runTestForRegion( String region )
         throws Exception
     {
-        JCS jcs = JCS.getInstance( region );
+        JCS<String, String> jcs = JCS.getInstance( region );
 
         // Add items to cache
         for ( int i = 0; i <= items; i++ )
@@ -146,22 +146,22 @@ public class IndexedDiskCacheConcurrentU
         // Test that all items are in cache
         for ( int i = 0; i <= items; i++ )
         {
-            String value = (String) jcs.get( i + ":key" );
+            String value = jcs.get( i + ":key" );
 
             assertEquals( region + " data " + i, value );
         }
 
         // Test that getElements returns all the expected values
-        Set keys = new HashSet();
+        Set<String> keys = new HashSet<String>();
         for ( int i = 0; i <= items; i++ )
         {
             keys.add( i + ":key" );
         }
 
-        Map elements = jcs.getCacheElements( keys );
+        Map<String, ICacheElement<String, String>> elements = jcs.getCacheElements( keys );
         for ( int i = 0; i <= items; i++ )
         {
-            ICacheElement<String, String> element = (ICacheElement) elements.get( i + ":key" );
+            ICacheElement<String, String> element = elements.get( i + ":key" );
             assertNotNull( "element " + i + ":key is missing", element );
             assertEquals( "value " + i + ":key", region + " data " + i, element.getVal() );
         }
@@ -196,7 +196,7 @@ public class IndexedDiskCacheConcurrentU
     public void runTestForRegionInRange( String region, int start, int end )
         throws Exception
     {
-        JCS jcs = JCS.getInstance( region );
+        JCS<String, String> jcs = JCS.getInstance( region );
 
         // Add items to cache
         for ( int i = start; i <= end; i++ )
@@ -207,22 +207,22 @@ public class IndexedDiskCacheConcurrentU
         // Test that all items are in cache
         for ( int i = start; i <= end; i++ )
         {
-            String value = (String) jcs.get( i + ":key" );
+            String value = jcs.get( i + ":key" );
 
             assertEquals( region + " data " + i, value );
         }
 
         // Test that getElements returns all the expected values
-        Set keys = new HashSet();
+        Set<String> keys = new HashSet<String>();
         for ( int i = start; i <= end; i++ )
         {
             keys.add( i + ":key" );
         }
 
-        Map elements = jcs.getCacheElements( keys );
+        Map<String, ICacheElement<String, String>> elements = jcs.getCacheElements( keys );
         for ( int i = start; i <= end; i++ )
         {
-            ICacheElement<String, String> element = (ICacheElement) elements.get( i + ":key" );
+            ICacheElement<String, String> element = elements.get( i + ":key" );
             assertNotNull( "element " + i + ":key is missing", element );
             assertEquals( "value " + i + ":key", region + " data " + i, element.getVal() );
         }

Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheKeyStoreUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheKeyStoreUnitTest.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheKeyStoreUnitTest.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheKeyStoreUnitTest.java Mon Mar 12 21:21:03 2012
@@ -50,7 +50,7 @@ public class IndexedDiskCacheKeyStoreUni
         cattr.setCacheName( "testStoreKeys" );
         cattr.setMaxKeySize( 100 );
         cattr.setDiskPath( "target/test-sandbox/KeyStoreUnitTest" );
-        IndexedDiskCache disk = new IndexedDiskCache( cattr );
+        IndexedDiskCache<String, String> disk = new IndexedDiskCache<String, String>( cattr );
 
         disk.processRemoveAll();
 
@@ -59,7 +59,7 @@ public class IndexedDiskCacheKeyStoreUni
         {
             IElementAttributes eAttr = new ElementAttributes();
             eAttr.setIsSpool( true );
-            ICacheElement<String, String> element = new CacheElement( cattr.getCacheName(), "key:" + i, "data:" + i );
+            ICacheElement<String, String> element = new CacheElement<String, String>( cattr.getCacheName(), "key:" + i, "data:" + i );
             element.setElementAttributes( eAttr );
             disk.processUpdate( element );
         }
@@ -67,7 +67,7 @@ public class IndexedDiskCacheKeyStoreUni
         for ( int i = 0; i < cnt; i++ )
         {
             ICacheElement<String, String> element = disk.processGet( "key:" + i );
-            assertNotNull( "presave, Should have recevied an element.", element );
+            assertNotNull( "presave, Should have received an element.", element );
             assertEquals( "presave, element is wrong.", "data:" + i, element.getVal() );
         }
 
@@ -80,7 +80,7 @@ public class IndexedDiskCacheKeyStoreUni
         for ( int i = 0; i < cnt; i++ )
         {
             ICacheElement<String, String> element = disk.processGet( "key:" + i );
-            assertNotNull( "postsave, Should have recevied an element.", element );
+            assertNotNull( "postsave, Should have received an element.", element );
             assertEquals( "postsave, element is wrong.", "data:" + i, element.getVal() );
         }
 
@@ -90,7 +90,7 @@ public class IndexedDiskCacheKeyStoreUni
 
 
     /**
-     * Add some elements, remove 1, call optiiize, verify that the removed isn't present.
+     * Add some elements, remove 1, call optimize, verify that the removed isn't present.
      *
      * We should also compare the data file sizes. . . .
      *
@@ -104,7 +104,7 @@ public class IndexedDiskCacheKeyStoreUni
         cattr.setCacheName( "testOptimize" );
         cattr.setMaxKeySize( 100 );
         cattr.setDiskPath( "target/test-sandbox/KeyStoreUnitTest" );
-        IndexedDiskCache disk = new IndexedDiskCache( cattr );
+        IndexedDiskCache<String, String> disk = new IndexedDiskCache<String, String>( cattr );
 
         disk.processRemoveAll();
 
@@ -113,7 +113,7 @@ public class IndexedDiskCacheKeyStoreUni
         {
             IElementAttributes eAttr = new ElementAttributes();
             eAttr.setIsSpool( true );
-            ICacheElement<String, String> element = new CacheElement( cattr.getCacheName(), "key:" + i, "data:" + i );
+            ICacheElement<String, String> element = new CacheElement<String, String>( cattr.getCacheName(), "key:" + i, "data:" + i );
             element.setElementAttributes( eAttr );
             disk.processUpdate( element );
         }
@@ -122,12 +122,12 @@ public class IndexedDiskCacheKeyStoreUni
 
         IElementAttributes eAttr = new ElementAttributes();
         eAttr.setIsSpool( true );
-        ICacheElement<String, String> elementSetup = new CacheElement( cattr.getCacheName(), "key:" + "A", "data:" + "A" );
+        ICacheElement<String, String> elementSetup = new CacheElement<String, String>( cattr.getCacheName(), "key:" + "A", "data:" + "A" );
         elementSetup.setElementAttributes( eAttr );
         disk.processUpdate( elementSetup );
 
         ICacheElement<String, String> elementRet = disk.processGet( "key:" + "A" );
-        assertNotNull( "postsave, Should have recevied an element.", elementRet );
+        assertNotNull( "postsave, Should have received an element.", elementRet );
         assertEquals( "postsave, element is wrong.", "data:" + "A", elementRet.getVal() );
 
         disk.remove( "key:" + "A" );
@@ -147,7 +147,7 @@ public class IndexedDiskCacheKeyStoreUni
         for ( int i = 0; i < cnt; i++ )
         {
             ICacheElement<String, String> element = disk.processGet( "key:" + i );
-            assertNotNull( "postsave, Should have recevied an element.", element );
+            assertNotNull( "postsave, Should have received an element.", element );
             assertEquals( "postsave, element is wrong.", "data:" + i, element.getVal() );
         }
     }

Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheManagerUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheManagerUnitTest.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheManagerUnitTest.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheManagerUnitTest.java Mon Mar 12 21:21:03 2012
@@ -31,16 +31,16 @@ public class IndexedDiskCacheManagerUnit
         MockElementSerializer elementSerializer = new MockElementSerializer();
 
         String key = "myKey";
-        ICacheElement<String, String> cacheElement = new CacheElement( "test", key, "MyValue" );
+        ICacheElement<String, String> cacheElement = new CacheElement<String, String>( "test", key, "MyValue" );
 
         IndexedDiskCacheManager manager = IndexedDiskCacheManager.getInstance( defaultCacheAttributes,
                                                                                cacheEventLogger, elementSerializer );
 
         // DO WORK
-        IndexedDiskCache cache = (IndexedDiskCache) manager.getCache( cacheName );
+        IndexedDiskCache<String, String> cache = (IndexedDiskCache) manager.getCache( cacheName );
 
-        cache.update( cacheElement );        
-        SleepUtil.sleepAtLeast( 100 );        
+        cache.update( cacheElement );
+        SleepUtil.sleepAtLeast( 100 );
         cache.get( key );
 
         // VERIFY

Modified: commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheConcurrentUnitTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheConcurrentUnitTest.java?rev=1299873&r1=1299872&r2=1299873&view=diff
==============================================================================
--- commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheConcurrentUnitTest.java (original)
+++ commons/proper/jcs/branches/generics-interface/src/test/org/apache/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheConcurrentUnitTest.java Mon Mar 12 21:21:03 2012
@@ -119,7 +119,7 @@ public class HSQLDiskCacheConcurrentUnit
     public void runTestForRegion( String region )
         throws Exception
     {
-        JCS jcs = JCS.getInstance( region );
+        JCS<String, String> jcs = JCS.getInstance( region );
 
         // Add items to cache
 
@@ -134,22 +134,22 @@ public class HSQLDiskCacheConcurrentUnit
 
         for ( int i = 0; i <= items; i++ )
         {
-            String value = (String) jcs.get( i + ":key" );
+            String value = jcs.get( i + ":key" );
 
             assertEquals( "key = [" + i + ":key] value = [" + value + "]", region + " data " + i, value );
         }
 
         // Test that getElements returns all the expected values
-        Set keys = new HashSet();
+        Set<String> keys = new HashSet<String>();
         for ( int i = 0; i <= items; i++ )
         {
             keys.add( i + ":key" );
         }
 
-        Map elements = jcs.getCacheElements( keys );
+        Map<String, ICacheElement<String, String>> elements = jcs.getCacheElements( keys );
         for ( int i = 0; i <= items; i++ )
         {
-            ICacheElement<String, String> element = (ICacheElement) elements.get( i + ":key" );
+            ICacheElement<String, String> element = elements.get( i + ":key" );
             assertNotNull( "element " + i + ":key is missing", element );
             assertEquals( "value " + i + ":key", region + " data " + i, element.getVal() );
         }



Mime
View raw message