commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t.@apache.org
Subject svn commit: r1369329 [2/3] - in /commons/proper/jcs/trunk/src/java/org/apache/jcs: access/ admin/ auxiliary/ auxiliary/disk/ auxiliary/disk/block/ auxiliary/disk/file/ auxiliary/disk/indexed/ auxiliary/disk/jdbc/ auxiliary/disk/jdbc/hsql/ auxiliary/dis...
Date Sat, 04 Aug 2012 14:19:11 GMT
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=1369329&r1=1369328&r2=1369329&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 Sat Aug  4 14:19:08 2012
@@ -39,10 +39,11 @@ import org.apache.jcs.auxiliary.Auxiliar
 import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheAttributes;
 import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheClient;
 import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheListener;
-import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheService;
 import org.apache.jcs.engine.CacheConstants;
+import org.apache.jcs.engine.ZombieCacheServiceNonLocal;
 import org.apache.jcs.engine.behavior.ICacheElement;
 import org.apache.jcs.engine.behavior.ICacheElementSerialized;
+import org.apache.jcs.engine.behavior.ICacheServiceNonLocal;
 import org.apache.jcs.engine.behavior.IZombie;
 import org.apache.jcs.engine.logging.behavior.ICacheEventLogger;
 import org.apache.jcs.engine.stats.StatElement;
@@ -67,7 +68,7 @@ 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<K, V> remoteCacheService;
+    private ICacheServiceNonLocal<K, V> remoteCacheService;
 
     /** The cacheName */
     protected final String cacheName;
@@ -91,7 +92,7 @@ public abstract class AbstractRemoteAuxi
      * @param remote
      * @param listener
      */
