commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t.@apache.org
Subject svn commit: r1344374 [5/14] - in /commons/proper/jcs/trunk: ./ auxiliary-builds/javagroups/src/java/org/apache/jcs/auxiliary/javagroups/ auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/javagroups/ auxiliary-builds/jdk14/src/java/org/apache/jcs...
Date Wed, 30 May 2012 18:14:51 GMT
Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPService.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPService.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPService.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPService.java Wed May 30 18:14:43 2012
@@ -42,8 +42,8 @@ import org.apache.jcs.engine.behavior.IC
 /**
  * A lateral cache service implementation. Does not implement getGroupKey
  */
-public class LateralTCPService
-    implements ILateralCacheService, ILateralCacheObserver
+public class LateralTCPService<K extends Serializable, V extends Serializable>
+    implements ILateralCacheService<K, V>, ILateralCacheObserver
 {
     /** The logger. */
     private final static Log log = LogFactory.getLog( LateralTCPService.class );
@@ -93,7 +93,7 @@ public class LateralTCPService
      * @param item
      * @throws IOException
      */
-    public void update( ICacheElement item )
+    public void update( ICacheElement<K, V> item )
         throws IOException
     {
         update( item, getListenerId() );
@@ -107,7 +107,7 @@ public class LateralTCPService
      * @see org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheService#update(org.apache.jcs.engine.behavior.ICacheElement,
      *      long)
      */
-    public void update( ICacheElement item, long requesterId )
+    public void update( ICacheElement<K, V> item, long requesterId )
         throws IOException
     {
         // if we don't allow put, see if we should remove on put
@@ -123,7 +123,7 @@ public class LateralTCPService
         // if we shouldn't remove on put, then put
         if ( !this.getTcpLateralCacheAttributes().isIssueRemoveOnPut() )
         {
-            LateralElementDescriptor led = new LateralElementDescriptor( item );
+            LateralElementDescriptor<K, V> led = new LateralElementDescriptor<K, V>( item );
             led.requesterId = requesterId;
             led.command = LateralElementDescriptor.UPDATE;
             sender.send( led );
@@ -137,8 +137,8 @@ public class LateralTCPService
                 log.debug( "Issuing a remove for a put" );
             }
             // set the value to null so we don't send the item
-            CacheElement ce = new CacheElement( item.getCacheName(), item.getKey(), null );
-            LateralElementDescriptor led = new LateralElementDescriptor( ce );
+            CacheElement<K, V> ce = new CacheElement<K, V>( item.getCacheName(), item.getKey(), null );
+            LateralElementDescriptor<K, V> led = new LateralElementDescriptor<K, V>( ce );
             led.requesterId = requesterId;
             led.command = LateralElementDescriptor.REMOVE;
             led.valHashCode = item.getVal().hashCode();
@@ -152,7 +152,7 @@ public class LateralTCPService
      * @see org.apache.jcs.engine.behavior.ICacheService#remove(java.lang.String,
      *      java.io.Serializable)
      */
-    public void remove( String cacheName, Serializable key )
+    public void remove( String cacheName, K key )
         throws IOException
     {
         remove( cacheName, key, getListenerId() );
@@ -164,11 +164,11 @@ public class LateralTCPService
      * @see org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheService#remove(java.lang.String,
      *      java.io.Serializable, long)
      */
-    public void remove( String cacheName, Serializable key, long requesterId )
+    public void remove( String cacheName, K key, long requesterId )
         throws IOException
     {
-        CacheElement ce = new CacheElement( cacheName, key, null );
-        LateralElementDescriptor led = new LateralElementDescriptor( ce );
+        CacheElement<K, V> ce = new CacheElement<K, V>( cacheName, key, null );
+        LateralElementDescriptor<K, V> led = new LateralElementDescriptor<K, V>( ce );
         led.requesterId = requesterId;
         led.command = LateralElementDescriptor.REMOVE;
         sender.send( led );
@@ -220,10 +220,10 @@ public class LateralTCPService
     /**
      * @param cacheName
      * @param key
-     * @return ICacheElement if found.
+     * @return ICacheElement<K, V> if found.
      * @throws IOException
      */
-    public ICacheElement get( String cacheName, Serializable key )
+    public ICacheElement<K, V> get( String cacheName, K key )
         throws IOException
     {
         return get( cacheName, key, getListenerId() );
@@ -235,23 +235,23 @@ public class LateralTCPService
      * @param cacheName
      * @param key
      * @param requesterId
-     * @return ICacheElement if found.
+     * @return ICacheElement<K, V> if found.
      * @throws IOException
      */
-    public ICacheElement get( String cacheName, Serializable key, long requesterId )
+    public ICacheElement<K, V> get( String cacheName, K key, long requesterId )
         throws IOException
     {
         // if get is not allowed return
         if ( this.getTcpLateralCacheAttributes().isAllowGet() )
         {
-            CacheElement ce = new CacheElement( cacheName, key, null );
-            LateralElementDescriptor led = new LateralElementDescriptor( ce );
+            CacheElement<K, V> ce = new CacheElement<K, V>( cacheName, key, null );
+            LateralElementDescriptor<K, V> led = new LateralElementDescriptor<K, V>( ce );
             // led.requesterId = requesterId; // later
             led.command = LateralElementDescriptor.GET;
             Object response = sender.sendAndReceive( led );
             if ( response != null )
             {
-                return (ICacheElement) response;
+                return (ICacheElement<K, V>) response;
             }
             return null;
         }
@@ -267,11 +267,11 @@ public class LateralTCPService
      * <p>
      * @param cacheName
      * @param pattern
-     * @return a map of Serializable key to ICacheElement element, or an empty map if there is no
+     * @return a map of K key to ICacheElement<K, V> element, or an empty map if there is no
      *         data in cache matching the pattern.
      * @throws IOException
      */
-    public Map<Serializable, ICacheElement> getMatching( String cacheName, String pattern )
+    public Map<K, ICacheElement<K, V>> getMatching( String cacheName, String pattern )
         throws IOException
     {
         return getMatching( cacheName, pattern, getListenerId() );
@@ -283,26 +283,26 @@ public class LateralTCPService
      * @param cacheName
      * @param pattern
      * @param requesterId - our identity
-     * @return a map of Serializable key to ICacheElement element, or an empty map if there is no
+     * @return a map of K key to ICacheElement<K, V> element, or an empty map if there is no
      *         data in cache matching the pattern.
      * @throws IOException
      */
     @SuppressWarnings("unchecked")
-    public Map<Serializable, ICacheElement> getMatching( String cacheName, String pattern, long requesterId )
+    public Map<K, ICacheElement<K, V>> getMatching( String cacheName, String pattern, long requesterId )
         throws IOException
     {
         // if get is not allowed return
         if ( this.getTcpLateralCacheAttributes().isAllowGet() )
         {
-            CacheElement ce = new CacheElement( cacheName, pattern, null );
-            LateralElementDescriptor led = new LateralElementDescriptor( ce );
+            CacheElement<String, String> ce = new CacheElement<String, String>( cacheName, pattern, null );
+            LateralElementDescriptor<String, String> led = new LateralElementDescriptor<String, String>( ce );
             // led.requesterId = requesterId; // later
             led.command = LateralElementDescriptor.GET_MATCHING;
 
             Object response = sender.sendAndReceive( led );
             if ( response != null )
             {
-                return (Map<Serializable, ICacheElement>) response;
+                return (Map<K, ICacheElement<K, V>>) response;
             }
             return Collections.emptyMap();
         }
@@ -318,11 +318,11 @@ public class LateralTCPService
      * <p>
      * @param cacheName
      * @param keys
-     * @return a map of Serializable key to ICacheElement element, or an empty map if there is no
+     * @return a map of K key to ICacheElement<K, V> element, or an empty map if there is no
      *         data in cache for any of these keys
      * @throws IOException
      */
-    public Map<Serializable, ICacheElement> getMultiple( String cacheName, Set<Serializable> keys )
+    public Map<K, ICacheElement<K, V>> getMultiple( String cacheName, Set<K> keys )
         throws IOException
     {
         return getMultiple( cacheName, keys, getListenerId() );
@@ -336,20 +336,20 @@ public class LateralTCPService
      * @param cacheName
      * @param keys
      * @param requesterId
-     * @return a map of Serializable key to ICacheElement element, or an empty map if there is no
+     * @return a map of K key to ICacheElement<K, V> element, or an empty map if there is no
      *         data in cache for any of these keys
      * @throws IOException
      */
-    public Map<Serializable, ICacheElement> getMultiple( String cacheName, Set<Serializable> keys, long requesterId )
+    public Map<K, ICacheElement<K, V>> getMultiple( String cacheName, Set<K> keys, long requesterId )
         throws IOException
     {
-        Map<Serializable, ICacheElement> elements = new HashMap<Serializable, ICacheElement>();
+        Map<K, ICacheElement<K, V>> elements = new HashMap<K, ICacheElement<K, V>>();
 
         if ( keys != null && !keys.isEmpty() )
         {
-            for (Serializable key : keys)
+            for (K key : keys)
             {
-                ICacheElement element = get( cacheName, key );
+                ICacheElement<K, V> element = get( cacheName, key );
 
                 if ( element != null )
                 {
@@ -367,7 +367,7 @@ public class LateralTCPService
      * @param group
      * @return Set
      */
-    public Set<Serializable> getGroupKeys( String cacheName, String group )
+    public Set<K> getGroupKeys( String cacheName, String group )
     {
         throw new UnsupportedOperationException( "Groups not implemented." );
         // return null;
@@ -391,8 +391,8 @@ public class LateralTCPService
     public void removeAll( String cacheName, long requesterId )
         throws IOException
     {
-        CacheElement ce = new CacheElement( cacheName, "ALL", null );
-        LateralElementDescriptor led = new LateralElementDescriptor( ce );
+        CacheElement<String, String> ce = new CacheElement<String, String>( cacheName, "ALL", null );
+        LateralElementDescriptor<String, String> led = new LateralElementDescriptor<String, String>( ce );
         led.requesterId = requesterId;
         led.command = LateralElementDescriptor.REMOVEALL;
         sender.send( led );
@@ -424,8 +424,8 @@ public class LateralTCPService
                     continue;
                 }
 
-                CacheElement ce = new CacheElement( "test", "test", message );
-                LateralElementDescriptor led = new LateralElementDescriptor( ce );
+                CacheElement<String, String> ce = new CacheElement<String, String>( "test", "test", message );
+                LateralElementDescriptor<String, String> led = new LateralElementDescriptor<String, String>( ce );
                 sender.send( led );
             }
         }
@@ -444,7 +444,7 @@ public class LateralTCPService
      * @param obj
      * @throws IOException
      */
-    public void addCacheListener( String cacheName, ICacheListener obj )
+    public <KK extends Serializable, VV extends Serializable> void addCacheListener( String cacheName, ICacheListener<KK, VV> obj )
         throws IOException
     {
         // Empty
@@ -454,7 +454,7 @@ public class LateralTCPService
      * @param obj
      * @throws IOException
      */
-    public void addCacheListener( ICacheListener obj )
+    public <KK extends Serializable, VV extends Serializable> void addCacheListener( ICacheListener<KK, VV> obj )
         throws IOException
     {
         // Empty
@@ -465,7 +465,7 @@ public class LateralTCPService
      * @param obj
      * @throws IOException
      */
-    public void removeCacheListener( String cacheName, ICacheListener obj )
+    public <KK extends Serializable, VV extends Serializable> void removeCacheListener( String cacheName, ICacheListener<KK, VV> obj )
         throws IOException
     {
         // Empty
@@ -475,7 +475,7 @@ public class LateralTCPService
      * @param obj
      * @throws IOException
      */
-    public void removeCacheListener( ICacheListener obj )
+    public <KK extends Serializable, VV extends Serializable> void removeCacheListener( ICacheListener<KK, VV> obj )
         throws IOException
     {
         // Empty

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbsractRemoteCacheListener.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbsractRemoteCacheListener.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbsractRemoteCacheListener.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbsractRemoteCacheListener.java Wed May 30 18:14:43 2012
@@ -39,8 +39,8 @@ import org.apache.jcs.utils.serializatio
 import org.apache.jcs.utils.serialization.StandardSerializer;
 
 /** Shared listener base. */
-public abstract class AbsractRemoteCacheListener
-    implements IRemoteCacheListener, Serializable
+public abstract class AbsractRemoteCacheListener<K extends Serializable, V extends Serializable>
+    implements IRemoteCacheListener<K, V>, Serializable
 {
     /** Don't change */
     private static final long serialVersionUID = 32442324243243L;
@@ -151,7 +151,7 @@ public abstract class AbsractRemoteCache
      * @param cb
      * @throws IOException
      */
-    public void handlePut( ICacheElement cb )
+    public void handlePut( ICacheElement<K, V> cb )
         throws IOException
     {
         if ( irca.getRemoveUponRemotePut() )
@@ -176,7 +176,7 @@ public abstract class AbsractRemoteCache
                 }
             }
 
-            CompositeCache cache = getCacheManager().getCache( cb.getCacheName() );
+            CompositeCache<K, V> cache = getCacheManager().getCache( cb.getCacheName() );
 
             // Eventually the instance of will not be necessary.
             if ( cb instanceof ICacheElementSerialized )
@@ -187,8 +187,8 @@ public abstract class AbsractRemoteCache
                 }
                 try
                 {
-                    cb = SerializationConversionUtil.getDeSerializedCacheElement( (ICacheElementSerialized) cb,
-                                                                                  this.elementSerializer );
+                    cb = SerializationConversionUtil.getDeSerializedCacheElement(
+                            (ICacheElementSerialized<K, V>) cb, this.elementSerializer );
                     if ( log.isDebugEnabled() )
                     {
                         log.debug( "Deserialized result = " + cb );
@@ -215,7 +215,7 @@ public abstract class AbsractRemoteCache
      * @param key
      * @throws IOException
      */
-    public void handleRemove( String cacheName, Serializable key )
+    public void handleRemove( String cacheName, K key )
         throws IOException
     {
         removes++;
@@ -229,7 +229,7 @@ public abstract class AbsractRemoteCache
             log.debug( "handleRemove> cacheName=" + cacheName + ", key=" + key );
         }
 
-        CompositeCache cache = getCacheManager().getCache( cacheName );
+        CompositeCache<K, V> cache = getCacheManager().getCache( cacheName );
 
         cache.localRemove( key );
     }
@@ -248,7 +248,7 @@ public abstract class AbsractRemoteCache
             log.debug( "handleRemoveAll> cacheName=" + cacheName );
         }
 
-        CompositeCache cache = getCacheManager().getCache( cacheName );
+        CompositeCache<K, V> cache = getCacheManager().getCache( cacheName );
         cache.localRemoveAll();
     }
 

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbstractRemoteAuxiliaryCache.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbstractRemoteAuxiliaryCache.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbstractRemoteAuxiliaryCache.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbstractRemoteAuxiliaryCache.java Wed May 30 18:14:43 2012
@@ -53,9 +53,9 @@ import org.apache.jcs.utils.serializatio
 import org.apache.jcs.utils.threadpool.ThreadPoolManager;
 
 /** Abstract base for remote caches. I'm trying to break out and reuse common functionality. */
-public abstract class AbstractRemoteAuxiliaryCache
-    extends AbstractAuxiliaryCacheEventLogging
-    implements IRemoteCacheClient
+public abstract class AbstractRemoteAuxiliaryCache<K extends Serializable, V extends Serializable>
+    extends AbstractAuxiliaryCacheEventLogging<K, V>
+    implements IRemoteCacheClient<K, V>
 {
     /** Don't change. */
     private static final long serialVersionUID = -5329231850422826461L;
@@ -67,13 +67,13 @@ public abstract class AbstractRemoteAuxi
      * This does the work. In an RMI instances, it will be a remote reference. In an http remote
      * cache it will be an http client. In zombie mode it is replaced with a balking facade.
      */
-    private IRemoteCacheService remoteCacheService;
+    private IRemoteCacheService<K, V> remoteCacheService;
 
     /** The cacheName */
     protected final String cacheName;
 
     /** The listener. This can be null. */
-    private IRemoteCacheListener remoteCacheListener;
+    private IRemoteCacheListener<K, V> remoteCacheListener;
 
     /** The configuration values. TODO, we'll need a base here. */
     private IRemoteCacheAttributes remoteCacheAttributes;
@@ -91,8 +91,8 @@ public abstract class AbstractRemoteAuxi
      * @param remote
      * @param listener
      */
-    public AbstractRemoteAuxiliaryCache( IRemoteCacheAttributes cattr, IRemoteCacheService remote,
-                                         IRemoteCacheListener listener )
+    public AbstractRemoteAuxiliaryCache( IRemoteCacheAttributes cattr, IRemoteCacheService<K, V> remote,
+                                         IRemoteCacheListener<K, V> listener )
     {
         this.setRemoteCacheAttributes( cattr );
         this.cacheName = cattr.getCacheName();
@@ -168,10 +168,10 @@ public abstract class AbstractRemoteAuxi
      * @throws IOException
      */
     @Override
-    protected ICacheElement processGet( Serializable key )
+    protected ICacheElement<K, V> processGet( K key )
         throws IOException
     {
-        ICacheElement retVal = null;
+        ICacheElement<K, V> retVal = null;
         try
         {
             if ( usePoolForGet )
@@ -191,7 +191,7 @@ public abstract class AbstractRemoteAuxi
                 // to have no ability to deserialze the objects.
                 if ( this.getRemoteCacheAttributes().getRemoteType() != IRemoteCacheAttributes.CLUSTER )
                 {
-                    retVal = SerializationConversionUtil.getDeSerializedCacheElement( (ICacheElementSerialized) retVal,
+                    retVal = SerializationConversionUtil.getDeSerializedCacheElement( (ICacheElementSerialized<K, V>) retVal,
                                                                                       this.elementSerializer );
                 }
             }
@@ -210,16 +210,16 @@ public abstract class AbstractRemoteAuxi
      * @return ICacheElement
      * @throws IOException
      */
-    public ICacheElement getUsingPool( final Serializable key )
+    public ICacheElement<K, V> getUsingPool( final K key )
         throws IOException
     {
         int timeout = getRemoteCacheAttributes().getGetTimeoutMillis();
 
         try
         {
-            Callable<ICacheElement> command = new Callable<ICacheElement>()
+            Callable<ICacheElement<K, V>> command = new Callable<ICacheElement<K, V>>()
             {
-                public ICacheElement call()
+                public ICacheElement<K, V> call()
                     throws IOException
                 {
                     return getRemoteCacheService().get( cacheName, key, getListenerId() );
@@ -227,10 +227,10 @@ public abstract class AbstractRemoteAuxi
             };
 
             // execute using the pool
-            Future<ICacheElement> future = pool.submit(command);
+            Future<ICacheElement<K, V>> future = pool.submit(command);
 
             // used timed get in order to timeout
-            ICacheElement ice = future.get(timeout, TimeUnit.MILLISECONDS);
+            ICacheElement<K, V> ice = future.get(timeout, TimeUnit.MILLISECONDS);
 
             if ( log.isDebugEnabled() )
             {
@@ -271,20 +271,20 @@ public abstract class AbstractRemoteAuxi
      * @throws IOException
      */
     @Override
-    public Map<Serializable, ICacheElement> processGetMatching( String pattern )
+    public Map<K, ICacheElement<K, V>> processGetMatching( String pattern )
         throws IOException
     {
-        Map<Serializable, ICacheElement> results = new HashMap<Serializable, ICacheElement>();
+        Map<K, ICacheElement<K, V>> results = new HashMap<K, ICacheElement<K, V>>();
         try
         {
-            Map<Serializable, ICacheElement> rawResults = getRemoteCacheService().getMatching( cacheName, pattern, getListenerId() );
+            Map<K, ICacheElement<K, V>> rawResults = getRemoteCacheService().getMatching( cacheName, pattern, getListenerId() );
 
             // Eventually the instance of will not be necessary.
             if ( rawResults != null )
             {
-                for (Map.Entry<Serializable, ICacheElement> entry : rawResults.entrySet())
+                for (Map.Entry<K, ICacheElement<K, V>> entry : rawResults.entrySet())
                 {
-                    ICacheElement unwrappedResult = null;
+                    ICacheElement<K, V> unwrappedResult = null;
                     if ( entry.getValue() instanceof ICacheElementSerialized )
                     {
                         // Never try to deserialize if you are a cluster client. Cluster
@@ -293,7 +293,7 @@ public abstract class AbstractRemoteAuxi
                         if ( this.getRemoteCacheAttributes().getRemoteType() != IRemoteCacheAttributes.CLUSTER )
                         {
                             unwrappedResult = SerializationConversionUtil
-                                .getDeSerializedCacheElement( (ICacheElementSerialized) entry.getValue(),
+                                .getDeSerializedCacheElement( (ICacheElementSerialized<K, V>) entry.getValue(),
                                                               this.elementSerializer );
                         }
                     }
@@ -317,20 +317,20 @@ public abstract class AbstractRemoteAuxi
      * Gets multiple items from the cache based on the given set of keys.
      * <p>
      * @param keys
-     * @return a map of Serializable key to ICacheElement element, or an empty map if there is no
+     * @return a map of K key to ICacheElement<K, V> element, or an empty map if there is no
      *         data in cache for any of these keys
      * @throws IOException
      */
     @Override
-    protected Map<Serializable, ICacheElement> processGetMultiple( Set<Serializable> keys )
+    protected Map<K, ICacheElement<K, V>> processGetMultiple( Set<K> keys )
         throws IOException
     {
-        Map<Serializable, ICacheElement> elements = new HashMap<Serializable, ICacheElement>();
+        Map<K, ICacheElement<K, V>> elements = new HashMap<K, ICacheElement<K, V>>();
         if ( keys != null && !keys.isEmpty() )
         {
-            for (Serializable key : keys)
+            for (K key : keys)
             {
-                ICacheElement element = get( key );
+                ICacheElement<K, V> element = get( key );
 
                 if ( element != null )
                 {
@@ -350,7 +350,7 @@ public abstract class AbstractRemoteAuxi
      * @throws IOException
      */
     @Override
-    protected boolean processRemove( Serializable key )
+    protected boolean processRemove( K key )
         throws IOException
     {
         if ( !this.getRemoteCacheAttributes().getGetOnly() )
@@ -404,12 +404,12 @@ public abstract class AbstractRemoteAuxi
      * @throws IOException
      */
     @Override
-    protected void processUpdate( ICacheElement ce )
+    protected void processUpdate( ICacheElement<K, V> ce )
         throws IOException
     {
         if ( !getRemoteCacheAttributes().getGetOnly() )
         {
-            ICacheElementSerialized serialized = null;
+            ICacheElementSerialized<K, V> serialized = null;
             try
             {
                 if ( log.isDebugEnabled() )
@@ -451,7 +451,7 @@ public abstract class AbstractRemoteAuxi
      * @throws java.rmi.RemoteException
      * @throws IOException
      */
-    public Set<Serializable> getGroupKeys( String groupName )
+    public Set<K> getGroupKeys( String groupName )
         throws java.rmi.RemoteException, IOException
     {
         return getRemoteCacheService().getGroupKeys( cacheName, groupName );
@@ -463,7 +463,7 @@ public abstract class AbstractRemoteAuxi
      * <p>
      * @return IRemoteCacheListener, the listener for this remote server
      */
-    public IRemoteCacheListener getListener()
+    public IRemoteCacheListener<K, V> getListener()
     {
         return getRemoteCacheListener();
     }
@@ -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 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 );
         }
     }
 
@@ -675,7 +676,7 @@ public abstract class AbstractRemoteAuxi
     /**
      * @param remote the remote to set
      */
-    protected void setRemoteCacheService( IRemoteCacheService remote )
+    protected void setRemoteCacheService( IRemoteCacheService<K, V> remote )
     {
         this.remoteCacheService = remote;
     }
@@ -683,7 +684,7 @@ public abstract class AbstractRemoteAuxi
     /**
      * @return the remote
      */
-    protected IRemoteCacheService getRemoteCacheService()
+    protected IRemoteCacheService<K, V> getRemoteCacheService()
     {
         return remoteCacheService;
     }
@@ -715,7 +716,7 @@ public abstract class AbstractRemoteAuxi
     /**
      * @param remoteCacheListener the remoteCacheListener to set
      */
-    protected void setRemoteCacheListener( IRemoteCacheListener remoteCacheListener )
+    protected void setRemoteCacheListener( IRemoteCacheListener<K, V> remoteCacheListener )
     {
         this.remoteCacheListener = remoteCacheListener;
     }
@@ -723,7 +724,7 @@ public abstract class AbstractRemoteAuxi
     /**
      * @return the remoteCacheListener
      */
-    protected IRemoteCacheListener getRemoteCacheListener()
+    protected IRemoteCacheListener<K, V> getRemoteCacheListener()
     {
         return remoteCacheListener;
     }

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbstractRemoteCacheNoWaitFacade.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbstractRemoteCacheNoWaitFacade.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbstractRemoteCacheNoWaitFacade.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbstractRemoteCacheNoWaitFacade.java Wed May 30 18:14:43 2012
@@ -46,9 +46,9 @@ import org.apache.jcs.engine.stats.Stats
 import org.apache.jcs.engine.stats.behavior.IStatElement;
 import org.apache.jcs.engine.stats.behavior.IStats;
 
-/** An abstract base for the No Wait Facade.  Different implmentations will failover differently. */
-public abstract class AbstractRemoteCacheNoWaitFacade
-    extends AbstractAuxiliaryCache
+/** An abstract base for the No Wait Facade.  Different implementations will failover differently. */
+public abstract class AbstractRemoteCacheNoWaitFacade<K extends Serializable, V extends Serializable>
+    extends AbstractAuxiliaryCache<K, V>
 {
     /** For serialization. Don't change. */
     private static final long serialVersionUID = -4529970797620747110L;
@@ -57,7 +57,7 @@ public abstract class AbstractRemoteCach
     private final static Log log = LogFactory.getLog( AbstractRemoteCacheNoWaitFacade.class );
 
     /** The connection to a remote server, or a zombie. */
-    public RemoteCacheNoWait[] noWaits;
+    public RemoteCacheNoWait<K, V>[] noWaits;
 
     /** The cache name */
     private final String cacheName;
@@ -77,7 +77,7 @@ public abstract class AbstractRemoteCach
      * @param cacheEventLogger
      * @param elementSerializer
      */
-    public AbstractRemoteCacheNoWaitFacade( RemoteCacheNoWait[] noWaits, RemoteCacheAttributes rca,
+    public AbstractRemoteCacheNoWaitFacade( RemoteCacheNoWait<K, V>[] noWaits, RemoteCacheAttributes rca,
                                     ICompositeCacheManager cacheMgr, ICacheEventLogger cacheEventLogger,
                                     IElementSerializer elementSerializer )
     {
@@ -99,7 +99,7 @@ public abstract class AbstractRemoteCach
      * @param ce
      * @throws IOException
      */
-    public void update( ICacheElement ce )
+    public void update( ICacheElement<K, V> ce )
         throws IOException
     {
         if ( log.isDebugEnabled() )
@@ -148,21 +148,21 @@ public abstract class AbstractRemoteCach
      * Synchronously reads from the remote cache.
      * <p>
      * @param key
-     * @return Either an ICacheElement or null if it is not found.
+     * @return Either an ICacheElement<K, V> or null if it is not found.
      */
-    public ICacheElement get( Serializable key )
+    public ICacheElement<K, V> get( K key )
     {
         for ( int i = 0; i < noWaits.length; i++ )
         {
             try
             {
-                Object obj = noWaits[i].get( key );
+                ICacheElement<K, V> obj = noWaits[i].get( key );
                 if ( obj != null )
                 {
-                    return (ICacheElement) obj;
+                    return obj;
                 }
             }
-            catch ( Exception ex )
+            catch ( IOException ex )
             {
                 log.debug( "Failed to get." );
                 return null;
@@ -178,7 +178,7 @@ public abstract class AbstractRemoteCach
      * @return map
      * @throws IOException
      */
-    public Map<Serializable, ICacheElement> getMatching( String pattern )
+    public Map<K, ICacheElement<K, V>> getMatching( String pattern )
         throws IOException
     {
         for ( int i = 0; i < noWaits.length; i++ )
@@ -199,10 +199,10 @@ public abstract class AbstractRemoteCach
      * Gets multiple items from the cache based on the given set of keys.
      * <p>
      * @param keys
-     * @return a map of Serializable key to ICacheElement element, or an empty map if there is no
+     * @return a map of K key to ICacheElement<K, V> element, or an empty map if there is no
      *         data in cache for any of these keys
      */
-    public Map<Serializable, ICacheElement> getMultiple( Set<Serializable> keys )
+    public Map<K, ICacheElement<K, V>> getMultiple( Set<K> keys )
     {
         if ( keys != null && !keys.isEmpty() )
         {
@@ -218,6 +218,7 @@ public abstract class AbstractRemoteCach
                 }
             }
         }
+
         return Collections.emptyMap();
     }
 
@@ -228,13 +229,13 @@ public abstract class AbstractRemoteCach
      * @return the set of keys of objects currently in the group
      * @throws IOException
      */
-    public Set<Serializable> getGroupKeys( String group )
+    public Set<K> getGroupKeys( String group )
         throws IOException
     {
-        HashSet<Serializable> allKeys = new HashSet<Serializable>();
+        HashSet<K> allKeys = new HashSet<K>();
         for ( int i = 0; i < noWaits.length; i++ )
         {
-            AuxiliaryCache aux = noWaits[i];
+            AuxiliaryCache<K, V> aux = noWaits[i];
             if ( aux != null )
             {
                 allKeys.addAll( aux.getGroupKeys( group ) );
@@ -249,7 +250,7 @@ public abstract class AbstractRemoteCach
      * @param key
      * @return whether or not it was removed, right now it return false.
      */
-    public boolean remove( Serializable key )
+    public boolean remove( K key )
     {
         try
         {

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCache.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCache.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCache.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCache.java Wed May 30 18:14:43 2012
@@ -20,6 +20,7 @@ package org.apache.jcs.auxiliary.remote;
  */
 
 import java.io.IOException;
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -40,8 +41,8 @@ import org.apache.jcs.engine.stats.behav
  * This handles gets, updates, and removes. It also initiates failover recovery when an error is
  * encountered.
  */
-public class RemoteCache
-    extends AbstractRemoteAuxiliaryCache
+public class RemoteCache<K extends Serializable, V extends Serializable>
+    extends AbstractRemoteAuxiliaryCache<K, V>
 {
     /** Don't change. */
     private static final long serialVersionUID = -5329231850422826460L;
@@ -59,7 +60,7 @@ public class RemoteCache
      * @param remote
      * @param listener
      */
-    public RemoteCache( IRemoteCacheAttributes cattr, IRemoteCacheService remote, IRemoteCacheListener listener )
+    public RemoteCache( IRemoteCacheAttributes cattr, IRemoteCacheService<K, V> remote, IRemoteCacheListener<K, V> listener )
     {
         super( cattr, remote, listener );
 
@@ -130,7 +131,7 @@ public class RemoteCache
         if ( getRemoteCacheService() == null || !( getRemoteCacheService() instanceof ZombieRemoteCacheService ) )
         {
             // TODO make configurable
-            setRemoteCacheService( new ZombieRemoteCacheService( getRemoteCacheAttributes().getZombieQueueMaxSize() ) );
+            setRemoteCacheService( new ZombieRemoteCacheService<K, V>( getRemoteCacheAttributes().getZombieQueueMaxSize() ) );
         }
         // may want to flush if region specifies
         // Notify the cache monitor about the error, and kick off the recovery
@@ -138,7 +139,7 @@ public class RemoteCache
         RemoteCacheMonitor.getInstance().notifyError();
 
         // initiate failover if local
-        RemoteCacheNoWaitFacade rcnwf = (RemoteCacheNoWaitFacade) RemoteCacheFactory.getFacades()
+        RemoteCacheNoWaitFacade<K, V> rcnwf = (RemoteCacheNoWaitFacade<K, V>)RemoteCacheFactory.getFacades()
             .get( getRemoteCacheAttributes().getCacheName() );
 
         if ( log.isDebugEnabled() )

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheFactory.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheFactory.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheFactory.java Wed May 30 18:14:43 2012
@@ -19,6 +19,7 @@ package org.apache.jcs.auxiliary.remote;
  * under the License.
  */
 
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.StringTokenizer;
@@ -49,8 +50,8 @@ public class RemoteCacheFactory
     private String name;
 
     /** store reference of facades to initiate failover */
-    private final static HashMap<String, RemoteCacheNoWaitFacade> facades =
-        new HashMap<String, RemoteCacheNoWaitFacade>();
+    private final static HashMap<String, RemoteCacheNoWaitFacade<? extends Serializable, ? extends Serializable>> facades =
+        new HashMap<String, RemoteCacheNoWaitFacade<? extends Serializable, ? extends Serializable>>();
 
     /**
      * For LOCAL clients we get a handle to all the failovers, but we do not register a listener
@@ -65,12 +66,13 @@ public class RemoteCacheFactory
      * @param elementSerializer
      * @return AuxiliaryCache
      */
-    public AuxiliaryCache createCache( AuxiliaryCacheAttributes iaca, ICompositeCacheManager cacheMgr,
-                                       ICacheEventLogger cacheEventLogger, IElementSerializer elementSerializer )
+    public <K extends Serializable, V extends Serializable> AuxiliaryCache<K, V> createCache(
+            AuxiliaryCacheAttributes iaca, ICompositeCacheManager cacheMgr,
+           ICacheEventLogger cacheEventLogger, IElementSerializer elementSerializer )
     {
         RemoteCacheAttributes rca = (RemoteCacheAttributes) iaca;
 
-        ArrayList<ICache> noWaits = new ArrayList<ICache>();
+        ArrayList<ICache<K, V>> noWaits = new ArrayList<ICache<K, V>>();
 
         // if LOCAL
         if ( rca.getRemoteType() == RemoteCacheAttributes.LOCAL )
@@ -90,7 +92,7 @@ public class RemoteCacheFactory
 
                 RemoteCacheManager rcm = RemoteCacheManager.getInstance( rca, cacheMgr, cacheEventLogger,
                                                                          elementSerializer );
-                ICache ic = rcm.getCache( rca );
+                ICache<K, V> ic = rcm.getCache( rca );
                 if ( ic != null )
                 {
                     noWaits.add( ic );
@@ -122,7 +124,7 @@ public class RemoteCacheFactory
                     // number it is at
                     if ( ( !primayDefined && fCnt == 1 ) || noWaits.size() <= 0 )
                     {
-                        ICache ic = rcm.getCache( rca );
+                        ICache<K, V> ic = rcm.getCache( rca );
                         if ( ic != null )
                         {
                             noWaits.add( ic );
@@ -155,7 +157,7 @@ public class RemoteCacheFactory
                 RemoteCacheManager rcm = RemoteCacheManager.getInstance( rca, cacheMgr, cacheEventLogger,
                                                                          elementSerializer );
                 rca.setRemoteType( RemoteCacheAttributes.CLUSTER );
-                ICache ic = rcm.getCache( rca );
+                ICache<K, V> ic = rcm.getCache( rca );
                 if ( ic != null )
                 {
                     noWaits.add( ic );
@@ -169,7 +171,7 @@ public class RemoteCacheFactory
         }
         // end if CLUSTER
 
-        RemoteCacheNoWaitFacade rcnwf = new RemoteCacheNoWaitFacade( noWaits
+        RemoteCacheNoWaitFacade<K, V> rcnwf = new RemoteCacheNoWaitFacade<K, V>( noWaits
             .toArray( new RemoteCacheNoWait[0] ), rca, cacheMgr, cacheEventLogger, elementSerializer );
 
         getFacades().put( rca.getCacheName(), rcnwf );
@@ -201,7 +203,7 @@ public class RemoteCacheFactory
      * The facades are what the cache hub talks to.
      * @return Returns the facades.
      */
-    public static HashMap<String, RemoteCacheNoWaitFacade> getFacades()
+    public static HashMap<String, RemoteCacheNoWaitFacade<? extends Serializable, ? extends Serializable>> getFacades()
     {
         return facades;
     }

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheFailoverRunner.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheFailoverRunner.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheFailoverRunner.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheFailoverRunner.java Wed May 30 18:14:43 2012
@@ -20,6 +20,7 @@ package org.apache.jcs.auxiliary.remote;
  */
 
 import java.io.IOException;
+import java.io.Serializable;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -48,14 +49,14 @@ import org.apache.jcs.engine.logging.beh
  * will try to connect to a failover until the primary is restored.
  *
  */
-public class RemoteCacheFailoverRunner
+public class RemoteCacheFailoverRunner<K extends Serializable, V extends Serializable>
     implements Runnable
 {
     /** The logger */
     private final static Log log = LogFactory.getLog( RemoteCacheFailoverRunner.class );
 
     /** The facade returned to the composite cache. */
-    private final RemoteCacheNoWaitFacade facade;
+    private final RemoteCacheNoWaitFacade<K, V> facade;
 
     /** How long to wait between reconnect attempts. */
     private static long idlePeriod = 20 * 1000;
@@ -82,7 +83,7 @@ public class RemoteCacheFailoverRunner
      * @param cacheEventLogger
      * @param elementSerializer
      */
-    public RemoteCacheFailoverRunner( RemoteCacheNoWaitFacade facade, ICompositeCacheManager cacheMgr,
+    public RemoteCacheFailoverRunner( RemoteCacheNoWaitFacade<K, V> facade, ICompositeCacheManager cacheMgr,
                                       ICacheEventLogger cacheEventLogger, IElementSerializer elementSerializer )
     {
         this.facade = facade;
@@ -211,7 +212,7 @@ public class RemoteCacheFailoverRunner
 
                         // add a listener if there are none, need to tell rca
                         // what number it is at
-                        ICache ic = rcm.getCache( rca.getCacheName() );
+                        ICache<K, V> ic = rcm.getCache( rca.getCacheName() );
                         if ( ic != null )
                         {
                             if ( ic.getStatus() == CacheConstants.STATUS_ALIVE )
@@ -219,7 +220,7 @@ public class RemoteCacheFailoverRunner
                                 // may need to do this more gracefully
                                 log.debug( "reseting no wait" );
                                 facade.noWaits = new RemoteCacheNoWait[1];
-                                facade.noWaits[0] = (RemoteCacheNoWait) ic;
+                                facade.noWaits[0] = (RemoteCacheNoWait<K, V>) ic;
                                 facade.remoteCacheAttributes.setFailoverIndex( i );
 
                                 synchronized ( this )
@@ -333,7 +334,7 @@ public class RemoteCacheFailoverRunner
      * The primary server is the first server defines in the FailoverServers
      * list.
      *
-     * @return boolean value indicating whether the resoration was successful
+     * @return boolean value indicating whether the restoration was successful
      */
     private boolean restorePrimary()
     {
@@ -355,7 +356,7 @@ public class RemoteCacheFailoverRunner
 
             // add a listener if there are none, need to tell rca what number it
             // is at
-            ICache ic = rcm.getCache( rca.getCacheName() );
+            ICache<K, V> ic = rcm.getCache( rca.getCacheName() );
             // by default the listener id should be 0, else it will be the
             // listener
             // Originally associated with the remote cache. either way is fine.
@@ -437,11 +438,11 @@ public class RemoteCacheFailoverRunner
 
                     // Restore primary
                     // may need to do this more gracefully, letting the failover finish in the background
-                    RemoteCacheNoWait failoverNoWait = facade.noWaits[0];
+                    RemoteCacheNoWait<K, V> failoverNoWait = facade.noWaits[0];
 
                     // swap in a new one
                     facade.noWaits = new RemoteCacheNoWait[1];
-                    facade.noWaits[0] = (RemoteCacheNoWait) ic;
+                    facade.noWaits[0] = (RemoteCacheNoWait<K, V>) ic;
                     facade.remoteCacheAttributes.setFailoverIndex( 0 );
 
                     if ( log.isInfoEnabled() )

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheListener.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheListener.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheListener.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheListener.java Wed May 30 18:14:43 2012
@@ -38,9 +38,9 @@ import org.apache.jcs.engine.behavior.IC
  * One listener is used per remote cache server. The same listener is used for all the regions that
  * talk to a particular server.
  */
-public class RemoteCacheListener
-    extends AbsractRemoteCacheListener
-    implements IRemoteCacheConstants, Serializable, IRemoteCacheListener
+public class RemoteCacheListener<K extends Serializable, V extends Serializable>
+    extends AbsractRemoteCacheListener<K, V>
+    implements IRemoteCacheConstants, Serializable, IRemoteCacheListener<K, V>
 {
     /** Don't change */
     private static final long serialVersionUID = 25345252345322345L;

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheManager.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheManager.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheManager.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheManager.java Wed May 30 18:14:43 2012
@@ -20,6 +20,7 @@ package org.apache.jcs.auxiliary.remote;
  */
 
 import java.io.IOException;
+import java.io.Serializable;
 import java.rmi.Naming;
 import java.rmi.registry.Registry;
 import java.util.HashMap;
@@ -68,7 +69,8 @@ public class RemoteCacheManager
     private int clients;
 
     /** Contains instances of RemoteCacheNoWait managed by a RemoteCacheManager instance. */
-    final Map<String, RemoteCacheNoWait> caches = new HashMap<String, RemoteCacheNoWait>();
+    final Map<String, RemoteCacheNoWait<? extends Serializable, ? extends Serializable>> caches =
+        new HashMap<String, RemoteCacheNoWait<? extends Serializable, ? extends Serializable>>();
 
     /** The remote host */
     final String host;
@@ -89,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
@@ -146,7 +148,7 @@ public class RemoteCacheManager
             }
 
             // Successful connection to the remote server.
-            remoteService = (IRemoteCacheService) obj;
+            remoteService = (IRemoteCacheService<?, ?>) obj;
             if ( log.isDebugEnabled() )
             {
                 log.debug( "remoteService = " + remoteService );
@@ -161,7 +163,7 @@ public class RemoteCacheManager
             // Configure this RemoteCacheManager instance to use the "zombie"
             // services.
             log.error( "Problem finding server at [" + registry + "]", ex );
-            remoteService = new ZombieRemoteCacheService();
+            remoteService = new ZombieRemoteCacheService<String, String>();
             remoteWatch = new RemoteCacheWatchRepairable();
             remoteWatch.setCacheWatch( new ZombieRemoteCacheWatch() );
 
@@ -188,7 +190,7 @@ public class RemoteCacheManager
      * @param listener The feature to be added to the RemoteCacheListener attribute
      * @throws IOException
      */
-    public void addRemoteCacheListener( IRemoteCacheAttributes cattr, IRemoteCacheListener listener )
+    public <K extends Serializable, V extends Serializable> void addRemoteCacheListener( IRemoteCacheAttributes cattr, IRemoteCacheListener<K, V> listener )
         throws IOException
     {
         if ( cattr.isReceive() )
@@ -225,7 +227,7 @@ public class RemoteCacheManager
      * @param listener
      * @throws IOException
      */
-    public void removeRemoteCacheListener( IRemoteCacheAttributes cattr, IRemoteCacheListener listener )
+    public <K extends Serializable, V extends Serializable> void removeRemoteCacheListener( IRemoteCacheAttributes cattr, IRemoteCacheListener<K, V> listener )
         throws IOException
     {
         synchronized ( caches )
@@ -245,16 +247,16 @@ public class RemoteCacheManager
     {
         synchronized ( caches )
         {
-            RemoteCacheNoWait cache = caches.get( cattr.getCacheName() );
+            RemoteCacheNoWait<?, ?> cache = caches.get( cattr.getCacheName() );
             if ( cache != null )
             {
-                IRemoteCacheClient rc = cache.getRemoteCache();
+                IRemoteCacheClient<?, ?> rc = cache.getRemoteCache();
                 if ( log.isDebugEnabled() )
                 {
                     log.debug( "Found cache for[ " + cattr.getCacheName() + "], deregistering listener." );
                 }
                 // could also store the listener for a server in the manager.
-                IRemoteCacheListener listener = rc.getListener();
+                IRemoteCacheListener<?, ?> listener = rc.getListener();
                 remoteWatch.removeCacheListener( cattr.getCacheName(), listener );
             }
             else
@@ -286,16 +288,16 @@ public class RemoteCacheManager
     {
         synchronized ( caches )
         {
-            RemoteCacheNoWait cache = caches.get( cacheName );
+            RemoteCacheNoWait<?, ?> cache = caches.get( cacheName );
             if ( cache != null )
             {
-                IRemoteCacheClient rc = cache.getRemoteCache();
+                IRemoteCacheClient<?, ?> rc = cache.getRemoteCache();
                 if ( log.isDebugEnabled() )
                 {
                     log.debug( "Found cache for [" + cacheName + "], deregistering listener." );
                 }
                 // could also store the listener for a server in the manager.
-                IRemoteCacheListener listener = rc.getListener();
+                IRemoteCacheListener<?, ?> listener = rc.getListener();
                 remoteWatch.removeCacheListener( cacheName, listener );
             }
         }
@@ -370,7 +372,7 @@ public class RemoteCacheManager
      * @param cacheName
      * @return The cache value
      */
-    public AuxiliaryCache getCache( String cacheName )
+    public <K extends Serializable, V extends Serializable> AuxiliaryCache<K, V> getCache( String cacheName )
     {
         IRemoteCacheAttributes ca = (IRemoteCacheAttributes) remoteCacheAttributes.copy();
         ca.setCacheName( cacheName );
@@ -387,21 +389,21 @@ public class RemoteCacheManager
      * @param cattr
      * @return The cache value
      */
-    public AuxiliaryCache getCache( IRemoteCacheAttributes cattr )
+    public <K extends Serializable, V extends Serializable> AuxiliaryCache<K, V> getCache( IRemoteCacheAttributes cattr )
     {
-        RemoteCacheNoWait remoteCacheNoWait = null;
+        RemoteCacheNoWait<K, V> remoteCacheNoWait = null;
 
         synchronized ( caches )
         {
-            remoteCacheNoWait = caches.get( cattr.getCacheName() );
+            remoteCacheNoWait = (RemoteCacheNoWait<K, V>) caches.get( cattr.getCacheName() );
             if ( remoteCacheNoWait == null )
             {
                 // create a listener first and pass it to the remotecache
                 // sender.
-                RemoteCacheListener listener = null;
+                RemoteCacheListener<K, V> listener = null;
                 try
                 {
-                    listener = new RemoteCacheListener( cattr, cacheMgr );
+                    listener = new RemoteCacheListener<K, V>( cattr, cacheMgr );
                     addRemoteCacheListener( cattr, listener );
                 }
                 catch ( IOException ioe )
@@ -415,11 +417,11 @@ public class RemoteCacheManager
                         + listener, e );
                 }
 
-                IRemoteCacheClient remoteCacheClient = new RemoteCache( cattr, remoteService, listener );
+                IRemoteCacheClient<K, V> remoteCacheClient = new RemoteCache<K, V>( cattr, (IRemoteCacheService<K, V>) remoteService, listener );
                 remoteCacheClient.setCacheEventLogger( cacheEventLogger );
                 remoteCacheClient.setElementSerializer( elementSerializer );
 
-                remoteCacheNoWait = new RemoteCacheNoWait( remoteCacheClient );
+                remoteCacheNoWait = new RemoteCacheNoWait<K, V>( remoteCacheClient );
                 remoteCacheNoWait.setCacheEventLogger( cacheEventLogger );
                 remoteCacheNoWait.setElementSerializer( elementSerializer );
 
@@ -445,7 +447,7 @@ public class RemoteCacheManager
         {
             log.info( "freeCache [" + name + "]" );
         }
-        ICache c = null;
+        ICache<?, ?> c = null;
         synchronized ( caches )
         {
             c = caches.get( name );
@@ -465,7 +467,7 @@ public class RemoteCacheManager
     public String getStats()
     {
         StringBuffer stats = new StringBuffer();
-        for (RemoteCacheNoWait c : caches.values())
+        for (RemoteCacheNoWait<?, ?> c : caches.values())
         {
             if ( c != null )
             {
@@ -485,7 +487,7 @@ public class RemoteCacheManager
         }
         synchronized ( caches )
         {
-            for (RemoteCacheNoWait c : caches.values())
+            for (RemoteCacheNoWait<?, ?> c : caches.values())
             {
                 if ( c != null )
                 {
@@ -509,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() )
         {
@@ -519,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/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheNoWait.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheNoWait.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheNoWait.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheNoWait.java Wed May 30 18:14:43 2012
@@ -67,8 +67,8 @@ import org.apache.jcs.engine.stats.behav
  * again. This is a better long term solution, but it requires some significant changes to the
  * complicated worker queues.
  */
-public class RemoteCacheNoWait
-    extends AbstractAuxiliaryCache
+public class RemoteCacheNoWait<K extends Serializable, V extends Serializable>
+    extends AbstractAuxiliaryCache<K, V>
 {
     /** For serialization. Don't change. */
     private static final long serialVersionUID = -3104089136003714717L;
@@ -77,10 +77,10 @@ public class RemoteCacheNoWait
     private final static Log log = LogFactory.getLog( RemoteCacheNoWait.class );
 
     /** The remote cache client */
-    private final IRemoteCacheClient remoteCacheClient;
+    private final IRemoteCacheClient<K, V> remoteCacheClient;
 
-    /** Event queue for queueing up calls like put and remove. */
-    private ICacheEventQueue cacheEventQueue;
+    /** Event queue for queuing up calls like put and remove. */
+    private ICacheEventQueue<K, V> cacheEventQueue;
 
     /** how many times get has been called. */
     private int getCount = 0;
@@ -103,12 +103,12 @@ public class RemoteCacheNoWait
      * <p>
      * @param cache
      */
-    public RemoteCacheNoWait( IRemoteCacheClient cache )
+    public RemoteCacheNoWait( IRemoteCacheClient<K, V> cache )
     {
         remoteCacheClient = cache;
 
-        CacheEventQueueFactory factory = new CacheEventQueueFactory();
-        this.cacheEventQueue = factory.createCacheEventQueue( new CacheAdaptor( remoteCacheClient ), remoteCacheClient
+        CacheEventQueueFactory<K, V> factory = new CacheEventQueueFactory<K, V>();
+        this.cacheEventQueue = factory.createCacheEventQueue( new CacheAdaptor<K, V>( remoteCacheClient ), remoteCacheClient
             .getListenerId(), remoteCacheClient.getCacheName(), remoteCacheClient.getAuxiliaryCacheAttributes()
             .getEventQueuePoolName(), remoteCacheClient.getAuxiliaryCacheAttributes().getEventQueueType() );
 
@@ -124,7 +124,7 @@ public class RemoteCacheNoWait
      * @param element
      * @throws IOException
      */
-    public void update( ICacheElement element )
+    public void update( ICacheElement<K, V> element )
         throws IOException
     {
         putCount++;
@@ -147,7 +147,7 @@ public class RemoteCacheNoWait
      * @return element from the remote cache, or null if not present
      * @throws IOException
      */
-    public ICacheElement get( Serializable key )
+    public ICacheElement<K, V> get( K key )
         throws IOException
     {
         getCount++;
@@ -191,7 +191,7 @@ public class RemoteCacheNoWait
      * @throws IOException
      *
      */
-    public Map<Serializable, ICacheElement> getMatching( String pattern )
+    public Map<K, ICacheElement<K, V>> getMatching( String pattern )
         throws IOException
     {
         getMatchingCount++;
@@ -234,11 +234,11 @@ public class RemoteCacheNoWait
      * request on to the server rather than looping through the requested keys.
      * <p>
      * @param keys
-     * @return a map of Serializable key to ICacheElement element, or an empty map if there is no
+     * @return a map of K key to ICacheElement<K, V> element, or an empty map if there is no
      *         data in cache for any of these keys
      * @throws IOException
      */
-    public Map<Serializable, ICacheElement> getMultiple( Set<Serializable> keys )
+    public Map<K, ICacheElement<K, V>> getMultiple( Set<K> keys )
         throws IOException
     {
         getMultipleCount++;
@@ -273,7 +273,7 @@ public class RemoteCacheNoWait
             throw ex;
         }
 
-        return new HashMap<Serializable, ICacheElement>();
+        return new HashMap<K, ICacheElement<K, V>>();
     }
 
     /**
@@ -281,7 +281,7 @@ public class RemoteCacheNoWait
      * @return the keys for the group name
      * @throws IOException
      */
-    public Set<Serializable> getGroupKeys( String groupName )
+    public Set<K> getGroupKeys( String groupName )
         throws IOException
     {
         return remoteCacheClient.getGroupKeys( groupName );
@@ -294,7 +294,7 @@ public class RemoteCacheNoWait
      * @return if this was successful
      * @throws IOException
      */
-    public boolean remove( Serializable key )
+    public boolean remove( K key )
         throws IOException
     {
         removeCount++;
@@ -392,7 +392,7 @@ public class RemoteCacheNoWait
      * <p>
      * @param remote
      */
-    public void fixCache( IRemoteCacheService remote )
+    public void fixCache( IRemoteCacheService<?, ?> remote )
     {
         remoteCacheClient.fixCache( remote );
         resetEventQ();
@@ -407,10 +407,10 @@ public class RemoteCacheNoWait
      */
     public void resetEventQ()
     {
-        ICacheEventQueue previousQueue = cacheEventQueue;
+        ICacheEventQueue<K, V> previousQueue = cacheEventQueue;
 
-        CacheEventQueueFactory fact = new CacheEventQueueFactory();
-        this.cacheEventQueue = fact.createCacheEventQueue( new CacheAdaptor( remoteCacheClient ), remoteCacheClient
+        CacheEventQueueFactory<K, V> fact = new CacheEventQueueFactory<K, V>();
+        this.cacheEventQueue = fact.createCacheEventQueue( new CacheAdaptor<K, V>( remoteCacheClient ), remoteCacheClient
             .getListenerId(), remoteCacheClient.getCacheName(), remoteCacheClient.getAuxiliaryCacheAttributes()
             .getEventQueuePoolName(), remoteCacheClient.getAuxiliaryCacheAttributes().getEventQueueType() );
 
@@ -430,7 +430,7 @@ public class RemoteCacheNoWait
      * <p>
      * @return the instance of the remote cache client used by this object
      */
-    protected IRemoteCacheClient getRemoteCache()
+    protected IRemoteCacheClient<K, V> getRemoteCache()
     {
         return remoteCacheClient;
     }
@@ -448,7 +448,7 @@ public class RemoteCacheNoWait
      * <p>
      * @return ICacheEventQueue
      */
-    protected ICacheEventQueue getCacheEventQueue()
+    protected ICacheEventQueue<K, V> getCacheEventQueue()
     {
         return this.cacheEventQueue;
     }

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheNoWaitFacade.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheNoWaitFacade.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheNoWaitFacade.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheNoWaitFacade.java Wed May 30 18:14:43 2012
@@ -19,6 +19,8 @@ package org.apache.jcs.auxiliary.remote;
  * under the License.
  */
 
+import java.io.Serializable;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.jcs.engine.CacheConstants;
@@ -34,8 +36,8 @@ import org.apache.jcs.engine.logging.beh
  * Typically, we only connect to one remote server per facade. We use a list of one
  * RemoteCacheNoWait.
  */
-public class RemoteCacheNoWaitFacade
-    extends AbstractRemoteCacheNoWaitFacade
+public class RemoteCacheNoWaitFacade<K extends Serializable, V extends Serializable>
+    extends AbstractRemoteCacheNoWaitFacade<K, V>
 {
     /** For serialization. Don't change. */
     private static final long serialVersionUID = -4529970797620747111L;
@@ -52,7 +54,7 @@ public class RemoteCacheNoWaitFacade
      * @param cacheEventLogger
      * @param elementSerializer
      */
-    public RemoteCacheNoWaitFacade( RemoteCacheNoWait[] noWaits, RemoteCacheAttributes rca,
+    public RemoteCacheNoWaitFacade( RemoteCacheNoWait<K, V>[] noWaits, RemoteCacheAttributes rca,
                                     ICompositeCacheManager cacheMgr, ICacheEventLogger cacheEventLogger,
                                     IElementSerializer elementSerializer )
     {

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/ZombieRemoteCacheService.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/ZombieRemoteCacheService.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/ZombieRemoteCacheService.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/ZombieRemoteCacheService.java Wed May 30 18:14:43 2012
@@ -19,6 +19,8 @@ package org.apache.jcs.auxiliary.remote;
  * under the License.
  */
 
+import java.io.Serializable;
+
 import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheService;
 import org.apache.jcs.engine.ZombieCacheServiceNonLocal;
 
@@ -31,9 +33,9 @@ import org.apache.jcs.engine.ZombieCache
  * <p>
  * Much of this was reusable, so I moved it to engine.
  */
-public class ZombieRemoteCacheService
-    extends ZombieCacheServiceNonLocal
-    implements IRemoteCacheService
+public class ZombieRemoteCacheService<K extends Serializable, V extends Serializable>
+    extends ZombieCacheServiceNonLocal<K, V>
+    implements IRemoteCacheService<K, V>
 {
     // backwards compatibility
 

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheClient.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheClient.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheClient.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheClient.java Wed May 30 18:14:43 2012
@@ -19,6 +19,8 @@ package org.apache.jcs.auxiliary.remote.
  * under the License.
  */
 
+import java.io.Serializable;
+
 import org.apache.jcs.auxiliary.AuxiliaryCache;
 
 /**
@@ -29,8 +31,8 @@ import org.apache.jcs.auxiliary.Auxiliar
  * <p>
  * @author Aaron Smuts
  */
-public interface IRemoteCacheClient
-    extends AuxiliaryCache
+public interface IRemoteCacheClient<K extends Serializable, V extends Serializable>
+    extends AuxiliaryCache<K, V>
 {
     /**
      * Replaces the current remote cache service handle with the given handle. If the current remote
@@ -38,7 +40,7 @@ public interface IRemoteCacheClient
      * <p>
      * @param remote IRemoteCacheService -- the remote server or proxy to the remote server
      */
-    public void fixCache( IRemoteCacheService remote );
+    public void fixCache( IRemoteCacheService<?, ?> remote );
 
     /**
      * Gets the listenerId attribute of the RemoteCacheListener object.
@@ -56,5 +58,5 @@ public interface IRemoteCacheClient
      * <p>
      * @return IRemoteCacheListener
      */
-    public IRemoteCacheListener getListener();
+    public IRemoteCacheListener<K, V> getListener();
 }

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheDispatcher.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheDispatcher.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheDispatcher.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheDispatcher.java Wed May 30 18:14:43 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/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheListener.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheListener.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheListener.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheListener.java Wed May 30 18:14:43 2012
@@ -20,6 +20,7 @@ package org.apache.jcs.auxiliary.remote.
  */
 
 import java.io.IOException;
+import java.io.Serializable;
 import java.rmi.Remote;
 
 import org.apache.jcs.engine.behavior.ICacheListener;
@@ -27,8 +28,8 @@ import org.apache.jcs.engine.behavior.IC
 /**
  * Listens for remote cache event notification ( rmi callback ).
  */
-public interface IRemoteCacheListener
-    extends ICacheListener, Remote
+public interface IRemoteCacheListener<K extends Serializable, V extends Serializable>
+    extends ICacheListener<K, V>, Remote
 {
     /** SERVER_LISTENER -- for the cluster */
     public final static int SERVER_LISTENER = 0;

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheService.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheService.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheService.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheService.java Wed May 30 18:14:43 2012
@@ -19,6 +19,8 @@ package org.apache.jcs.auxiliary.remote.
  * under the License.
  */
 
+import java.io.Serializable;
+
 import org.apache.jcs.engine.behavior.ICacheServiceNonLocal;
 
 /**
@@ -26,8 +28,8 @@ import org.apache.jcs.engine.behavior.IC
  * <p>
  * For convenience, ICacheServiceNonLocal extends Remote.
  */
-public interface IRemoteCacheService
-    extends ICacheServiceNonLocal
+public interface IRemoteCacheService<K extends Serializable, V extends Serializable>
+    extends ICacheServiceNonLocal<K, V>
 {
     // backwards compatibility
 }

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCache.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCache.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCache.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCache.java Wed May 30 18:14:43 2012
@@ -20,6 +20,7 @@ package org.apache.jcs.auxiliary.remote.
  */
 
 import java.io.IOException;
+import java.io.Serializable;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -31,8 +32,8 @@ import org.apache.jcs.auxiliary.remote.b
 /**
  * This uses an http client as the service.
  */
-public class RemoteHttpCache
-    extends AbstractRemoteAuxiliaryCache
+public class RemoteHttpCache<K extends Serializable, V extends Serializable>
+    extends AbstractRemoteAuxiliaryCache<K, V>
 {
     /** Don't change. */
     private static final long serialVersionUID = -5329231850422826461L;
@@ -53,8 +54,8 @@ public class RemoteHttpCache
      * @param remote
      * @param listener
      */
-    public RemoteHttpCache( RemoteHttpCacheAttributes remoteHttpCacheAttributes, IRemoteCacheService remote,
-                            IRemoteCacheListener listener )
+    public RemoteHttpCache( RemoteHttpCacheAttributes remoteHttpCacheAttributes, IRemoteCacheService<K, V> remote,
+                            IRemoteCacheListener<K, V> listener )
     {
         super( remoteHttpCacheAttributes, remote, listener );
 
@@ -79,7 +80,7 @@ public class RemoteHttpCache
             logError( cacheName, "", message );
             log.error( message, ex );
 
-            setRemoteCacheService( new ZombieRemoteCacheService( getRemoteCacheAttributes().getZombieQueueMaxSize() ) );
+            setRemoteCacheService( new ZombieRemoteCacheService<K, V>( getRemoteCacheAttributes().getZombieQueueMaxSize() ) );
 
             RemoteHttpCacheMonitor.getInstance().notifyError( this );
         }

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheClient.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheClient.java?rev=1344374&r1=1344373&r2=1344374&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheClient.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheClient.java Wed May 30 18:14:43 2012
@@ -36,8 +36,8 @@ import org.apache.jcs.auxiliary.remote.v
 import org.apache.jcs.engine.behavior.ICacheElement;
 
 /** This is the service used by the remote http auxiliary cache. */
-public class RemoteHttpCacheClient
-    implements IRemoteHttpCacheClient
+public class RemoteHttpCacheClient<K extends Serializable, V extends Serializable>
+    implements IRemoteHttpCacheClient<K, V>
 {
     /** The Logger. */
     private final static Log log = LogFactory.getLog( RemoteCacheServiceAdaptor.class );
@@ -93,7 +93,7 @@ public class RemoteHttpCacheClient
      * @return ICacheElement
      * @throws IOException
      */
-    public ICacheElement get( String cacheName, Serializable key )
+    public ICacheElement<K, V> get( String cacheName, K key )
         throws IOException
     {
         return get( cacheName, key, 0 );
@@ -108,7 +108,7 @@ public class RemoteHttpCacheClient
      * @return ICacheElement
      * @throws IOException
      */
-    public ICacheElement get( String cacheName, Serializable key, long requesterId )
+    public ICacheElement<K, V> get( String cacheName, K key, long requesterId )
         throws IOException
     {
         if ( !isInitialized() )
@@ -117,20 +117,20 @@ public class RemoteHttpCacheClient
             log.warn( message );
             throw new IOException( message );
         }
-        RemoteCacheRequest remoteHttpCacheRequest = RemoteCacheRequestFactory.createGetRequest( cacheName, key,
-                                                                                                requesterId );
+        RemoteCacheRequest<K, Serializable> remoteHttpCacheRequest =
+            RemoteCacheRequestFactory.createGetRequest( cacheName, key, requesterId );
 
-        RemoteCacheResponse remoteHttpCacheResponse = getRemoteDispatcher().dispatchRequest( remoteHttpCacheRequest );
+        RemoteCacheResponse<K, V> remoteHttpCacheResponse = getRemoteDispatcher().dispatchRequest( remoteHttpCacheRequest );
 
         if ( log.isDebugEnabled() )
         {
             log.debug( "Get [" + key + "] = " + remoteHttpCacheResponse );
         }
 
-        ICacheElement retval = null;
+        ICacheElement<K, V> retval = null;
         if ( remoteHttpCacheResponse != null && remoteHttpCacheResponse.getPayload() != null )
         {
-            retval = (ICacheElement)remoteHttpCacheResponse.getPayload().get( key );
+            retval = remoteHttpCacheResponse.getPayload().get( key );
         }
         return retval;
     }
@@ -140,11 +140,11 @@ public class RemoteHttpCacheClient
      * <p>
      * @param cacheName
      * @param pattern
-     * @return a map of Serializable key to ICacheElement element, or an empty map if there is no
+     * @return a map of K key to ICacheElement<K, V> element, or an empty map if there is no
      *         data in cache matching the pattern.
      * @throws IOException
      */
-    public Map<Serializable, ICacheElement> getMatching( String cacheName, String pattern )
+    public Map<K, ICacheElement<K, V>> getMatching( String cacheName, String pattern )
         throws IOException
     {
         return getMatching( cacheName, pattern, 0 );
@@ -156,11 +156,11 @@ public class RemoteHttpCacheClient
      * @param cacheName
      * @param pattern
      * @param requesterId
-     * @return a map of Serializable key to ICacheElement element, or an empty map if there is no
+     * @return a map of K key to ICacheElement<K, V> element, or an empty map if there is no
      *         data in cache matching the pattern.
      * @throws IOException
      */
-    public Map<Serializable, ICacheElement> getMatching( String cacheName, String pattern, long requesterId )
+    public Map<K, ICacheElement<K, V>> getMatching( String cacheName, String pattern, long requesterId )
         throws IOException
     {
         if ( !isInitialized() )
@@ -170,18 +170,17 @@ public class RemoteHttpCacheClient
             throw new IOException( message );
         }
 
-        RemoteCacheRequest remoteHttpCacheRequest = RemoteCacheRequestFactory.createGetMatchingRequest( cacheName,
-                                                                                                        pattern,
-                                                                                                        requesterId );
+        RemoteCacheRequest<K, V> remoteHttpCacheRequest =
+            RemoteCacheRequestFactory.createGetMatchingRequest( cacheName, pattern, requesterId );
 
-        RemoteCacheResponse remoteHttpCacheResponse = getRemoteDispatcher().dispatchRequest( remoteHttpCacheRequest );
+        RemoteCacheResponse<K, V> remoteHttpCacheResponse = getRemoteDispatcher().dispatchRequest( remoteHttpCacheRequest );
 
         if ( log.isDebugEnabled() )
         {
             log.debug( "GetMatching [" + pattern + "] = " + remoteHttpCacheResponse );
         }
 
-        return (Map)remoteHttpCacheResponse.getPayload();
+        return remoteHttpCacheResponse.getPayload();
     }
 
     /**
@@ -189,11 +188,11 @@ public class RemoteHttpCacheClient
      * <p>
      * @param cacheName
      * @param keys
-     * @return a map of Serializable key to ICacheElement element, or an empty map if there is no
+     * @return a map of K key to ICacheElement<K, V> element, or an empty map if there is no
      *         data in cache for any of these keys
      * @throws IOException
      */
-    public Map<Serializable, ICacheElement> getMultiple( String cacheName, Set<Serializable> keys )
+    public Map<K, ICacheElement<K, V>> getMultiple( String cacheName, Set<K> keys )
         throws IOException
     {
         return getMultiple( cacheName, keys, 0 );
@@ -205,11 +204,11 @@ public class RemoteHttpCacheClient
      * @param cacheName
      * @param keys
      * @param requesterId
-     * @return a map of Serializable key to ICacheElement element, or an empty map if there is no
+     * @return a map of K key to ICacheElement<K, V> element, or an empty map if there is no
      *         data in cache for any of these keys
      * @throws IOException
      */
-    public Map<Serializable, ICacheElement> getMultiple( String cacheName, Set<Serializable> keys, long requesterId )
+    public Map<K, ICacheElement<K, V>> getMultiple( String cacheName, Set<K> keys, long requesterId )
         throws IOException
     {
         if ( !isInitialized() )
@@ -219,18 +218,17 @@ public class RemoteHttpCacheClient
             throw new IOException( message );
         }
 
-        RemoteCacheRequest remoteHttpCacheRequest = RemoteCacheRequestFactory.createGetMultipleRequest( cacheName,
-                                                                                                        keys,
-                                                                                                        requesterId );
+        RemoteCacheRequest<K, V> remoteHttpCacheRequest =
+            RemoteCacheRequestFactory.createGetMultipleRequest( cacheName, keys, requesterId );
 
-        RemoteCacheResponse remoteHttpCacheResponse = getRemoteDispatcher().dispatchRequest( remoteHttpCacheRequest );
+        RemoteCacheResponse<K, V> remoteHttpCacheResponse = getRemoteDispatcher().dispatchRequest( remoteHttpCacheRequest );
 
         if ( log.isDebugEnabled() )
         {
             log.debug( "GetMultiple [" + keys + "] = " + remoteHttpCacheResponse );
         }
 
-        return (Map)remoteHttpCacheResponse.getPayload();
+        return remoteHttpCacheResponse.getPayload();
     }
 
     /**
@@ -240,7 +238,7 @@ public class RemoteHttpCacheClient
      * @param key
      * @throws IOException
      */
-    public void remove( String cacheName, Serializable key )
+    public void remove( String cacheName, K key )
         throws IOException
     {
         remove( cacheName, key, 0 );
@@ -254,7 +252,7 @@ public class RemoteHttpCacheClient
      * @param requesterId
      * @throws IOException
      */
-    public void remove( String cacheName, Serializable key, long requesterId )
+    public void remove( String cacheName, K key, long requesterId )
         throws IOException
     {
         if ( !isInitialized() )
@@ -264,8 +262,8 @@ public class RemoteHttpCacheClient
             throw new IOException( message );
         }
 
-        RemoteCacheRequest remoteHttpCacheRequest = RemoteCacheRequestFactory.createRemoveRequest( cacheName, key,
-                                                                                                   requesterId );
+        RemoteCacheRequest<K, V> remoteHttpCacheRequest =
+            RemoteCacheRequestFactory.createRemoveRequest( cacheName, key, requesterId );
 
         getRemoteDispatcher().dispatchRequest( remoteHttpCacheRequest );
     }
@@ -299,8 +297,8 @@ public class RemoteHttpCacheClient
             throw new IOException( message );
         }
 
-        RemoteCacheRequest remoteHttpCacheRequest = RemoteCacheRequestFactory.createRemoveAllRequest( cacheName,
-                                                                                                      requesterId );
+        RemoteCacheRequest<K, V> remoteHttpCacheRequest =
+            RemoteCacheRequestFactory.createRemoveAllRequest( cacheName, requesterId );
 
         getRemoteDispatcher().dispatchRequest( remoteHttpCacheRequest );
     }
@@ -311,7 +309,7 @@ public class RemoteHttpCacheClient
      * @param item
      * @throws IOException
      */
-    public void update( ICacheElement item )
+    public void update( ICacheElement<K, V> item )
         throws IOException
     {
         update( item, 0 );
@@ -324,7 +322,7 @@ public class RemoteHttpCacheClient
      * @param requesterId
      * @throws IOException
      */
-    public void update( ICacheElement cacheElement, long requesterId )
+    public void update( ICacheElement<K, V> cacheElement, long requesterId )
         throws IOException
     {
         if ( !isInitialized() )
@@ -334,8 +332,8 @@ public class RemoteHttpCacheClient
             throw new IOException( message );
         }
 
-        RemoteCacheRequest remoteHttpCacheRequest = RemoteCacheRequestFactory.createUpdateRequest( cacheElement,
-                                                                                                   requesterId );
+        RemoteCacheRequest<K, V> remoteHttpCacheRequest =
+            RemoteCacheRequestFactory.createUpdateRequest( cacheElement, requesterId );
 
         getRemoteDispatcher().dispatchRequest( remoteHttpCacheRequest );
     }
@@ -356,7 +354,8 @@ public class RemoteHttpCacheClient
             throw new IOException( message );
         }
 
-        RemoteCacheRequest remoteHttpCacheRequest = RemoteCacheRequestFactory.createDisposeRequest( cacheName, 0 );
+        RemoteCacheRequest<K, V> remoteHttpCacheRequest =
+            RemoteCacheRequestFactory.createDisposeRequest( cacheName, 0 );
 
         getRemoteDispatcher().dispatchRequest( remoteHttpCacheRequest );
     }
@@ -378,7 +377,7 @@ public class RemoteHttpCacheClient
      * @return A Set of keys
      * @throws IOException
      */
-    public Set<Serializable> getGroupKeys( String cacheName, String groupName )
+    public Set<K> getGroupKeys( String cacheName, String groupName )
         throws IOException
     {
         if ( !isInitialized() )
@@ -388,14 +387,15 @@ public class RemoteHttpCacheClient
             throw new IOException( message );
         }
 
-        RemoteCacheRequest remoteHttpCacheRequest = RemoteCacheRequestFactory.createGetGroupKeysRequest( cacheName,
-                                                                                                         groupName, 0 );
+        RemoteCacheRequest<String, String> remoteHttpCacheRequest =
+            RemoteCacheRequestFactory.createGetGroupKeysRequest( cacheName, groupName, 0 );
 
-        RemoteCacheResponse remoteHttpCacheResponse = getRemoteDispatcher().dispatchRequest( remoteHttpCacheRequest );
+        RemoteCacheResponse<K, V> remoteHttpCacheResponse = getRemoteDispatcher().dispatchRequest( remoteHttpCacheRequest );
 
         if ( remoteHttpCacheResponse != null && remoteHttpCacheResponse.getPayload() != null )
         {
-            return (Set<Serializable>)remoteHttpCacheResponse.getPayload().get( groupName );
+            // FIXME: Unchecked cast
+            return (Set<K>)remoteHttpCacheResponse.getPayload().get( groupName );
         }
 
         return Collections.emptySet();
@@ -417,8 +417,8 @@ public class RemoteHttpCacheClient
             throw new IOException( message );
         }
 
-        RemoteCacheRequest remoteHttpCacheRequest = RemoteCacheRequestFactory.createAliveCheckRequest( 0 );
-        RemoteCacheResponse remoteHttpCacheResponse = getRemoteDispatcher().dispatchRequest( remoteHttpCacheRequest );
+        RemoteCacheRequest<K, V> remoteHttpCacheRequest = RemoteCacheRequestFactory.createAliveCheckRequest( 0 );
+        RemoteCacheResponse<K, V> remoteHttpCacheResponse = getRemoteDispatcher().dispatchRequest( remoteHttpCacheRequest );
 
         if ( remoteHttpCacheResponse != null )
         {



Mime
View raw message