-    public AbstractRemoteAuxiliaryCache( IRemoteCacheAttributes cattr, IRemoteCacheService<K, V> remote,
+    public AbstractRemoteAuxiliaryCache( IRemoteCacheAttributes cattr, ICacheServiceNonLocal<K, V> remote,
                                          IRemoteCacheListener<K, V> listener )
     {
         this.setRemoteCacheAttributes( cattr );
@@ -592,11 +593,11 @@ public abstract class AbstractRemoteAuxi
             elems.add( se );
         }
 
-        if ( getRemoteCacheService() instanceof ZombieRemoteCacheService )
+        if ( getRemoteCacheService() instanceof ZombieCacheServiceNonLocal )
         {
             se = new StatElement();
             se.setName( "Zombie Queue Size" );
-            se.setData( "" + ( (ZombieRemoteCacheService) getRemoteCacheService() ).getQueueSize() );
+            se.setData( "" + ( (ZombieCacheServiceNonLocal<K, V>) getRemoteCacheService() ).getQueueSize() );
             elems.add( se );
         }
 
@@ -621,14 +622,15 @@ public abstract class AbstractRemoteAuxi
      * Replaces the current remote cache service handle with the given handle. If the current remote
      * is a Zombie, then it propagates any events that are queued to the restored service.
      * <p>
-     * @param restoredRemote IRemoteCacheService -- the remote server or proxy to the remote server
+     * @param restoredRemote ICacheServiceNonLocal -- the remote server or proxy to the remote server
      */
-    public void fixCache( IRemoteCacheService<?, ?> restoredRemote )
+    public void fixCache( ICacheServiceNonLocal<?, ?> restoredRemote )
     {
-        IRemoteCacheService<K, V> remote = (IRemoteCacheService<K, V>)restoredRemote;
-        if ( getRemoteCacheService() != null && getRemoteCacheService() instanceof ZombieRemoteCacheService )
+        @SuppressWarnings("unchecked")
+        ICacheServiceNonLocal<K, V> remote = (ICacheServiceNonLocal<K, V>)restoredRemote;
+        if ( getRemoteCacheService() != null && getRemoteCacheService() instanceof ZombieCacheServiceNonLocal )
         {
-            ZombieRemoteCacheService<K, V> zombie = (ZombieRemoteCacheService<K, V>) getRemoteCacheService();
+            ZombieCacheServiceNonLocal<K, V> zombie = (ZombieCacheServiceNonLocal<K, V>) getRemoteCacheService();
             setRemoteCacheService( remote );
             try
             {
@@ -676,7 +678,7 @@ public abstract class AbstractRemoteAuxi
     /**
      * @param remote the remote to set
      */
-    protected void setRemoteCacheService( IRemoteCacheService<K, V> remote )
+    protected void setRemoteCacheService( ICacheServiceNonLocal<K, V> remote )
     {
         this.remoteCacheService = remote;
     }
@@ -684,7 +686,7 @@ public abstract class AbstractRemoteAuxi
     /**
      * @return the remote
      */
-    protected IRemoteCacheService<K, V> getRemoteCacheService()
+    protected ICacheServiceNonLocal<K, V> getRemoteCacheService()
     {
         return remoteCacheService;
     }

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=1369329&r1=1369328&r2=1369329&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 Sat Aug  4 14:19:08 2012
@@ -29,7 +29,8 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheAttributes;
 import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheListener;
-import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheService;
+import org.apache.jcs.engine.ZombieCacheServiceNonLocal;
+import org.apache.jcs.engine.behavior.ICacheServiceNonLocal;
 import org.apache.jcs.engine.stats.StatElement;
 import org.apache.jcs.engine.stats.Stats;
 import org.apache.jcs.engine.stats.behavior.IStatElement;
@@ -60,7 +61,7 @@ public class RemoteCache<K extends Seria
      * @param remote
      * @param listener
      */
-    public RemoteCache( IRemoteCacheAttributes cattr, IRemoteCacheService<K, V> remote, IRemoteCacheListener<K, V> listener )
+    public RemoteCache( IRemoteCacheAttributes cattr, ICacheServiceNonLocal<K, V> remote, IRemoteCacheListener<K, V> listener )
     {
         super( cattr, remote, listener );
 
@@ -128,10 +129,10 @@ public class RemoteCache<K extends Seria
         log.error( message, ex );
 
         // we should not switch if the existing is a zombie.
-        if ( getRemoteCacheService() == null || !( getRemoteCacheService() instanceof ZombieRemoteCacheService ) )
+        if ( getRemoteCacheService() == null || !( getRemoteCacheService() instanceof ZombieCacheServiceNonLocal ) )
         {
             // TODO make configurable
-            setRemoteCacheService( new ZombieRemoteCacheService<K, V>( getRemoteCacheAttributes().getZombieQueueMaxSize() ) );
+            setRemoteCacheService( new ZombieCacheServiceNonLocal<K, V>( getRemoteCacheAttributes().getZombieQueueMaxSize() ) );
         }
         // may want to flush if region specifies
         // Notify the cache monitor about the error, and kick off the recovery
@@ -139,6 +140,7 @@ public class RemoteCache<K extends Seria
         RemoteCacheMonitor.getInstance().notifyError();
 
         // initiate failover if local
+        @SuppressWarnings("unchecked")
         RemoteCacheNoWaitFacade<K, V> rcnwf = (RemoteCacheNoWaitFacade<K, V>)RemoteCacheFactory.getFacades()
             .get( getRemoteCacheAttributes().getCacheName() );
 

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=1369329&r1=1369328&r2=1369329&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 Sat Aug  4 14:19:08 2012
@@ -171,8 +171,10 @@ public class RemoteCacheFactory
         }
         // end if CLUSTER
 
-        RemoteCacheNoWaitFacade<K, V> rcnwf = new RemoteCacheNoWaitFacade<K, V>( noWaits
-            .toArray( new RemoteCacheNoWait[0] ), rca, cacheMgr, cacheEventLogger, elementSerializer );
+        @SuppressWarnings("unchecked")
+        RemoteCacheNoWait<K, V>[] rcnwArray = noWaits.toArray( new RemoteCacheNoWait[0] );
+        RemoteCacheNoWaitFacade<K, V> rcnwf =
+            new RemoteCacheNoWaitFacade<K, V>(rcnwArray, rca, cacheMgr, cacheEventLogger, elementSerializer );
 
         getFacades().put( rca.getCacheName(), rcnwf );
 

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=1369329&r1=1369328&r2=1369329&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 Sat Aug  4 14:19:08 2012
@@ -144,6 +144,7 @@ public class RemoteCacheFailoverRunner<K
      * continue until the primary is re-connected. If no failovers are defined,
      * this will exit automatically.
      */
+    @SuppressWarnings("unchecked")
     private void connectAndRestore()
     {
         do
@@ -218,7 +219,7 @@ public class RemoteCacheFailoverRunner<K
                             if ( ic.getStatus() == CacheConstants.STATUS_ALIVE )
                             {
                                 // may need to do this more gracefully
-                                log.debug( "reseting no wait" );
+                                log.debug( "resetting no wait" );
                                 facade.noWaits = new RemoteCacheNoWait[1];
                                 facade.noWaits[0] = (RemoteCacheNoWait<K, V>) ic;
                                 facade.remoteCacheAttributes.setFailoverIndex( i );
@@ -263,15 +264,17 @@ public class RemoteCacheFailoverRunner<K
                         // Problem encountered in fixing the caches managed by a
                         // RemoteCacheManager instance.
                         // Soldier on to the next RemoteCacheManager instance.
+                        String remoteHost = (rca == null) ? "null" : rca.getRemoteHost();
+                        int remotePort = (rca == null) ? 0 : rca.getRemotePort();
                         if ( i == 0 )
                         {
-                            log.warn( "FAILED to connect, as expected, to primary" + rca.getRemoteHost() + ":"
-                                + rca.getRemotePort(), ex );
+                            log.warn( "FAILED to connect, as expected, to primary" + remoteHost + ":"
+                                + remotePort, ex );
                         }
                         else
                         {
-                            log.error( "FAILED to connect to failover [" + rca.getRemoteHost() + ":"
-                                + rca.getRemotePort() + "]", ex );
+                            log.error( "FAILED to connect to failover [" + remoteHost + ":"
+                                + remotePort + "]", ex );
                         }
                     }
                 }
@@ -336,6 +339,7 @@ public class RemoteCacheFailoverRunner<K
      *
      * @return boolean value indicating whether the restoration was successful
      */
+    @SuppressWarnings("unchecked")
     private boolean restorePrimary()
     {
         // try to move back to the primary
@@ -459,7 +463,7 @@ public class RemoteCacheFailoverRunner<K
                     return true;
                 }
 
-                // else alright
+                // else all right
                 // if the failover index was at 0 here, we would be in a bad
                 // situation, unless there were just
                 // no failovers configured.

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=1369329&r1=1369328&r2=1369329&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 Sat Aug  4 14:19:08 2012
@@ -28,14 +28,14 @@ import java.util.Map;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.jcs.auxiliary.AuxiliaryCache;
 import org.apache.jcs.auxiliary.AuxiliaryCacheManager;
 import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheAttributes;
 import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheClient;
 import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheListener;
 import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheObserver;
-import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheService;
+import org.apache.jcs.engine.ZombieCacheServiceNonLocal;
 import org.apache.jcs.engine.behavior.ICache;
+import org.apache.jcs.engine.behavior.ICacheServiceNonLocal;
 import org.apache.jcs.engine.behavior.ICompositeCacheManager;
 import org.apache.jcs.engine.behavior.IElementSerializer;
 import org.apache.jcs.engine.behavior.IShutdownObserver;
@@ -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<? extends Serializable, ? extends Serializable> remoteService;
+    private ICacheServiceNonLocal<? extends Serializable, ? extends Serializable> remoteService;
 
     /**
      * Wrapper of the remote cache watch service; or wrapper of a zombie service if failed to
@@ -148,7 +148,7 @@ public class RemoteCacheManager
             }
 
             // Successful connection to the remote server.
-            remoteService = (IRemoteCacheService<?, ?>) obj;
+            remoteService = (ICacheServiceNonLocal<?, ?>) obj;
             if ( log.isDebugEnabled() )
             {
                 log.debug( "remoteService = " + remoteService );
@@ -163,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<String, String>();
+            remoteService = new ZombieCacheServiceNonLocal<String, String>();
             remoteWatch = new RemoteCacheWatchRepairable();
             remoteWatch.setCacheWatch( new ZombieRemoteCacheWatch() );
 
@@ -372,7 +372,7 @@ public class RemoteCacheManager
      * @param cacheName
      * @return The cache value
      */
-    public <K extends Serializable, V extends Serializable> AuxiliaryCache<K, V> getCache( String cacheName )
+    public <K extends Serializable, V extends Serializable> RemoteCacheNoWait<K, V> getCache( String cacheName )
     {
         IRemoteCacheAttributes ca = (IRemoteCacheAttributes) remoteCacheAttributes.copy();
         ca.setCacheName( cacheName );
@@ -389,13 +389,15 @@ public class RemoteCacheManager
      * @param cattr
      * @return The cache value
      */
-    public <K extends Serializable, V extends Serializable> AuxiliaryCache<K, V> getCache( IRemoteCacheAttributes cattr )
+    public <K extends Serializable, V extends Serializable> RemoteCacheNoWait<K, V> getCache( IRemoteCacheAttributes cattr )
     {
         RemoteCacheNoWait<K, V> remoteCacheNoWait = null;
 
         synchronized ( caches )
         {
-            remoteCacheNoWait = (RemoteCacheNoWait<K, V>) caches.get( cattr.getCacheName() );
+            @SuppressWarnings("unchecked")
+            RemoteCacheNoWait<K, V> remoteCacheNoWait2 = (RemoteCacheNoWait<K, V>) caches.get( cattr.getCacheName() );
+            remoteCacheNoWait = remoteCacheNoWait2;
             if ( remoteCacheNoWait == null )
             {
                 // create a listener first and pass it to the remotecache
@@ -417,7 +419,8 @@ public class RemoteCacheManager
                         + listener, e );
                 }
 
-                IRemoteCacheClient<K, V> remoteCacheClient = new RemoteCache<K, V>( cattr, (IRemoteCacheService<K, V>) remoteService, listener );
+                @SuppressWarnings("unchecked")
+                IRemoteCacheClient<K, V> remoteCacheClient = new RemoteCache<K, V>( cattr, (ICacheServiceNonLocal<K, V>) remoteService, listener );
                 remoteCacheClient.setCacheEventLogger( cacheEventLogger );
                 remoteCacheClient.setElementSerializer( elementSerializer );
 
@@ -511,11 +514,11 @@ public class RemoteCacheManager
      * @param remoteService
      * @param remoteWatch
      */
-    public void fixCaches( IRemoteCacheService<? extends Serializable, ? extends Serializable> remoteService, IRemoteCacheObserver remoteWatch )
+    public void fixCaches( ICacheServiceNonLocal<? extends Serializable, ? extends Serializable> remoteService, IRemoteCacheObserver remoteWatch )
     {
         if ( log.isInfoEnabled() )
         {
-            log.info( "Fixing caches. IRemoteCacheService " + remoteService + " | IRemoteCacheObserver " + remoteWatch );
+            log.info( "Fixing caches. ICacheServiceNonLocal " + remoteService + " | IRemoteCacheObserver " + remoteWatch );
         }
         synchronized ( caches )
         {
@@ -576,9 +579,9 @@ public class RemoteCacheManager
                 return false;
             }
             Location l = (Location) obj;
-            if ( this.host == null && l.host != null )
+            if ( this.host == null )
             {
-                return false;
+                return l.host == null && port == l.port;
             }
             return host.equals( l.host ) && port == l.port;
         }

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheMonitor.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheMonitor.java?rev=1369329&r1=1369328&r2=1369329&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheMonitor.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheMonitor.java Sat Aug  4 14:19:08 2012
@@ -183,7 +183,7 @@ public class RemoteCacheMonitor
                     // managed by the
                     // same RmicCacheManager instance are in error. So we fix
                     // them once and for all.
-                    for (RemoteCacheNoWait c : mgr.caches.values())
+                    for (RemoteCacheNoWait<?, ?> c : mgr.caches.values())
                     {
                         if ( c.getStatus() == CacheConstants.STATUS_ERROR )
                         {

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=1369329&r1=1369328&r2=1369329&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 Sat Aug  4 14:19:08 2012
@@ -35,12 +35,12 @@ import org.apache.commons.logging.LogFac
 import org.apache.jcs.auxiliary.AbstractAuxiliaryCache;
 import org.apache.jcs.auxiliary.AuxiliaryCacheAttributes;
 import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheClient;
-import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheService;
 import org.apache.jcs.engine.CacheAdaptor;
 import org.apache.jcs.engine.CacheConstants;
 import org.apache.jcs.engine.CacheEventQueueFactory;
 import org.apache.jcs.engine.behavior.ICacheElement;
 import org.apache.jcs.engine.behavior.ICacheEventQueue;
+import org.apache.jcs.engine.behavior.ICacheServiceNonLocal;
 import org.apache.jcs.engine.behavior.ICacheType;
 import org.apache.jcs.engine.stats.StatElement;
 import org.apache.jcs.engine.stats.Stats;
@@ -392,7 +392,7 @@ public class RemoteCacheNoWait<K extends
      * <p>
      * @param remote
      */
-    public void fixCache( IRemoteCacheService<?, ?> remote )
+    public void fixCache( ICacheServiceNonLocal<?, ?> remote )
     {
         remoteCacheClient.fixCache( remote );
         resetEventQ();

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=1369329&r1=1369328&r2=1369329&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 Sat Aug  4 14:19:08 2012
@@ -79,8 +79,9 @@ public class RemoteCacheNoWaitFacade<K e
             if ( noWaits[i].getStatus() == CacheConstants.STATUS_ERROR )
             {
                 // start failover, primary recovery process
-                RemoteCacheFailoverRunner runner = new RemoteCacheFailoverRunner( this, getCompositeCacheManager(),
-                                                                                  cacheEventLogger, elementSerializer );
+                RemoteCacheFailoverRunner<K, V> runner =
+                    new RemoteCacheFailoverRunner<K, V>( this, getCompositeCacheManager(),
+                      cacheEventLogger, elementSerializer );
                 runner.notifyError();
                 Thread t = new Thread( runner );
                 t.setDaemon( true );

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheRestore.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheRestore.java?rev=1369329&r1=1369328&r2=1369329&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheRestore.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheRestore.java Sat Aug  4 14:19:08 2012
@@ -19,13 +19,15 @@ package org.apache.jcs.auxiliary.remote;
  * under the License.
  */
 
+import java.io.IOException;
 import java.rmi.Naming;
+import java.rmi.NotBoundException;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheObserver;
-import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheService;
 import org.apache.jcs.engine.behavior.ICacheRestore;
+import org.apache.jcs.engine.behavior.ICacheServiceNonLocal;
 
 /**
  * Used to repair the remote caches managed by the associated instance of RemoteCacheManager.
@@ -88,11 +90,17 @@ public class RemoteCacheRestore
                 log.info( "Found server " + remoteObj );
             }
         }
-        catch ( Exception ex )
+        catch (IOException e)
         {
             log.error( "host=" + remoteCacheManager.host + "; port" + remoteCacheManager.port + "; service=" + remoteCacheManager.service );
             canFix = false;
         }
+        catch (NotBoundException e)
+        {
+            log.error( "host=" + remoteCacheManager.host + "; port" + remoteCacheManager.port + "; service=" + remoteCacheManager.service );
+            canFix = false;
+        }
+
         return canFix;
     }
 
@@ -105,7 +113,7 @@ public class RemoteCacheRestore
         {
             return;
         }
-        remoteCacheManager.fixCaches( (IRemoteCacheService) remoteObj, (IRemoteCacheObserver) remoteObj );
+        remoteCacheManager.fixCaches( (ICacheServiceNonLocal<?, ?>) remoteObj, (IRemoteCacheObserver) remoteObj );
 
         if ( log.isInfoEnabled() )
         {

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheWatchRepairable.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheWatchRepairable.java?rev=1369329&r1=1369328&r2=1369329&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheWatchRepairable.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheWatchRepairable.java Sat Aug  4 14:19:08 2012
@@ -20,7 +20,6 @@ package org.apache.jcs.auxiliary.remote;
  */
 
 import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheObserver;
-
 import org.apache.jcs.engine.CacheWatchRepairable;
 
 /**

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/ZombieRemoteCacheWatch.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/ZombieRemoteCacheWatch.java?rev=1369329&r1=1369328&r2=1369329&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/ZombieRemoteCacheWatch.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/ZombieRemoteCacheWatch.java Sat Aug  4 14:19:08 2012
@@ -20,7 +20,6 @@ package org.apache.jcs.auxiliary.remote;
  */
 
 import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheObserver;
-
 import org.apache.jcs.engine.ZombieCacheWatch;
 
 /**

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=1369329&r1=1369328&r2=1369329&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 Sat Aug  4 14:19:08 2012
@@ -22,6 +22,7 @@ package org.apache.jcs.auxiliary.remote.
 import java.io.Serializable;
 
 import org.apache.jcs.auxiliary.AuxiliaryCache;
+import org.apache.jcs.engine.behavior.ICacheServiceNonLocal;
 
 /**
  * This defines the behavior expected of a remote cache client. This extends Auxiliary cache which
@@ -38,9 +39,9 @@ public interface IRemoteCacheClient<K ex
      * Replaces the current remote cache service handle with the given handle. If the current remote
      * is a Zombie, the propagate the events that may be queued to the restored service.
      * <p>
-     * @param remote IRemoteCacheService -- the remote server or proxy to the remote server
+     * @param remote ICacheServiceNonLocal -- the remote server or proxy to the remote server
      */
-    public void fixCache( IRemoteCacheService<?, ?> remote );
+    public void fixCache( ICacheServiceNonLocal<?, ?> remote );
 
     /**
      * Gets the listenerId attribute of the RemoteCacheListener object.

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheConstants.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheConstants.java?rev=1369329&r1=1369328&r2=1369329&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheConstants.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheConstants.java Sat Aug  4 14:19:08 2012
@@ -1,5 +1,7 @@
 package org.apache.jcs.auxiliary.remote.behavior;
 
+import org.apache.jcs.engine.behavior.ICacheServiceNonLocal;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -25,7 +27,7 @@ package org.apache.jcs.auxiliary.remote.
 public interface IRemoteCacheConstants
 {
     /** Mapping to props file value */
-    public final static String REMOTE_CACHE_SERVICE_VAL = IRemoteCacheService.class.getName();
+    public final static String REMOTE_CACHE_SERVICE_VAL = ICacheServiceNonLocal.class.getName();
 
     /** The prefix for cache server config. */
     public final static String CACHE_SERVER_PREFIX = "jcs.remotecache";

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=1369329&r1=1369328&r2=1369329&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 Sat Aug  4 14:19:08 2012
@@ -25,9 +25,9 @@ import java.io.Serializable;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.jcs.auxiliary.remote.AbstractRemoteAuxiliaryCache;
-import org.apache.jcs.auxiliary.remote.ZombieRemoteCacheService;
 import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheListener;
-import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheService;
+import org.apache.jcs.engine.ZombieCacheServiceNonLocal;
+import org.apache.jcs.engine.behavior.ICacheServiceNonLocal;
 
 /**
  * This uses an http client as the service.
@@ -54,7 +54,7 @@ public class RemoteHttpCache<K extends S
      * @param remote
      * @param listener
      */
-    public RemoteHttpCache( RemoteHttpCacheAttributes remoteHttpCacheAttributes, IRemoteCacheService<K, V> remote,
+    public RemoteHttpCache( RemoteHttpCacheAttributes remoteHttpCacheAttributes, ICacheServiceNonLocal<K, V> remote,
                             IRemoteCacheListener<K, V> listener )
     {
         super( remoteHttpCacheAttributes, remote, listener );
@@ -75,13 +75,13 @@ public class RemoteHttpCache<K extends S
         throws IOException
     {
         // we should not switch if the existing is a zombie.
-        if ( !( getRemoteCacheService() instanceof ZombieRemoteCacheService ) )
+        if ( !( getRemoteCacheService() instanceof ZombieCacheServiceNonLocal ) )
         {
             String message = "Disabling remote cache due to error: " + msg;
             logError( cacheName, "", message );
             log.error( message, ex );
 
-            setRemoteCacheService( new ZombieRemoteCacheService<K, V>( getRemoteCacheAttributes().getZombieQueueMaxSize() ) );
+            setRemoteCacheService( new ZombieCacheServiceNonLocal<K, V>( getRemoteCacheAttributes().getZombieQueueMaxSize() ) );
 
             RemoteHttpCacheMonitor.getInstance().notifyError( this );
         }

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheDispatcher.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheDispatcher.java?rev=1369329&r1=1369328&r2=1369329&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheDispatcher.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheDispatcher.java Sat Aug  4 14:19:08 2012
@@ -20,6 +20,7 @@ package org.apache.jcs.auxiliary.remote.
  */
 
 import java.io.IOException;
+import java.io.Serializable;
 import java.io.UnsupportedEncodingException;
 import java.net.URLEncoder;
 
@@ -74,7 +75,8 @@ public class RemoteHttpCacheDispatcher
      * @return RemoteCacheResponse
      * @throws IOException
      */
-    public RemoteCacheResponse dispatchRequest( RemoteCacheRequest remoteCacheRequest )
+    public <K extends Serializable, V extends Serializable, KK extends Serializable, VV extends Serializable>
+        RemoteCacheResponse<K, V> dispatchRequest( RemoteCacheRequest<KK, VV> remoteCacheRequest )
         throws IOException
     {
         try
@@ -85,10 +87,10 @@ public class RemoteHttpCacheDispatcher
 
             byte[] responseAsByteArray = processRequest( requestAsByteArray, url );
 
-            RemoteCacheResponse remoteCacheResponse = null;
+            RemoteCacheResponse<K, V> remoteCacheResponse = null;
             try
             {
-                remoteCacheResponse = (RemoteCacheResponse) serializer.deSerialize( responseAsByteArray );
+                remoteCacheResponse = serializer.deSerialize( responseAsByteArray );
             }
             catch ( ClassNotFoundException e )
             {
@@ -126,7 +128,7 @@ public class RemoteHttpCacheDispatcher
      * @param baseUrl
      * @return String
      */
-    protected String addParameters( RemoteCacheRequest remoteCacheRequest, String baseUrl )
+    protected <K extends Serializable, V extends Serializable> String addParameters( RemoteCacheRequest<K, V> remoteCacheRequest, String baseUrl )
     {
         StringBuffer url = new StringBuffer( baseUrl );
 

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheFactory.java?rev=1369329&r1=1369328&r2=1369329&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheFactory.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheFactory.java Sat Aug  4 14:19:08 2012
@@ -88,8 +88,10 @@ public class RemoteHttpCacheFactory
             log.info( "noWait is null" );
         }
 
-        RemoteCacheNoWaitFacade<K, V> rcnwf = new RemoteCacheNoWaitFacade<K, V>( noWaits
-            .toArray( new RemoteCacheNoWait[0] ), rca, cacheMgr, cacheEventLogger, elementSerializer );
+        @SuppressWarnings("unchecked")
+        RemoteCacheNoWait<K, V>[] rcnwArray = noWaits.toArray( new RemoteCacheNoWait[0] );
+        RemoteCacheNoWaitFacade<K, V> rcnwf =
+            new RemoteCacheNoWaitFacade<K, V>(rcnwArray, rca, cacheMgr, cacheEventLogger, elementSerializer );
 
         getFacades().put( rca.getCacheName(), rcnwf );
 

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheManager.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheManager.java?rev=1369329&r1=1369328&r2=1369329&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheManager.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheManager.java Sat Aug  4 14:19:08 2012
@@ -25,7 +25,6 @@ import java.util.Map;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.jcs.auxiliary.AuxiliaryCache;
 import org.apache.jcs.auxiliary.AuxiliaryCacheManager;
 import org.apache.jcs.auxiliary.remote.RemoteCacheNoWait;
 import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheAttributes;
@@ -152,7 +151,7 @@ public class RemoteHttpCacheManager
      * @param cacheName
      * @return The cache value
      */
-    public <K extends Serializable, V extends Serializable> AuxiliaryCache<K, V> getCache( String cacheName )
+    public <K extends Serializable, V extends Serializable> RemoteCacheNoWait<K, V> getCache( String cacheName )
     {
         // TODO get some defaults!
         // Perhaps we will need a manager per URL????
@@ -171,13 +170,15 @@ public class RemoteHttpCacheManager
      * @param cattr
      * @return The cache value
      */
-    public <K extends Serializable, V extends Serializable> AuxiliaryCache<K, V> getCache( RemoteHttpCacheAttributes cattr )
+    public <K extends Serializable, V extends Serializable> RemoteCacheNoWait<K, V> getCache( RemoteHttpCacheAttributes cattr )
     {
         RemoteCacheNoWait<K, V> remoteCacheNoWait = null;
 
         synchronized ( caches )
         {
-            remoteCacheNoWait = (RemoteCacheNoWait<K, V>) caches.get( cattr.getCacheName() + cattr.getUrl() );
+            @SuppressWarnings("unchecked")
+            RemoteCacheNoWait<K, V> remoteCacheNoWait2 = (RemoteCacheNoWait<K, V>) caches.get( cattr.getCacheName() + cattr.getUrl() );
+            remoteCacheNoWait = remoteCacheNoWait2;
             if ( remoteCacheNoWait == null )
             {
                 RemoteHttpClientListener<K, V> listener = new RemoteHttpClientListener<K, V>( cattr, cacheMgr );
@@ -209,8 +210,8 @@ public class RemoteHttpCacheManager
      */
     protected <K extends Serializable, V extends Serializable> IRemoteHttpCacheClient<K, V> createRemoteHttpCacheClientForAttributes( RemoteHttpCacheAttributes cattr )
     {
-        IRemoteHttpCacheClient<K, V> client = (IRemoteHttpCacheClient<K, V>) OptionConverter.instantiateByClassName( cattr
-            .getRemoteHttpClientClassName(), IRemoteHttpCacheClient.class, null );
+        IRemoteHttpCacheClient<K, V> client = OptionConverter.instantiateByClassName( cattr
+            .getRemoteHttpClientClassName(), null );
 
         if ( client == null )
         {

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheMonitor.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheMonitor.java?rev=1369329&r1=1369328&r2=1369329&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheMonitor.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheMonitor.java Sat Aug  4 14:19:08 2012
@@ -185,20 +185,20 @@ public class RemoteHttpCacheMonitor
             }
 
             // Make a copy
-            Set<RemoteHttpCache<Serializable, Serializable>> remoteCachesToExamine =
-                new HashSet<RemoteHttpCache<Serializable, Serializable>>();
+            Set<RemoteHttpCache<? extends Serializable, ? extends Serializable>> remoteCachesToExamine =
+                new HashSet<RemoteHttpCache<? extends Serializable, ? extends Serializable>>();
             synchronized ( this )
             {
-                for (RemoteHttpCache<?, ?> remoteCache : this.remoteHttpCaches)
+                for (RemoteHttpCache<? extends Serializable, ? extends Serializable> remoteCache : this.remoteHttpCaches)
                 {
-                    remoteCachesToExamine.add( (RemoteHttpCache<Serializable, Serializable>)remoteCache );
+                    remoteCachesToExamine.add( 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<Serializable, Serializable> remoteCache : remoteCachesToExamine)
+            for (RemoteHttpCache<? extends Serializable, ? extends Serializable> remoteCache : remoteCachesToExamine)
             {
                 try
                 {

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/behavior/IRemoteHttpCacheClient.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/behavior/IRemoteHttpCacheClient.java?rev=1369329&r1=1369328&r2=1369329&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/behavior/IRemoteHttpCacheClient.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/client/behavior/IRemoteHttpCacheClient.java Sat Aug  4 14:19:08 2012
@@ -3,8 +3,8 @@ package org.apache.jcs.auxiliary.remote.
 import java.io.IOException;
 import java.io.Serializable;
 
-import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheService;
 import org.apache.jcs.auxiliary.remote.http.client.RemoteHttpCacheAttributes;
+import org.apache.jcs.engine.behavior.ICacheServiceNonLocal;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -30,7 +30,7 @@ import org.apache.jcs.auxiliary.remote.h
  * This could be added to the ICacheSerice method.
  */
 public interface IRemoteHttpCacheClient<K extends Serializable, V extends Serializable>
-    extends IRemoteCacheService<K, V>
+    extends ICacheServiceNonLocal<K, V>
 {
     /**
      * The provides an extension point. If you want to extend this and use a special dispatcher,

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/AbstractRemoteCacheService.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/AbstractRemoteCacheService.java?rev=1369329&r1=1369328&r2=1369329&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/AbstractRemoteCacheService.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/AbstractRemoteCacheService.java Sat Aug  4 14:19:08 2012
@@ -26,8 +26,8 @@ import java.util.Set;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheService;
 import org.apache.jcs.engine.behavior.ICacheElement;
+import org.apache.jcs.engine.behavior.ICacheServiceNonLocal;
 import org.apache.jcs.engine.behavior.ICompositeCacheManager;
 import org.apache.jcs.engine.control.CompositeCache;
 import org.apache.jcs.engine.control.CompositeCacheManager;
@@ -40,7 +40,7 @@ import org.apache.jcs.engine.logging.beh
  * much of the RMI server to use this as well. I'm starting with the Http service.
  */
 public abstract class AbstractRemoteCacheService<K extends Serializable, V extends Serializable>
-    implements IRemoteCacheService<K, V>
+    implements ICacheServiceNonLocal<K, V>
 {
     /** An optional event logger */
     private transient ICacheEventLogger cacheEventLogger;

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteCacheServiceAdaptor.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteCacheServiceAdaptor.java?rev=1369329&r1=1369328&r2=1369329&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteCacheServiceAdaptor.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteCacheServiceAdaptor.java Sat Aug  4 14:19:08 2012
@@ -27,10 +27,10 @@ import java.util.Set;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheService;
 import org.apache.jcs.auxiliary.remote.value.RemoteCacheRequest;
 import org.apache.jcs.auxiliary.remote.value.RemoteCacheResponse;
 import org.apache.jcs.engine.behavior.ICacheElement;
+import org.apache.jcs.engine.behavior.ICacheServiceNonLocal;
 import org.apache.jcs.engine.control.CompositeCacheManager;
 
 /**
@@ -45,7 +45,7 @@ public class RemoteCacheServiceAdaptor<K
     private final static Log log = LogFactory.getLog( RemoteCacheServiceAdaptor.class );
 
     /** The service that does the work. */
-    private IRemoteCacheService<K, V> remoteCacheService;
+    private ICacheServiceNonLocal<K, V> remoteCacheService;
 
     /** This is for testing without the factory. */
     protected RemoteCacheServiceAdaptor()
@@ -60,7 +60,7 @@ public class RemoteCacheServiceAdaptor<K
      */
     public RemoteCacheServiceAdaptor( CompositeCacheManager cacheManager )
     {
-        IRemoteCacheService<K, V> rcs = RemoteHttpCacheSeviceFactory.createRemoteHttpCacheService( cacheManager );
+        ICacheServiceNonLocal<K, V> rcs = RemoteHttpCacheSeviceFactory.createRemoteHttpCacheService( cacheManager );
         setRemoteCacheService( rcs );
     }
 
@@ -163,7 +163,7 @@ public class RemoteCacheServiceAdaptor<K
     /**
      * @param remoteHttpCacheService the remoteHttpCacheService to set
      */
-    public void setRemoteCacheService( IRemoteCacheService<K, V> remoteHttpCacheService )
+    public void setRemoteCacheService( ICacheServiceNonLocal<K, V> remoteHttpCacheService )
     {
         this.remoteCacheService = remoteHttpCacheService;
     }
@@ -171,7 +171,7 @@ public class RemoteCacheServiceAdaptor<K
     /**
      * @return the remoteHttpCacheService
      */
-    public IRemoteCacheService<K, V> getRemoteCacheService()
+    public ICacheServiceNonLocal<K, V> getRemoteCacheService()
     {
         return remoteCacheService;
     }

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheServlet.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheServlet.java?rev=1369329&r1=1369328&r2=1369329&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheServlet.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheServlet.java Sat Aug  4 14:19:08 2012
@@ -23,6 +23,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.ObjectInputStream;
 import java.io.OutputStream;
+import java.io.Serializable;
 
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletException;
@@ -55,7 +56,7 @@ public class RemoteHttpCacheServlet
     private static CompositeCacheManager cacheMgr;
 
     /** Processes requests */
-    private RemoteCacheServiceAdaptor remoteHttpCacheServiceAdaptor;
+    private RemoteCacheServiceAdaptor<Serializable, Serializable> remoteHttpCacheServiceAdaptor;
 
     /** This needs to be standard, since the other side is standard */
     private final StandardSerializer serializer = new StandardSerializer();
@@ -87,7 +88,7 @@ public class RemoteHttpCacheServlet
             throw new ServletException(e);
         }
 
-        setRemoteHttpCacheServiceAdaptor( new RemoteCacheServiceAdaptor( cacheMgr ) );
+        setRemoteHttpCacheServiceAdaptor( new RemoteCacheServiceAdaptor<Serializable, Serializable>( cacheMgr ) );
 
         super.init( config );
     }
@@ -110,9 +111,9 @@ public class RemoteHttpCacheServlet
             log.debug( "Servicing a request. " + request );
         }
 
-        RemoteCacheRequest remoteRequest = readRequest( request );
+        RemoteCacheRequest<Serializable, Serializable> remoteRequest = readRequest( request );
 
-        RemoteCacheResponse cacheResponse = getRemoteHttpCacheServiceAdaptor().processRequest( remoteRequest );
+        RemoteCacheResponse<Serializable, Serializable> cacheResponse = getRemoteHttpCacheServiceAdaptor().processRequest( remoteRequest );
 
         writeResponse( response, cacheResponse );
     }
@@ -123,9 +124,9 @@ public class RemoteHttpCacheServlet
      * @param request
      * @return RemoteHttpCacheRequest
      */
-    protected RemoteCacheRequest readRequest( HttpServletRequest request )
+    protected RemoteCacheRequest<Serializable, Serializable> readRequest( HttpServletRequest request )
     {
-        RemoteCacheRequest remoteRequest = null;
+        RemoteCacheRequest<Serializable, Serializable> remoteRequest = null;
         try
         {
             InputStream inputStream = request.getInputStream();
@@ -151,13 +152,14 @@ public class RemoteHttpCacheServlet
      * @throws IOException
      * @throws ClassNotFoundException
      */
-    protected RemoteCacheRequest readRequestFromStream( InputStream inputStream )
+    @SuppressWarnings("unchecked")
+    protected RemoteCacheRequest<Serializable, Serializable> readRequestFromStream( InputStream inputStream )
         throws IOException, ClassNotFoundException
     {
-        RemoteCacheRequest remoteRequest;
+        RemoteCacheRequest<Serializable, Serializable> remoteRequest;
         ObjectInputStream ois = new ObjectInputStream( inputStream );
 
-        remoteRequest = (RemoteCacheRequest) ois.readObject();
+        remoteRequest = (RemoteCacheRequest<Serializable, Serializable>) ois.readObject();
         ois.close();
         return remoteRequest;
     }
@@ -168,7 +170,7 @@ public class RemoteHttpCacheServlet
      * @param response
      * @param cacheResponse
      */
-    protected void writeResponse( HttpServletResponse response, RemoteCacheResponse cacheResponse )
+    protected void writeResponse( HttpServletResponse response, RemoteCacheResponse<Serializable, Serializable> cacheResponse )
     {
         try
         {
@@ -247,7 +249,7 @@ public class RemoteHttpCacheServlet
     /**
      * @param remoteHttpCacheProcessor the remoteHttpCacheProcessor to set
      */
-    public void setRemoteHttpCacheServiceAdaptor( RemoteCacheServiceAdaptor remoteHttpCacheProcessor )
+    public void setRemoteHttpCacheServiceAdaptor( RemoteCacheServiceAdaptor<Serializable, Serializable> remoteHttpCacheProcessor )
     {
         this.remoteHttpCacheServiceAdaptor = remoteHttpCacheProcessor;
     }
@@ -255,7 +257,7 @@ public class RemoteHttpCacheServlet
     /**
      * @return the remoteHttpCacheProcessor
      */
-    public RemoteCacheServiceAdaptor getRemoteHttpCacheServiceAdaptor()
+    public RemoteCacheServiceAdaptor<Serializable, Serializable> getRemoteHttpCacheServiceAdaptor()
     {
         return remoteHttpCacheServiceAdaptor;
     }

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServer.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServer.java?rev=1369329&r1=1369328&r2=1369329&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServer.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServer.java Sat Aug  4 14:19:08 2012
@@ -34,7 +34,6 @@ import org.apache.jcs.access.exception.C
 import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheAttributes;
 import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheListener;
 import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheObserver;
-import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheService;
 import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheServiceAdmin;
 import org.apache.jcs.auxiliary.remote.server.behavior.IRemoteCacheServerAttributes;
 import org.apache.jcs.engine.CacheEventQueueFactory;
@@ -42,6 +41,7 @@ import org.apache.jcs.engine.CacheListen
 import org.apache.jcs.engine.behavior.ICacheElement;
 import org.apache.jcs.engine.behavior.ICacheEventQueue;
 import org.apache.jcs.engine.behavior.ICacheListener;
+import org.apache.jcs.engine.behavior.ICacheServiceNonLocal;
 import org.apache.jcs.engine.control.CompositeCache;
 import org.apache.jcs.engine.control.CompositeCacheManager;
 import org.apache.jcs.engine.logging.CacheEvent;
@@ -65,7 +65,7 @@ import org.apache.jcs.engine.logging.beh
  */
 public class RemoteCacheServer<K extends Serializable, V extends Serializable>
     extends UnicastRemoteObject
-    implements IRemoteCacheService<K, V>, IRemoteCacheObserver, IRemoteCacheServiceAdmin, Unreferenced
+    implements ICacheServiceNonLocal<K, V>, IRemoteCacheObserver, IRemoteCacheServiceAdmin, Unreferenced
 {
     /** For serialization. Don't change. */
     private static final long serialVersionUID = -8072345435941473116L;
@@ -502,6 +502,8 @@ public class RemoteCacheServer<K extends
     private ICacheElement<K, V> getFromCacheListeners( K key, boolean fromCluster, CacheListeners<K, V> cacheDesc,
                                                  ICacheElement<K, V> element )
     {
+        ICacheElement<K, V> returnElement = element;
+
         if ( cacheDesc != null )
         {
             CompositeCache<K, V> c = (CompositeCache<K, V>) cacheDesc.cache;
@@ -527,7 +529,7 @@ public class RemoteCacheServer<K extends
                     log.debug( "NonLocalGet. fromCluster [" + fromCluster + "] AllowClusterGet ["
                         + this.remoteCacheServerAttributes.getAllowClusterGet() + "]" );
                 }
-                element = c.get( key );
+                returnElement = c.get( key );
             }
             else
             {
@@ -540,10 +542,11 @@ public class RemoteCacheServer<K extends
                     log.debug( "LocalGet.  fromCluster [" + fromCluster + "] AllowClusterGet ["
                         + this.remoteCacheServerAttributes.getAllowClusterGet() + "]" );
                 }
-                element = c.localGet( key );
+                returnElement = c.localGet( key );
             }
         }
-        return element;
+
+        return returnElement;
     }
 
     /**
@@ -774,6 +777,8 @@ public class RemoteCacheServer<K extends
      */
     private Map<K, ICacheElement<K, V>> getMultipleFromCacheListeners( Set<K> keys, Map<K, ICacheElement<K, V>> elements, boolean fromCluster, CacheListeners<K, V> cacheDesc )
     {
+        Map<K, ICacheElement<K, V>> returnElements = elements;
+
         if ( cacheDesc != null )
         {
             CompositeCache<K, V> c = (CompositeCache<K, V>) cacheDesc.cache;
@@ -800,7 +805,7 @@ public class RemoteCacheServer<K extends
                         + this.remoteCacheServerAttributes.getAllowClusterGet() + "]" );
                 }
 
-                elements = c.getMultiple( keys );
+                returnElements = c.getMultiple( keys );
             }
             else
             {
@@ -814,10 +819,11 @@ public class RemoteCacheServer<K extends
                         + this.remoteCacheServerAttributes.getAllowClusterGet() + "]" );
                 }
 
-                elements = c.localGetMultiple( keys );
+                returnElements = c.localGetMultiple( keys );
             }
         }
-        return elements;
+
+        return returnElements;
     }
 
     /**
@@ -1217,6 +1223,7 @@ public class RemoteCacheServer<K extends
      * @param requesterId
      * @return The eventQList value
      */
+    @SuppressWarnings("unchecked")
     private ICacheEventQueue<K, V>[] getEventQList( CacheListeners<K, V> cacheListeners, long requesterId )
     {
         ICacheEventQueue<K, V>[] list = null;
@@ -1295,6 +1302,7 @@ public class RemoteCacheServer<K extends
      *            remote calls involved.
      * @throws IOException
      */
+    @SuppressWarnings("unchecked")
     public <KK extends Serializable, VV extends Serializable> void addCacheListener( String cacheName, ICacheListener<KK, VV> listener )
         throws IOException
     {

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerFactory.java?rev=1369329&r1=1369328&r2=1369329&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerFactory.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerFactory.java Sat Aug  4 14:19:08 2012
@@ -20,13 +20,13 @@ package org.apache.jcs.auxiliary.remote.
  */
 
 import java.io.IOException;
+import java.io.Serializable;
 import java.net.MalformedURLException;
 import java.rmi.Naming;
 import java.rmi.NotBoundException;
 import java.rmi.RemoteException;
 import java.rmi.registry.LocateRegistry;
 import java.rmi.registry.Registry;
-import java.rmi.server.RMIClientSocketFactory;
 import java.rmi.server.RMISocketFactory;
 import java.util.Properties;
 import java.util.concurrent.Executors;
@@ -55,7 +55,7 @@ public class RemoteCacheServerFactory
     private final static Log log = LogFactory.getLog( RemoteCacheServerFactory.class );
 
     /** The single instance of the RemoteCacheServer object. */
-    private static RemoteCacheServer remoteCacheServer;
+    private static RemoteCacheServer<? extends Serializable, ? extends Serializable> remoteCacheServer;
 
     /** The name of the service. */
     private static String serviceName = IRemoteCacheConstants.REMOTE_CACHE_SERVICE_VAL;
@@ -76,9 +76,10 @@ public class RemoteCacheServerFactory
      * A remote cache is either a local cache or a cluster cache. <p.
      * @return Returns the remoteCacheServer.
      */
-    public static RemoteCacheServer getRemoteCacheServer()
+    @SuppressWarnings("unchecked")
+    public static <K extends Serializable, V extends Serializable> RemoteCacheServer<K, V> getRemoteCacheServer()
     {
-        return remoteCacheServer;
+        return (RemoteCacheServer<K, V>)remoteCacheServer;
     }
 
     // ///////////////////// Startup/shutdown methods. //////////////////
@@ -137,11 +138,11 @@ public class RemoteCacheServerFactory
             // CREATE SERVER
             if ( customRMISocketFactory != null )
             {
-                remoteCacheServer = new RemoteCacheServer( rcsa, customRMISocketFactory );
+                remoteCacheServer = new RemoteCacheServer<Serializable, Serializable>( rcsa, customRMISocketFactory );
             }
             else
             {
-                remoteCacheServer = new RemoteCacheServer( rcsa );
+                remoteCacheServer = new RemoteCacheServer<Serializable, Serializable>( rcsa );
             }
             remoteCacheServer.setCacheEventLogger( cacheEventLogger );
 
@@ -194,8 +195,8 @@ public class RemoteCacheServerFactory
      */
     protected static RMISocketFactory configureObjectSpecificCustomFactory( Properties props )
     {
-        RMISocketFactory customRMISocketFactory = (RMISocketFactory) OptionConverter
-            .instantiateByKey( props, CUSTOM_RMI_SOCKET_FACTORY_PROPERTY_PREFIX, RMIClientSocketFactory.class, null );
+        RMISocketFactory customRMISocketFactory =
+            OptionConverter.instantiateByKey( props, CUSTOM_RMI_SOCKET_FACTORY_PROPERTY_PREFIX, null );
 
         if ( customRMISocketFactory != null )
         {

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/CacheEventQueue.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/CacheEventQueue.java?rev=1369329&r1=1369328&r2=1369329&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/CacheEventQueue.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/CacheEventQueue.java Sat Aug  4 14:19:08 2012
@@ -325,6 +325,7 @@ public class CacheEventQueue<K extends S
 
             Node node = head.next;
 
+            @SuppressWarnings("unchecked")
             AbstractCacheEvent value = (AbstractCacheEvent) node.event;
 
             if ( log.isDebugEnabled() )

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/CacheEventQueueFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/CacheEventQueueFactory.java?rev=1369329&r1=1369328&r2=1369329&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/CacheEventQueueFactory.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/CacheEventQueueFactory.java Sat Aug  4 14:19:08 2012
@@ -87,8 +87,7 @@ public class CacheEventQueueFactory<K ex
         }
         else
         {
-            eventQueue = (ICacheEventQueue<K, V>) OptionConverter.instantiateByClassName( poolType, ICacheEventQueue.class,
-                                                                                    null );
+            eventQueue = OptionConverter.instantiateByClassName( poolType, null );
             if ( eventQueue != null )
             {
                 if ( log.isInfoEnabled() )

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/ZombieCacheServiceNonLocal.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/ZombieCacheServiceNonLocal.java?rev=1369329&r1=1369328&r2=1369329&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/ZombieCacheServiceNonLocal.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/ZombieCacheServiceNonLocal.java Sat Aug  4 14:19:08 2012
@@ -211,11 +211,13 @@ public class ZombieCacheServiceNonLocal<
 
             if ( event instanceof PutEvent )
             {
+                @SuppressWarnings("unchecked")
                 PutEvent<K, V> putEvent = (PutEvent<K, V>) event;
                 service.update( putEvent.element, event.requesterId );
             }
             else if ( event instanceof RemoveEvent )
             {
+                @SuppressWarnings("unchecked")
                 RemoveEvent<K, V> removeEvent = (RemoveEvent<K, V>) event;
                 service.remove( event.cacheName, removeEvent.key, event.requesterId );
             }

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/control/CompositeCache.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/control/CompositeCache.java?rev=1369329&r1=1369328&r2=1369329&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/control/CompositeCache.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/control/CompositeCache.java Sat Aug  4 14:19:08 2012
@@ -1614,7 +1614,9 @@ public class CompositeCache<K extends Se
             try
             {
                 Class<?> c = Class.forName( cattr.getMemoryCacheName() );
-                memCache = (IMemoryCache<K, V>) c.newInstance();
+                @SuppressWarnings("unchecked")
+                IMemoryCache<K, V> newInstance = (IMemoryCache<K, V>) c.newInstance();
+                memCache = newInstance;
                 memCache.initialize( this );
             }
             catch ( Exception e )

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/control/CompositeCacheConfigurator.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/control/CompositeCacheConfigurator.java?rev=1369329&r1=1369328&r2=1369329&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/control/CompositeCacheConfigurator.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/control/CompositeCacheConfigurator.java Sat Aug  4 14:19:08 2012
@@ -377,8 +377,9 @@ public class CompositeCacheConfigurator
             }
 
             // Associate the auxiliaries with the cache
-
-            cache.setAuxCaches( auxList.toArray( new AuxiliaryCache[0] ) );
+            @SuppressWarnings("unchecked")
+            AuxiliaryCache<K, V>[] auxArray = auxList.toArray( new AuxiliaryCache[0] );
+            cache.setAuxCaches( auxArray );
         }
 
         // Return the new cache
@@ -414,8 +415,7 @@ public class CompositeCacheConfigurator
 
         // auxFactory was not previously initialized.
         // String prefix = regionPrefix + regName + ATTRIBUTE_PREFIX;
-        ccAttr = (ICompositeCacheAttributes) OptionConverter
-            .instantiateByKey( props, attrName, org.apache.jcs.engine.behavior.ICompositeCacheAttributes.class, null );
+        ccAttr = OptionConverter.instantiateByKey( props, attrName, null );
 
         if ( ccAttr == null )
         {
@@ -463,8 +463,7 @@ public class CompositeCacheConfigurator
 
         // auxFactory was not previously initialized.
         // String prefix = regionPrefix + regName + ATTRIBUTE_PREFIX;
-        eAttr = (IElementAttributes) OptionConverter
-            .instantiateByKey( props, attrName, org.apache.jcs.engine.behavior.IElementAttributes.class, null );
+        eAttr = OptionConverter.instantiateByKey( props, attrName, null );
         if ( eAttr == null )
         {
             if ( log.isInfoEnabled() )
@@ -520,8 +519,7 @@ public class CompositeCacheConfigurator
         {
             // auxFactory was not previously initialized.
             String prefix = AUXILIARY_PREFIX + auxName;
-            auxFac = (AuxiliaryCacheFactory) OptionConverter
-                .instantiateByKey( props, prefix, org.apache.jcs.auxiliary.AuxiliaryCacheFactory.class, null );
+            auxFac = OptionConverter.instantiateByKey( props, prefix, null );
             if ( auxFac == null )
             {
                 log.error( "Could not instantiate auxFactory named \"" + auxName + "\"." );
@@ -540,8 +538,7 @@ public class CompositeCacheConfigurator
         {
             // auxFactory was not previously initialized.
             String prefix = AUXILIARY_PREFIX + auxName + ATTRIBUTE_PREFIX;
-            auxAttr = (AuxiliaryCacheAttributes) OptionConverter
-                .instantiateByKey( props, prefix, org.apache.jcs.auxiliary.AuxiliaryCacheAttributes.class, null );
+            auxAttr = OptionConverter.instantiateByKey( props, prefix, null );
             if ( auxAttr == null )
             {
                 log.error( "Could not instantiate auxAttr named '" + attrName + "'" );
@@ -599,13 +596,10 @@ public class CompositeCacheConfigurator
      */
     public static <K extends Serializable> IKeyMatcher<K> parseKeyMatcher( Properties props, String auxPrefix )
     {
-        IKeyMatcher<K> keyMatcher = null;
 
         // auxFactory was not previously initialized.
         String keyMatcherClassName = auxPrefix + KEY_MATCHER_PREFIX;
-        keyMatcher = (IKeyMatcher<K>) OptionConverter
-            .instantiateByKey( props, keyMatcherClassName,
-                               IKeyMatcher.class, null );
+        IKeyMatcher<K> keyMatcher = OptionConverter.instantiateByKey( props, keyMatcherClassName, null );
         if ( keyMatcher != null )
         {
             String attributePrefix = auxPrefix + KEY_MATCHER_PREFIX + ATTRIBUTE_PREFIX;

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/control/event/ElementEventQueue.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/control/event/ElementEventQueue.java?rev=1369329&r1=1369328&r2=1369329&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/control/event/ElementEventQueue.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/control/event/ElementEventQueue.java Sat Aug  4 14:19:08 2012
@@ -33,6 +33,9 @@ import org.apache.jcs.engine.control.eve
 public class ElementEventQueue
     implements IElementEventQueue
 {
+    /** serial version */
+    private static final long serialVersionUID = -2966341524571838475L;
+
     /** The logger */
     protected final static Log log = LogFactory.getLog( ElementEventQueue.class );
 

Copied: commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/memory/AbstractDoubleLinkedListMemoryCache.java (from r1344803, commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/memory/AbstractDoulbeLinkedListMemoryCache.java)
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/memory/AbstractDoubleLinkedListMemoryCache.java?p2=commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/memory/AbstractDoubleLinkedListMemoryCache.java&p1=commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/memory/AbstractDoulbeLinkedListMemoryCache.java&r1=1344803&r2=1369329&rev=1369329&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/memory/AbstractDoulbeLinkedListMemoryCache.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/memory/AbstractDoubleLinkedListMemoryCache.java Sat Aug  4 14:19:08 2012
@@ -31,14 +31,14 @@ import org.apache.jcs.utils.struct.Doubl
  * the list will be the one removed when the list fills. For instance LRU should more items to the
  * front as they are used. FIFO should simply add new items to the front of the list.
  */
-public abstract class AbstractDoulbeLinkedListMemoryCache<K extends Serializable, V extends Serializable>
+public abstract class AbstractDoubleLinkedListMemoryCache<K extends Serializable, V extends Serializable>
     extends AbstractMemoryCache<K, V>
 {
     /** Don't change. */
     private static final long serialVersionUID = 1422569420563967389L;
 
     /** The logger. */
-    private final static Log log = LogFactory.getLog( AbstractDoulbeLinkedListMemoryCache.class );
+    private final static Log log = LogFactory.getLog( AbstractDoubleLinkedListMemoryCache.class );
 
     /** thread-safe double linked list for lru */
     protected DoubleLinkedList<MemoryElementDescriptor<K, V>> list;
@@ -419,6 +419,7 @@ public abstract class AbstractDoulbeLink
     /**
      * Dump the cache entries from first to list for debugging.
      */
+    @SuppressWarnings("unchecked")
     public void dumpCacheEntries()
     {
         log.debug( "dumpingCacheEntries" );
@@ -442,6 +443,7 @@ public abstract class AbstractDoulbeLink
      * Checks to see if all the items that should be in the cache are. Checks consistency between
      * List and map.
      */
+    @SuppressWarnings("unchecked")
     protected void verifyCache()
     {
         if ( !log.isDebugEnabled() )
@@ -524,6 +526,7 @@ public abstract class AbstractDoulbeLink
      * <p>
      * @param key
      */
+    @SuppressWarnings("unchecked")
     private void verifyCache( K key )
     {
         if ( !log.isDebugEnabled() )

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/memory/AbstractMemoryCache.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/memory/AbstractMemoryCache.java?rev=1369329&r1=1369328&r2=1369329&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/memory/AbstractMemoryCache.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/memory/AbstractMemoryCache.java Sat Aug  4 14:19:08 2012
@@ -65,7 +65,7 @@ public abstract class AbstractMemoryCach
     protected String cacheName;
 
     /** Map where items are stored by key.  This is created by the concrete child class. */
-    protected Map<K, MemoryElementDescriptor<K, V>> map;
+    public Map<K, MemoryElementDescriptor<K, V>> map;
 
     /** Region Elemental Attributes, used as a default and copied for each item. */
     public IElementAttributes elementAttributes;
@@ -74,7 +74,7 @@ public abstract class AbstractMemoryCach
     public ICompositeCacheAttributes cacheAttributes;
 
     /** The cache region this store is associated with */
-    protected CompositeCache<K, V> cache;
+    public CompositeCache<K, V> cache;
 
     /** status */
     protected int status;

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/memory/fifo/FIFOMemoryCache.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/memory/fifo/FIFOMemoryCache.java?rev=1369329&r1=1369328&r2=1369329&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/memory/fifo/FIFOMemoryCache.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/memory/fifo/FIFOMemoryCache.java Sat Aug  4 14:19:08 2012
@@ -23,14 +23,14 @@ import java.io.IOException;
 import java.io.Serializable;
 
 import org.apache.jcs.engine.behavior.ICacheElement;
-import org.apache.jcs.engine.memory.AbstractDoulbeLinkedListMemoryCache;
+import org.apache.jcs.engine.memory.AbstractDoubleLinkedListMemoryCache;
 import org.apache.jcs.engine.memory.util.MemoryElementDescriptor;
 
 /**
  * The items are spooled in the order they are added. No adjustments to the list are made on get.
  */
 public class FIFOMemoryCache<K extends Serializable, V extends Serializable>
-    extends AbstractDoulbeLinkedListMemoryCache<K, V>
+    extends AbstractDoubleLinkedListMemoryCache<K, V>
 {
     /** Don't change */
     private static final long serialVersionUID = 6403738094136424201L;

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/memory/lru/LRUMemoryCache.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/memory/lru/LRUMemoryCache.java?rev=1369329&r1=1369328&r2=1369329&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/memory/lru/LRUMemoryCache.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/memory/lru/LRUMemoryCache.java Sat Aug  4 14:19:08 2012
@@ -23,7 +23,7 @@ import java.io.IOException;
 import java.io.Serializable;
 
 import org.apache.jcs.engine.behavior.ICacheElement;
-import org.apache.jcs.engine.memory.AbstractDoulbeLinkedListMemoryCache;
+import org.apache.jcs.engine.memory.AbstractDoubleLinkedListMemoryCache;
 import org.apache.jcs.engine.memory.util.MemoryElementDescriptor;
 
 /**
@@ -38,7 +38,7 @@ import org.apache.jcs.engine.memory.util
  * the better the chance that this will be the case. < .04 ms per put, p3 866, 1/10 of that per get
  */
 public class LRUMemoryCache<K extends Serializable, V extends Serializable>
-    extends AbstractDoulbeLinkedListMemoryCache<K, V>
+    extends AbstractDoubleLinkedListMemoryCache<K, V>
 {
     /** Don't change */
     private static final long serialVersionUID = 6403738094136424201L;

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/memory/mru/MRUMemoryCache.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/memory/mru/MRUMemoryCache.java?rev=1369329&r1=1369328&r2=1369329&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/memory/mru/MRUMemoryCache.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/memory/mru/MRUMemoryCache.java Sat Aug  4 14:19:08 2012
@@ -23,7 +23,7 @@ import java.io.IOException;
 import java.io.Serializable;
 
 import org.apache.jcs.engine.behavior.ICacheElement;
-import org.apache.jcs.engine.memory.AbstractDoulbeLinkedListMemoryCache;
+import org.apache.jcs.engine.memory.AbstractDoubleLinkedListMemoryCache;
 import org.apache.jcs.engine.memory.util.MemoryElementDescriptor;
 
 /**
@@ -31,7 +31,7 @@ import org.apache.jcs.engine.memory.util
  * hub is configured to use a disk cache.
  */
 public class MRUMemoryCache<K extends Serializable, V extends Serializable>
-    extends AbstractDoulbeLinkedListMemoryCache<K, V>
+    extends AbstractDoubleLinkedListMemoryCache<K, V>
 {
     /** Don't change */
     private static final long serialVersionUID = 5013101678192336129L;

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/access/JCSWorker.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/access/JCSWorker.java?rev=1369329&r1=1369328&r2=1369329&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/access/JCSWorker.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/access/JCSWorker.java Sat Aug  4 14:19:08 2012
@@ -255,7 +255,9 @@ public class JCSWorker<K extends Seriali
             // If the cache dosn't have it, do the work.
             if ( result == null )
             {
-                result = (V)aHelper.doWork();
+                @SuppressWarnings("unchecked")
+                V doWork = (V)aHelper.doWork();
+                result = doWork;
                 if ( logger.isDebugEnabled() )
                 {
                     logger.debug( "Work Done, caching: key:" + aKey + ", group:" + aGroup + ", result:" + result + "." );

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/config/OptionConverter.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/config/OptionConverter.java?rev=1369329&r1=1369328&r2=1369329&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/config/OptionConverter.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/config/OptionConverter.java Sat Aug  4 14:19:08 2012
@@ -158,11 +158,10 @@ public class OptionConverter
      * <p>
      * @param props
      * @param key
-     * @param superClass
      * @param defaultValue
      * @return Object that was created
      */
-    public static Object instantiateByKey( Properties props, String key, Class<?> superClass, Object defaultValue )
+    public static <T> T instantiateByKey( Properties props, String key, T defaultValue )
     {
 
         // Get the value of the property in string form
@@ -176,7 +175,7 @@ public class OptionConverter
             return defaultValue;
         }
         // Trim className to avoid trailing spaces that cause problems.
-        return OptionConverter.instantiateByClassName( className.trim(), superClass, defaultValue );
+        return OptionConverter.instantiateByClassName( className.trim(), defaultValue );
     }
 
     /**
@@ -312,25 +311,30 @@ public class OptionConverter
      * <code>defaultValue</code> is returned.
      * <p>
      * @param className The fully qualified class name of the object to instantiate.
-     * @param superClass The class to which the new object should belong.
      * @param defaultValue The object to return in case of non-fulfillment
      * @return instantiated object
      */
 
-    public static Object instantiateByClassName( String className, Class<?> superClass, Object defaultValue )
+    public static <T> T instantiateByClassName( String className, T defaultValue )
     {
         if ( className != null )
         {
             try
             {
                 Class<?> classObj = Class.forName( className );
-                if ( !superClass.isAssignableFrom( classObj ) )
+                Object o = classObj.newInstance();
+
+                try
+                {
+                    @SuppressWarnings("unchecked")
+                    T t = (T) o;
+                    return t;
+                }
+                catch (ClassCastException e)
                 {
-                    log.error( "A \"" + className + "\" object is not assignable to a \"" + superClass.getName()
-                        + "\" variable." );
+                    log.error( "A \"" + className + "\" object is not assignable to the generic variable." );
                     return defaultValue;
                 }
-                return classObj.newInstance();
             }
             catch ( Exception e )
             {

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/discovery/UDPDiscoverySenderThread.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/discovery/UDPDiscoverySenderThread.java?rev=1369329&r1=1369328&r2=1369329&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/discovery/UDPDiscoverySenderThread.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/discovery/UDPDiscoverySenderThread.java Sat Aug  4 14:19:08 2012
@@ -143,13 +143,16 @@ public class UDPDiscoverySenderThread
         }
         finally
         {
-            try
+            if (sender != null)
             {
-                sender.destroy();
-            }
-            catch ( Exception e )
-            {
-                log.error( "Problem closing Passive Broadcast sender", e );
+                try
+                {
+                    sender.destroy();
+                }
+                catch ( Exception e )
+                {
+                    log.error( "Problem closing Passive Broadcast sender", e );
+                }
             }
         }
     }

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/discovery/UDPDiscoveryService.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/discovery/UDPDiscoveryService.java?rev=1369329&r1=1369328&r2=1369329&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/discovery/UDPDiscoveryService.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/discovery/UDPDiscoveryService.java Sat Aug  4 14:19:08 2012
@@ -52,7 +52,7 @@ public class UDPDiscoveryService
     private final static Log log = LogFactory.getLog( UDPDiscoveryService.class );
 
     /** The background broadcaster. */
-    private static ScheduledExecutorService senderDaemon;
+    private static volatile ScheduledExecutorService senderDaemon;
 
     /** thread that listens for messages */
     private Thread udpReceiverThread;

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/props/PropertyLoader.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/props/PropertyLoader.java?rev=1369329&r1=1369328&r2=1369329&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/props/PropertyLoader.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/props/PropertyLoader.java Sat Aug  4 14:19:08 2012
@@ -85,19 +85,18 @@ public abstract class PropertyLoader
         if ( name == null )
             throw new IllegalArgumentException( "null input: name" );
 
-        if ( name.startsWith( "/" ) )
-        {
-            name = name.substring( 1 );
-        }
+        ClassLoader classLoader = ( loader == null ) ? ClassLoader.getSystemClassLoader() : loader;
+
+        String fileName = name.startsWith( "/" ) ? name.substring( 1 ) : name;
 
-        if ( name.endsWith( SUFFIX ) )
+        if ( fileName.endsWith( SUFFIX ) )
         {
-            name = name.substring( 0, name.length() - SUFFIX.length() );
+            fileName = fileName.substring( 0, fileName.length() - SUFFIX.length() );
         }
 
-        if ( name.endsWith( SUFFIX_PROPERTIES ) )
+        if ( fileName.endsWith( SUFFIX_PROPERTIES ) )
         {
-            name = name.substring( 0, name.length() - SUFFIX_PROPERTIES.length() );
+            fileName = fileName.substring( 0, fileName.length() - SUFFIX_PROPERTIES.length() );
             isCCFSuffix = false;
         }
 
@@ -106,24 +105,19 @@ public abstract class PropertyLoader
         InputStream in = null;
         try
         {
-            if ( loader == null )
-            {
-                loader = ClassLoader.getSystemClassLoader();
-            }
-
-            name = name.replace( '.', '/' );
+            fileName = fileName.replace( '.', '/' );
 
-            if ( !name.endsWith( SUFFIX ) && isCCFSuffix )
+            if ( !fileName.endsWith( SUFFIX ) && isCCFSuffix )
             {
-                name = name.concat( SUFFIX );
+                fileName = fileName.concat( SUFFIX );
             }
-            else if ( !name.endsWith( SUFFIX_PROPERTIES ) && !isCCFSuffix )
+            else if ( !fileName.endsWith( SUFFIX_PROPERTIES ) && !isCCFSuffix )
             {
-                name = name.concat( SUFFIX_PROPERTIES );
+                fileName = fileName.concat( SUFFIX_PROPERTIES );
             }
 
             // returns null on lookup failures:
-            in = loader.getResourceAsStream( name );
+            in = classLoader.getResourceAsStream( fileName );
             if ( in != null )
             {
                 result = new Properties();
@@ -149,7 +143,7 @@ public abstract class PropertyLoader
 
         if ( THROW_ON_LOAD_FAILURE && ( result == null ) )
         {
-            throw new IllegalArgumentException( "could not load [" + name + "]" + " as " + "a classloader resource" );
+            throw new IllegalArgumentException( "could not load [" + fileName + "]" + " as " + "a classloader resource" );
         }
 
         return result;

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/serialization/CompressingSerializer.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/serialization/CompressingSerializer.java?rev=1369329&r1=1369328&r2=1369329&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/serialization/CompressingSerializer.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/serialization/CompressingSerializer.java Sat Aug  4 14:19:08 2012
@@ -114,7 +114,9 @@ public class CompressingSerializer
         {
             try
             {
-                return (T) ois.readObject();
+                @SuppressWarnings("unchecked")
+                T readObject = (T) ois.readObject();
+                return readObject;
             }
             catch ( IOException e )
             {

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/serialization/StandardSerializer.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/serialization/StandardSerializer.java?rev=1369329&r1=1369328&r2=1369329&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/serialization/StandardSerializer.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/serialization/StandardSerializer.java Sat Aug  4 14:19:08 2012
@@ -79,7 +79,9 @@ public class StandardSerializer
         {
             try
             {
-                return (T) ois.readObject();
+                @SuppressWarnings("unchecked")
+                T readObject = (T) ois.readObject();
+                return readObject;
             }
             catch ( IOException e )
             {

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/struct/DoubleLinkedList.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/struct/DoubleLinkedList.java?rev=1369329&r1=1369328&r2=1369329&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/struct/DoubleLinkedList.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/struct/DoubleLinkedList.java Sat Aug  4 14:19:08 2012
@@ -26,6 +26,7 @@ import org.apache.commons.logging.LogFac
  * This is a generic thread safe double linked list. It's very simple and all the operations are so
  * quick that course grained synchronization is more than acceptable.
  */
+@SuppressWarnings({ "unchecked", "rawtypes" })
 public class DoubleLinkedList<T extends DoubleLinkedListNode>
 {
     /** record size to avoid having to iterate */



Mime
View raw message