commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t.@apache.org
Subject svn commit: r1156345 - in /commons/proper/jcs/trunk/src/java/org/apache/jcs: access/ auxiliary/disk/ auxiliary/disk/block/ auxiliary/disk/indexed/ auxiliary/disk/jdbc/ auxiliary/lateral/ auxiliary/lateral/socket/tcp/ auxiliary/remote/ auxiliary/remote/...
Date Wed, 10 Aug 2011 20:06:44 GMT
Author: tv
Date: Wed Aug 10 20:06:42 2011
New Revision: 1156345

URL: http://svn.apache.org/viewvc?rev=1156345&view=rev
Log:
Fix problems reported by PMD and FindBugs
- lock release
- unnecessary return statements
- static inner classes
- improve code re-use

Added:
    commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/AbstractCacheEventQueue.java   (with props)
Modified:
    commons/proper/jcs/trunk/src/java/org/apache/jcs/access/PartitionedCacheAccess.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/AbstractDiskCache.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/block/BlockDiskCache.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/block/BlockDiskKeyStore.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCache.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManagerAbstractTemplate.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCache.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheNoWait.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPListener.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbsractRemoteCacheListener.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/AbstractRemoteAuxiliaryCache.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheFailoverRunner.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheManager.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheNoWait.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/http/server/AbstractRemoteCacheService.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServer.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerFactory.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/CacheEventQueue.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/PooledCacheEventQueue.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/ZombieCacheService.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/ZombieCacheServiceNonLocal.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/ZombieCacheWatch.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/control/CompositeCache.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/control/event/behavior/IElementEventQueue.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/memory/AbstractMemoryCache.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/discovery/UDPDiscoveryReceiver.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/discovery/UDPDiscoveryService.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/struct/DoubleLinkedList.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/struct/LRUMap.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/struct/SortedPreferentialArray.java
    commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/threadpool/ThreadPoolManager.java

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/access/PartitionedCacheAccess.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/access/PartitionedCacheAccess.java?rev=1156345&r1=1156344&r2=1156345&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/access/PartitionedCacheAccess.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/access/PartitionedCacheAccess.java Wed Aug 10 20:06:42 2011
@@ -171,7 +171,7 @@ public class PartitionedCacheAccess<K, V
     {
         if ( key == null )
         {
-            log.warn( "Bad input key [" + key + "]." );
+            log.warn( "Input key is null." );
             return null;
         }
         try
@@ -200,7 +200,7 @@ public class PartitionedCacheAccess<K, V
     {
         if ( key == null )
         {
-            log.warn( "Bad input key [" + key + "]." );
+            log.warn( "Input key is null." );
             return null;
         }
         try
@@ -269,7 +269,7 @@ public class PartitionedCacheAccess<K, V
     {
         if ( pattern == null )
         {
-            log.warn( "Bad input keypattern [" + pattern + "]." );
+            log.warn( "Input pattern is null." );
             return null;
         }
         try
@@ -301,7 +301,7 @@ public class PartitionedCacheAccess<K, V
     {
         if ( pattern == null )
         {
-            log.warn( "Bad input keypattern [" + pattern + "]." );
+            log.warn( "Input pattern is null." );
             return null;
         }
         try
@@ -350,7 +350,7 @@ public class PartitionedCacheAccess<K, V
     {
         if ( key == null )
         {
-            log.warn( "Bad input key [" + key + "].  Cannot remove null from the cache." );
+            log.warn( "Input key is null. Cannot remove null from the cache." );
             return;
         }
         ensureInit();
@@ -440,7 +440,7 @@ public class PartitionedCacheAccess<K, V
     {
         if ( key == null )
         {
-            log.warn( "Bad input key [" + key + "].  Cannot getElementAttributes for null from the cache." );
+            log.warn( "Input key is null. Cannot getElementAttributes for null from the cache." );
             return null;
         }
         ensureInit();
@@ -481,7 +481,7 @@ public class PartitionedCacheAccess<K, V
     {
         if ( key == null )
         {
-            log.warn( "Bad input key [" + key + "].  Cannot resetElementAttributes for null." );
+            log.warn( "Input key is null. Cannot resetElementAttributes for null." );
             return;
         }
         ensureInit();

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/AbstractDiskCache.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/AbstractDiskCache.java?rev=1156345&r1=1156344&r2=1156345&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/AbstractDiskCache.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/AbstractDiskCache.java Wed Aug 10 20:06:42 2011
@@ -659,29 +659,34 @@ public abstract class AbstractDiskCache
                         // always win
                         removeAllLock.readLock().lock();
 
-                        // TODO consider changing purgatory sync
-                        // String keyAsString = element.getKey().toString();
-                        synchronized ( purgatory )
+                        try
                         {
-                            // If the element has already been removed from
-                            // purgatory do nothing
-                            if ( !purgatory.containsKey( pe.getKey() ) )
+                            // TODO consider changing purgatory sync
+                            // String keyAsString = element.getKey().toString();
+                            synchronized ( purgatory )
                             {
-                                return;
+                                // If the element has already been removed from
+                                // purgatory do nothing
+                                if ( !purgatory.containsKey( pe.getKey() ) )
+                                {
+                                    return;
+                                }
+
+                                element = pe.getCacheElement();
                             }
 
-                            element = pe.getCacheElement();
+                            // I took this out of the purgatory sync block.
+                            // If the element is still eligible, spool it.
+                            if ( pe.isSpoolable() )
+                            {
+                                doUpdate( element );
+                            }
                         }
-
-                        // I took this out of the purgatory sync block.
-                        // If the element is still eligible, spool it.
-                        if ( pe.isSpoolable() )
+                        finally
                         {
-                            doUpdate( element );
+                            removeAllLock.readLock().unlock();
                         }
 
-                        removeAllLock.readLock().unlock();
-
                         synchronized ( purgatory )
                         {
                             // After the update has completed, it is safe to

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/block/BlockDiskCache.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/block/BlockDiskCache.java?rev=1156345&r1=1156344&r2=1156345&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/block/BlockDiskCache.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/block/BlockDiskCache.java Wed Aug 10 20:06:42 2011
@@ -396,7 +396,7 @@ public class BlockDiskCache
         }
         catch ( Exception e )
         {
-            log.error( logCacheName + "Failure updating element, key: " + element.getKey() + " old: " + old, e );
+            log.error( logCacheName + "Failure updating element, key: " + element.getKey() + " old: " + Arrays.toString(old), e );
         }
         if ( log.isDebugEnabled() )
         {

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/block/BlockDiskKeyStore.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/block/BlockDiskKeyStore.java?rev=1156345&r1=1156344&r2=1156345&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/block/BlockDiskKeyStore.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/block/BlockDiskKeyStore.java Wed Aug 10 20:06:42 2011
@@ -405,7 +405,7 @@ public class BlockDiskKeyStore
         }
 
         /**
-         * This is called when the may key size is reaced. The least recently used item will be
+         * This is called when the may key size is reached. The least recently used item will be
          * passed here. We will store the position and size of the spot on disk in the recycle bin.
          * <p>
          * @param key
@@ -427,7 +427,7 @@ public class BlockDiskKeyStore
      * Allows us to set the daemon status on the clockdaemon
      * @author aaronsm
      */
-    class MyThreadFactory
+    protected static class MyThreadFactory
         implements ThreadFactory
     {
 

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCache.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCache.java?rev=1156345&r1=1156344&r2=1156345&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCache.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCache.java Wed Aug 10 20:06:42 2011
@@ -313,13 +313,13 @@ public class IndexedDiskCache
     protected void loadKeys()
         throws InterruptedException
     {
-        storageLock.writeLock().lock();
-
         if ( log.isDebugEnabled() )
         {
             log.debug( logCacheName + "Loading keys for " + keyFile.toString() );
         }
 
+        storageLock.writeLock().lock();
+
         try
         {
             // create a key map to use.
@@ -1186,20 +1186,26 @@ public class IndexedDiskCache
             if ( currentOptimizationThread == null )
             {
                 storageLock.writeLock().lock();
-                if ( currentOptimizationThread == null )
+
+                try
                 {
-                    currentOptimizationThread = new Thread( new Runnable()
+                    if ( currentOptimizationThread == null )
                     {
-                        public void run()
+                        currentOptimizationThread = new Thread( new Runnable()
                         {
-                            optimizeFile();
+                            public void run()
+                            {
+                                optimizeFile();
 
-                            currentOptimizationThread = null;
-                        }
-                    }, "IndexedDiskCache-OptimizationThread" );
+                                currentOptimizationThread = null;
+                            }
+                        }, "IndexedDiskCache-OptimizationThread" );
+                    }
+                }
+                finally
+                {
+                    storageLock.writeLock().unlock();
                 }
-
-                storageLock.writeLock().unlock();
 
                 if ( currentOptimizationThread != null )
                 {
@@ -1238,12 +1244,19 @@ public class IndexedDiskCache
         IndexedDiskElementDescriptor[] defragList = null;
 
         storageLock.writeLock().lock();
-        queueInput = true;
-        // shut off recycle while we're optimizing,
-        doRecycle = false;
-        defragList = createPositionSortedDescriptorList();
-        // Release if I acquired.
-        storageLock.writeLock().unlock();
+
+        try
+        {
+            queueInput = true;
+            // shut off recycle while we're optimizing,
+            doRecycle = false;
+            defragList = createPositionSortedDescriptorList();
+        }
+        finally
+        {
+            // Release if I acquired.
+            storageLock.writeLock().unlock();
+        }
 
         // Defrag the file outside of the write lock. This allows a move to be made,
         // and yet have the element still accessible for reading or writing.
@@ -1452,11 +1465,18 @@ public class IndexedDiskCache
         long size = 0;
 
         storageLock.readLock().lock();
-        if ( dataFile != null )
+
+        try
+        {
+            if ( dataFile != null )
+            {
+                size = dataFile.length();
+            }
+        }
+        finally
         {
-            size = dataFile.length();
+            storageLock.readLock().unlock();
         }
-        storageLock.readLock().unlock();
 
         return size;
     }

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManagerAbstractTemplate.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManagerAbstractTemplate.java?rev=1156345&r1=1156344&r2=1156345&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManagerAbstractTemplate.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManagerAbstractTemplate.java Wed Aug 10 20:06:42 2011
@@ -218,7 +218,7 @@ public abstract class JDBCDiskCacheManag
     /**
      * Allows us to set the daemon status on the clock-daemon
      */
-    class MyThreadFactory
+    protected static class MyThreadFactory
         implements ThreadFactory
     {
         /**

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCache.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCache.java?rev=1156345&r1=1156344&r2=1156345&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCache.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCache.java Wed Aug 10 20:06:42 2011
@@ -174,6 +174,7 @@ public class LateralCache
             log.error( e );
             handleException( e, "Failed to getMatching [" + pattern + "] from " + lateralCacheAttribures.getCacheName() + "@" + lateralCacheAttribures );
         }
+
         return elements;
     }
 
@@ -399,7 +400,6 @@ public class LateralCache
         {
             this.lateralCacheService = restoredLateral;
         }
-        return;
     }
 
     /**

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheNoWait.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheNoWait.java?rev=1156345&r1=1156344&r2=1156345&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheNoWait.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheNoWait.java Wed Aug 10 20:06:42 2011
@@ -341,7 +341,6 @@ public class LateralCacheNoWait
     {
         cache.fixCache( lateral );
         resetEventQ();
-        return;
     }
 
     /**

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPListener.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPListener.java?rev=1156345&r1=1156344&r2=1156345&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPListener.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPListener.java Wed Aug 10 20:06:42 2011
@@ -643,7 +643,7 @@ public class LateralTCPListener
      * <p>
      * @author Aaron Smuts
      */
-    class MyThreadFactory
+    protected static class MyThreadFactory
         implements ThreadFactory
     {
         /**

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=1156345&r1=1156344&r2=1156345&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 Aug 10 20:06:42 2011
@@ -206,8 +206,6 @@ public abstract class AbsractRemoteCache
 
             cache.localUpdate( cb );
         }
-
-        return;
     }
 
     /**

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=1156345&r1=1156344&r2=1156345&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 Aug 10 20:06:42 2011
@@ -650,7 +650,6 @@ public abstract class AbstractRemoteAuxi
         {
             setRemoteCacheService( restoredRemote );
         }
-        return;
     }
 
 

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=1156345&r1=1156344&r2=1156345&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 Aug 10 20:06:42 2011
@@ -53,7 +53,7 @@ public class RemoteCacheFailoverRunner
     private final static Log log = LogFactory.getLog( RemoteCacheFailoverRunner.class );
 
     /** The facade returned to the composite cache. */
-    private RemoteCacheNoWaitFacade facade;
+    private final RemoteCacheNoWaitFacade facade;
 
     /** How long to wait between reconnect attempts. */
     private static long idlePeriod = 20 * 1000;
@@ -62,13 +62,13 @@ public class RemoteCacheFailoverRunner
     private boolean alright = true;
 
     /** The cache manager */
-    private ICompositeCacheManager cacheMgr;
-    
+    private final ICompositeCacheManager cacheMgr;
+
     /** The event logger. */
-    private ICacheEventLogger cacheEventLogger;
+    private final ICacheEventLogger cacheEventLogger;
 
     /** The serializer. */
-    private IElementSerializer elementSerializer;
+    private final IElementSerializer elementSerializer;
 
     /**
      * Constructor for the RemoteCacheFailoverRunner object. This allows the
@@ -77,8 +77,8 @@ public class RemoteCacheFailoverRunner
      * @param facade
      *            the facade the CompositeCache talks to.
      * @param cacheMgr
-     * @param cacheEventLogger 
-     * @param elementSerializer 
+     * @param cacheEventLogger
+     * @param elementSerializer
      */
     public RemoteCacheFailoverRunner( RemoteCacheNoWaitFacade facade, ICompositeCacheManager cacheMgr,
                                       ICacheEventLogger cacheEventLogger, IElementSerializer elementSerializer )
@@ -134,7 +134,6 @@ public class RemoteCacheFailoverRunner
             }
             // log if we are alright or not.
         }
-        return;
     }
 
     /**
@@ -447,12 +446,12 @@ public class RemoteCacheFailoverRunner
                     {
                         String message = "Successfully reconnected to PRIMARY remote server.  Substituted primary for failoverNoWait [" + failoverNoWait + "]";
                         log.info( message );
-                        
+
                         if ( facade.getCacheEventLogger() != null )
                         {
                             facade.getCacheEventLogger().logApplicationEvent( "RemoteCacheFailoverRunner", "RestoredPrimary",
                                                                               message );
-                        }                        
+                        }
                     }
                     return true;
                 }

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=1156345&r1=1156344&r2=1156345&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 Aug 10 20:06:42 2011
@@ -213,12 +213,11 @@ public class RemoteCacheManager
                     + "We will NOT register a listener." );
             }
         }
-        return;
     }
 
     /**
      * Removes a listener. When the primary recovers the failover must deregister itself for a
-     * region. The failover runner will call this method to de-register. We do not want to dergister
+     * region. The failover runner will call this method to de-register. We do not want to deregister
      * all listeners to a remote server, in case a failover is a primary of another region. Having
      * one regions failover act as another servers primary is not currently supported.
      * <p>
@@ -233,7 +232,6 @@ public class RemoteCacheManager
         {
             remoteWatch.removeCacheListener( cattr.getCacheName(), listener );
         }
-        return;
     }
 
     /**
@@ -275,7 +273,6 @@ public class RemoteCacheManager
                 }
             }
         }
-        return;
     }
 
     /**
@@ -302,7 +299,6 @@ public class RemoteCacheManager
                 remoteWatch.removeCacheListener( cacheName, listener );
             }
         }
-        return;
     }
 
     /**

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=1156345&r1=1156344&r2=1156345&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 Aug 10 20:06:42 2011
@@ -396,7 +396,6 @@ public class RemoteCacheNoWait
     {
         remoteCacheClient.fixCache( remote );
         resetEventQ();
-        return;
     }
 
     /**

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=1156345&r1=1156344&r2=1156345&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 Wed Aug 10 20:06:42 2011
@@ -365,8 +365,6 @@ public abstract class AbstractRemoteCach
         {
             logICacheEvent( cacheEvent );
         }
-
-        return;
     }
 
     /**
@@ -413,7 +411,6 @@ public abstract class AbstractRemoteCach
         {
             logICacheEvent( cacheEvent );
         }
-        return;
     }
 
     /**
@@ -457,7 +454,6 @@ public abstract class AbstractRemoteCach
         {
             logICacheEvent( cacheEvent );
         }
-        return;
     }
 
     /**

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=1156345&r1=1156344&r2=1156345&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 Wed Aug 10 20:06:42 2011
@@ -886,8 +886,6 @@ class RemoteCacheServer
         {
             logICacheEvent( cacheEvent );
         }
-
-        return;
     }
 
     /**
@@ -992,7 +990,6 @@ class RemoteCacheServer
         {
             logICacheEvent( cacheEvent );
         }
-        return;
     }
 
     /**
@@ -1090,7 +1087,6 @@ class RemoteCacheServer
         {
             logICacheEvent( cacheEvent );
         }
-        return;
     }
 
     /**
@@ -1146,7 +1142,6 @@ class RemoteCacheServer
             }
             cacheManager.release();
         }
-        return;
     }
 
     /**

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=1156345&r1=1156344&r2=1156345&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 Wed Aug 10 20:06:42 2011
@@ -543,7 +543,7 @@ public class RemoteCacheServerFactory
     /**
      * Allows us to set the daemon status on the clockdaemon
      */
-    static class MyThreadFactory
+    protected static class MyThreadFactory
         implements ThreadFactory
     {
         /**

Added: commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/AbstractCacheEventQueue.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/AbstractCacheEventQueue.java?rev=1156345&view=auto
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/AbstractCacheEventQueue.java (added)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/AbstractCacheEventQueue.java Wed Aug 10 20:06:42 2011
@@ -0,0 +1,497 @@
+package org.apache.jcs.engine;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.IOException;
+import java.io.Serializable;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jcs.engine.behavior.ICacheElement;
+import org.apache.jcs.engine.behavior.ICacheEventQueue;
+import org.apache.jcs.engine.behavior.ICacheListener;
+
+/**
+ * An abstract base class to the different implementations
+ */
+public abstract class AbstractCacheEventQueue
+    implements ICacheEventQueue
+{
+    /** The logger. */
+    protected static final Log log = LogFactory.getLog( AbstractCacheEventQueue.class );
+
+    /** default */
+    protected static final int DEFAULT_WAIT_TO_DIE_MILLIS = 10000;
+
+    /**
+     * time to wait for an event before snuffing the background thread if the queue is empty. make
+     * configurable later
+     */
+    protected int waitToDieMillis = DEFAULT_WAIT_TO_DIE_MILLIS;
+
+    /**
+     * When the events are pulled off the queue, the tell the listener to handle the specific event
+     * type. The work is done by the listener.
+     */
+    protected ICacheListener listener;
+
+    /** Id of the listener registered with this queue */
+    protected long listenerId;
+
+    /** The cache region name, if applicable. */
+    protected String cacheName;
+
+    /** Maximum number of failures before we buy the farm. */
+    protected int maxFailure;
+
+    /** in milliseconds */
+    protected int waitBeforeRetry;
+
+    /** this is true if there is no worker thread. */
+    protected boolean destroyed = true;
+
+    /**
+     * This means that the queue is functional. If we reached the max number of failures, the queue
+     * is marked as non functional and will never work again.
+     */
+    protected boolean working = true;
+
+    /**
+     * Returns the time to wait for events before killing the background thread.
+     * <p>
+     * @return int
+     */
+    public int getWaitToDieMillis()
+    {
+        return waitToDieMillis;
+    }
+
+    /**
+     * Sets the time to wait for events before killing the background thread.
+     * <p>
+     * @param wtdm the ms for the q to sit idle.
+     */
+    public void setWaitToDieMillis( int wtdm )
+    {
+        waitToDieMillis = wtdm;
+    }
+
+    /**
+     * Creates a brief string identifying the listener and the region.
+     * <p>
+     * @return String debugging info.
+     */
+    @Override
+    public String toString()
+    {
+        return "CacheEventQueue [listenerId=" + listenerId + ", cacheName=" + cacheName + "]";
+    }
+
+    /**
+     * If they queue has an active thread it is considered alive.
+     * <p>
+     * @return The alive value
+     */
+    public synchronized boolean isAlive()
+    {
+        return ( !destroyed );
+    }
+
+    /**
+     * Sets whether the queue is actively processing -- if there are working threads.
+     * <p>
+     * @param aState
+     */
+    public synchronized void setAlive( boolean aState )
+    {
+        destroyed = !aState;
+    }
+
+    /**
+     * @return The listenerId value
+     */
+    public long getListenerId()
+    {
+        return listenerId;
+    }
+
+    /**
+     * This adds a put event to the queue. When it is processed, the element will be put to the
+     * listener.
+     * <p>
+     * @param ce The feature to be added to the PutEvent attribute
+     * @exception IOException
+     */
+    public synchronized void addPutEvent( ICacheElement ce )
+        throws IOException
+    {
+        if ( isWorking() )
+        {
+            put( new PutEvent( ce ) );
+        }
+        else
+        {
+            if ( log.isWarnEnabled() )
+            {
+                log.warn( "Not enqueuing Put Event for [" + this + "] because it's non-functional." );
+            }
+        }
+    }
+
+    /**
+     * This adds a remove event to the queue. When processed the listener's remove method will be
+     * called for the key.
+     * <p>
+     * @param key The feature to be added to the RemoveEvent attribute
+     * @exception IOException
+     */
+    public synchronized void addRemoveEvent( Serializable key )
+        throws IOException
+    {
+        if ( isWorking() )
+        {
+            put( new RemoveEvent( key ) );
+        }
+        else
+        {
+            if ( log.isWarnEnabled() )
+            {
+                log.warn( "Not enqueuing Remove Event for [" + this + "] because it's non-functional." );
+            }
+        }
+    }
+
+    /**
+     * This adds a remove all event to the queue. When it is processed, all elements will be removed
+     * from the cache.
+     * <p>
+     * @exception IOException
+     */
+    public synchronized void addRemoveAllEvent()
+        throws IOException
+    {
+        if ( isWorking() )
+        {
+            put( new RemoveAllEvent() );
+        }
+        else
+        {
+            if ( log.isWarnEnabled() )
+            {
+                log.warn( "Not enqueuing RemoveAll Event for [" + this + "] because it's non-functional." );
+            }
+        }
+    }
+
+    /**
+     * @exception IOException
+     */
+    public synchronized void addDisposeEvent()
+        throws IOException
+    {
+        if ( isWorking() )
+        {
+            put( new DisposeEvent() );
+        }
+        else
+        {
+            if ( log.isWarnEnabled() )
+            {
+                log.warn( "Not enqueuing Dispose Event for [" + this + "] because it's non-functional." );
+            }
+        }
+    }
+
+    /**
+     * Adds an event to the queue.
+     * <p>
+     * @param event
+     */
+    protected abstract void put( AbstractCacheEvent event );
+
+
+    // /////////////////////////// Inner classes /////////////////////////////
+
+    /** The queue is composed of nodes. */
+    protected static class Node
+    {
+        /** Next node in the singly linked list. */
+        Node next = null;
+
+        /** The payload. */
+        AbstractCacheEventQueue.AbstractCacheEvent event = null;
+    }
+
+    /**
+     * Retries before declaring failure.
+     * <p>
+     * @author asmuts
+     * @created January 15, 2002
+     */
+    protected abstract class AbstractCacheEvent
+        implements Runnable
+    {
+        /** Number of failures encountered processing this event. */
+        int failures = 0;
+
+        /** Have we finished the job */
+        boolean done = false;
+
+        /**
+         * Main processing method for the AbstractCacheEvent object
+         */
+        public void run()
+        {
+            try
+            {
+                doRun();
+            }
+            catch ( IOException e )
+            {
+                if ( log.isWarnEnabled() )
+                {
+                    log.warn( e );
+                }
+                if ( ++failures >= maxFailure )
+                {
+                    if ( log.isWarnEnabled() )
+                    {
+                        log.warn( "Error while running event from Queue: " + this
+                            + ". Dropping Event and marking Event Queue as non-functional." );
+                    }
+                    setWorking( false );
+                    setAlive( false );
+                    return;
+                }
+                if ( log.isInfoEnabled() )
+                {
+                    log.info( "Error while running event from Queue: " + this + ". Retrying..." );
+                }
+                try
+                {
+                    Thread.sleep( waitBeforeRetry );
+                    run();
+                }
+                catch ( InterruptedException ie )
+                {
+                    if ( log.isErrorEnabled() )
+                    {
+                        log.warn( "Interrupted while sleeping for retry on event " + this + "." );
+                    }
+                    // TODO consider if this is best. maybe we shoudl just
+                    // destroy
+                    setWorking( false );
+                    setAlive( false );
+                }
+            }
+        }
+
+        /**
+         * @exception IOException
+         */
+        protected abstract void doRun()
+            throws IOException;
+    }
+
+    /**
+     * An element should be put in the cache.
+     * <p>
+     * @author asmuts
+     * @created January 15, 2002
+     */
+    protected class PutEvent
+        extends AbstractCacheEvent
+    {
+        /** The element to put to the listener */
+        private final ICacheElement ice;
+
+        /**
+         * Constructor for the PutEvent object.
+         * <p>
+         * @param ice
+         * @exception IOException
+         */
+        PutEvent( ICacheElement ice )
+            throws IOException
+        {
+            this.ice = ice;
+        }
+
+        /**
+         * Call put on the listener.
+         * <p>
+         * @exception IOException
+         */
+        @Override
+        protected void doRun()
+            throws IOException
+        {
+            listener.handlePut( ice );
+        }
+
+        /**
+         * For debugging.
+         * <p>
+         * @return Info on the key and value.
+         */
+        @Override
+        public String toString()
+        {
+            return new StringBuffer( "PutEvent for key: " ).append( ice.getKey() ).append( " value: " )
+                .append( ice.getVal() ).toString();
+        }
+
+    }
+
+    /**
+     * An element should be removed from the cache.
+     * <p>
+     * @author asmuts
+     * @created January 15, 2002
+     */
+    protected class RemoveEvent
+        extends AbstractCacheEvent
+    {
+        /** The key to remove from the listener */
+        private final Serializable key;
+
+        /**
+         * Constructor for the RemoveEvent object
+         * <p>
+         * @param key
+         * @exception IOException
+         */
+        RemoveEvent( Serializable key )
+            throws IOException
+        {
+            this.key = key;
+        }
+
+        /**
+         * Call remove on the listener.
+         * <p>
+         * @exception IOException
+         */
+        @Override
+        protected void doRun()
+            throws IOException
+        {
+            listener.handleRemove( cacheName, key );
+        }
+
+        /**
+         * For debugging.
+         * <p>
+         * @return Info on the key to remove.
+         */
+        @Override
+        public String toString()
+        {
+            return new StringBuffer( "RemoveEvent for " ).append( key ).toString();
+        }
+
+    }
+
+    /**
+     * All elements should be removed from the cache when this event is processed.
+     * <p>
+     * @author asmuts
+     * @created January 15, 2002
+     */
+    protected class RemoveAllEvent
+        extends AbstractCacheEvent
+    {
+        /**
+         * Call removeAll on the listener.
+         * <p>
+         * @exception IOException
+         */
+        @Override
+        protected void doRun()
+            throws IOException
+        {
+            listener.handleRemoveAll( cacheName );
+        }
+
+        /**
+         * For debugging.
+         * <p>
+         * @return The name of the event.
+         */
+        @Override
+        public String toString()
+        {
+            return "RemoveAllEvent";
+        }
+
+    }
+
+    /**
+     * The cache should be disposed when this event is processed.
+     * <p>
+     * @author asmuts
+     * @created January 15, 2002
+     */
+    protected class DisposeEvent
+        extends AbstractCacheEvent
+    {
+        /**
+         * Called when gets to the end of the queue
+         * <p>
+         * @exception IOException
+         */
+        @Override
+        protected void doRun()
+            throws IOException
+        {
+            listener.handleDispose( cacheName );
+        }
+
+        /**
+         * For debugging.
+         * <p>
+         * @return The name of the event.
+         */
+        @Override
+        public String toString()
+        {
+            return "DisposeEvent";
+        }
+    }
+
+    /**
+     * @return whether the queue is functional.
+     */
+    public boolean isWorking()
+    {
+        return working;
+    }
+
+    /**
+     * This means that the queue is functional. If we reached the max number of failures, the queue
+     * is marked as non functional and will never work again.
+     * <p>
+     * @param b
+     */
+    public void setWorking( boolean b )
+    {
+        working = b;
+    }
+}

Propchange: commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/AbstractCacheEventQueue.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

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=1156345&r1=1156344&r2=1156345&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 Wed Aug 10 20:06:42 2011
@@ -19,14 +19,8 @@ package org.apache.jcs.engine;
  * under the License.
  */
 
-import java.io.IOException;
-import java.io.Serializable;
 import java.util.ArrayList;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-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.stats.StatElement;
 import org.apache.jcs.engine.stats.Stats;
@@ -36,55 +30,16 @@ import org.apache.jcs.engine.stats.behav
 /**
  * An event queue is used to propagate ordered cache events to one and only one target listener.
  * <p>
- * This is a modified version of the experimental version. It should lazy initilaize the processor
- * thread, and kill the thread if the queue goes emtpy for a specified period, now set to 1 minute.
+ * This is a modified version of the experimental version. It should lazy initialize the processor
+ * thread, and kill the thread if the queue goes empty for a specified period, now set to 1 minute.
  * If something comes in after that a new processor thread should be created.
  */
 public class CacheEventQueue
-    implements ICacheEventQueue
+    extends AbstractCacheEventQueue
 {
-    /** The logger. */
-    protected static final Log log = LogFactory.getLog( CacheEventQueue.class );
-
     /** The type of queue -- there are pooled and single */
     private static final String queueType = SINGLE_QUEUE_TYPE;
 
-    /** default */
-    private static final int DEFAULT_WAIT_TO_DIE_MILLIS = 10000;
-
-    /**
-     * time to wait for an event before snuffing the background thread if the queue is empty. make
-     * configurable later
-     */
-    private int waitToDieMillis = DEFAULT_WAIT_TO_DIE_MILLIS;
-
-    /**
-     * When the events are pulled off the queue, the tell the listener to handle the specific event
-     * type. The work is done by the listener.
-     */
-    protected ICacheListener listener;
-
-    /** Id of the listener registered with this queue */
-    private long listenerId;
-
-    /** The cache region name, if applicable. */
-    protected String cacheName;
-
-    /** Maximum number of failures before we buy the farm. */
-    protected int maxFailure;
-
-    /** in milliseconds */
-    protected int waitBeforeRetry;
-
-    /** this is true if there is no worker thread. */
-    private boolean destroyed = true;
-
-    /**
-     * This means that the queue is functional. If we reached the max number of failures, the queue
-     * is marked as non functional and will never work again.
-     */
-    private boolean working = true;
-
     /** the thread that works the queue. */
     private Thread processorThread;
 
@@ -178,68 +133,9 @@ public class CacheEventQueue
     }
 
     /**
-     * Returns the time to wait for events before killing the background thread.
-     * <p>
-     * @return int
-     */
-    public int getWaitToDieMillis()
-    {
-        return waitToDieMillis;
-    }
-
-    /**
-     * Sets the time to wait for events before killing the background thread.
-     * <p>
-     * @param wtdm the ms for the q to sit idle.
-     */
-    public void setWaitToDieMillis( int wtdm )
-    {
-        waitToDieMillis = wtdm;
-    }
-
-    /**
-     * Creates a brief string identifying the listener and the region.
+     * Event Q is empty.
      * <p>
-     * @return String debugging info.
-     */
-    @Override
-    public String toString()
-    {
-        return "CacheEventQueue [listenerId=" + listenerId + ", cacheName=" + cacheName + "]";
-    }
-
-    /**
-     * If they queue has an active thread it is considered alive.
-     * <p>
-     * @return The alive value
-     */
-    public synchronized boolean isAlive()
-    {
-        return ( !destroyed );
-    }
-
-    /**
-     * Sets whether the queue is actively processing -- if there are working threads.
-     * <p>
-     * @param aState
-     */
-    public synchronized void setAlive( boolean aState )
-    {
-        destroyed = !aState;
-    }
-
-    /**
-     * @return The listenerId value
-     */
-    public long getListenerId()
-    {
-        return listenerId;
-    }
-
-    /**
-     * Event Q is emtpy.
-     * <p>
-     * Calling destroy interupts the processor thread.
+     * Calling destroy interrupts the processor thread.
      */
     public synchronized void destroy()
     {
@@ -279,98 +175,12 @@ public class CacheEventQueue
     }
 
     /**
-     * This adds a put event to the queue. When it is processed, the element will be put to the
-     * listener.
-     * <p>
-     * @param ce The feature to be added to the PutEvent attribute
-     * @exception IOException
-     */
-    public synchronized void addPutEvent( ICacheElement ce )
-        throws IOException
-    {
-        if ( isWorking() )
-        {
-            put( new PutEvent( ce ) );
-        }
-        else
-        {
-            if ( log.isWarnEnabled() )
-            {
-                log.warn( "Not enqueuing Put Event for [" + this + "] because it's non-functional." );
-            }
-        }
-    }
-
-    /**
-     * This adds a remove event to the queue. When processed the listener's remove method will be
-     * called for the key.
-     * <p>
-     * @param key The feature to be added to the RemoveEvent attribute
-     * @exception IOException
-     */
-    public synchronized void addRemoveEvent( Serializable key )
-        throws IOException
-    {
-        if ( isWorking() )
-        {
-            put( new RemoveEvent( key ) );
-        }
-        else
-        {
-            if ( log.isWarnEnabled() )
-            {
-                log.warn( "Not enqueuing Remove Event for [" + this + "] because it's non-functional." );
-            }
-        }
-    }
-
-    /**
-     * This adds a remove all event to the queue. When it is processed, all elements will be removed
-     * from the cache.
-     * <p>
-     * @exception IOException
-     */
-    public synchronized void addRemoveAllEvent()
-        throws IOException
-    {
-        if ( isWorking() )
-        {
-            put( new RemoveAllEvent() );
-        }
-        else
-        {
-            if ( log.isWarnEnabled() )
-            {
-                log.warn( "Not enqueuing RemoveAll Event for [" + this + "] because it's non-functional." );
-            }
-        }
-    }
-
-    /**
-     * @exception IOException
-     */
-    public synchronized void addDisposeEvent()
-        throws IOException
-    {
-        if ( isWorking() )
-        {
-            put( new DisposeEvent() );
-        }
-        else
-        {
-            if ( log.isWarnEnabled() )
-            {
-                log.warn( "Not enqueuing Dispose Event for [" + this + "] because it's non-functional." );
-            }
-        }
-    }
-
-    /**
      * Adds an event to the queue.
      * <p>
      * @param event
      */
-    private void put( AbstractCacheEvent event )
+    @Override
+    protected void put( AbstractCacheEvent event )
     {
         Node newNode = new Node();
         if ( log.isDebugEnabled() )
@@ -405,119 +215,8 @@ public class CacheEventQueue
         }
     }
 
-    /**
-     * Returns the next cache event from the queue or null if there are no events in the queue.
-     * <p>
-     * We have an empty node at the head and the tail. When we take an item from the queue we move
-     * the next node to the head and then clear the value from that node. This value is returned.
-     * <p>
-     * When the queue is empty the head node is the same as the tail node.
-     * <p>
-     * @return An event to process.
-     */
-    protected AbstractCacheEvent take()
-    {
-        synchronized ( queueLock )
-        {
-            // wait until there is something to read
-            if ( head == tail )
-            {
-                return null;
-            }
-
-            Node node = head.next;
-
-            AbstractCacheEvent value = node.event;
-
-            if ( log.isDebugEnabled() )
-            {
-                log.debug( "head.event = " + head.event );
-                log.debug( "node.event = " + node.event );
-            }
-
-            // Node becomes the new head (head is always empty)
-
-            node.event = null;
-            head = node;
-
-            size--;
-            return value;
-        }
-    }
-
-    /**
-     * This method returns semi-structured data on this queue.
-     * <p>
-     * @see org.apache.jcs.engine.behavior.ICacheEventQueue#getStatistics()
-     * @return information on the status and history of the queue
-     */
-    public IStats getStatistics()
-    {
-        IStats stats = new Stats();
-        stats.setTypeName( "Cache Event Queue" );
-
-        ArrayList<IStatElement> elems = new ArrayList<IStatElement>();
-
-        IStatElement se = null;
-
-        se = new StatElement();
-        se.setName( "Working" );
-        se.setData( "" + this.working );
-        elems.add( se );
-
-        se = new StatElement();
-        se.setName( "Alive" );
-        se.setData( "" + this.isAlive() );
-        elems.add( se );
-
-        se = new StatElement();
-        se.setName( "Empty" );
-        se.setData( "" + this.isEmpty() );
-        elems.add( se );
-
-        int size = 0;
-        synchronized ( queueLock )
-        {
-            // wait until there is something to read
-            if ( head == tail )
-            {
-                size = 0;
-            }
-            else
-            {
-                Node n = head;
-                while ( n != null )
-                {
-                    n = n.next;
-                    size++;
-                }
-            }
-
-            se = new StatElement();
-            se.setName( "Size" );
-            se.setData( "" + size );
-            elems.add( se );
-        }
-
-        // get an array and put them in the Stats object
-        IStatElement[] ses = elems.toArray( new StatElement[0] );
-        stats.setStatElements( ses );
-
-        return stats;
-    }
-
     // /////////////////////////// Inner classes /////////////////////////////
 
-    /** The queue is composed of nodes. */
-    protected static class Node
-    {
-        /** Next node in the singly linked list. */
-        Node next = null;
-
-        /** The payload. */
-        CacheEventQueue.AbstractCacheEvent event = null;
-    }
-
     /**
      * This is the thread that works the queue.
      * <p>
@@ -601,259 +300,104 @@ public class CacheEventQueue
     }
 
     /**
-     * Retries before declaring failure.
+     * Returns the next cache event from the queue or null if there are no events in the queue.
      * <p>
-     * @author asmuts
-     * @created January 15, 2002
+     * We have an empty node at the head and the tail. When we take an item from the queue we move
+     * the next node to the head and then clear the value from that node. This value is returned.
+     * <p>
+     * When the queue is empty the head node is the same as the tail node.
+     * <p>
+     * @return An event to process.
      */
-    protected abstract class AbstractCacheEvent
-        implements Runnable
+    protected AbstractCacheEvent take()
     {
-        /** Number of failures encountered processing this event. */
-        int failures = 0;
-
-        /** Have we finished the job */
-        boolean done = false;
-
-        /**
-         * Main processing method for the AbstractCacheEvent object
-         */
-        public void run()
+        synchronized ( queueLock )
         {
-            try
-            {
-                doRun();
-            }
-            catch ( IOException e )
+            // wait until there is something to read
+            if ( head == tail )
             {
-                if ( log.isWarnEnabled() )
-                {
-                    log.warn( e );
-                }
-                if ( ++failures >= maxFailure )
-                {
-                    if ( log.isWarnEnabled() )
-                    {
-                        log.warn( "Error while running event from Queue: " + this
-                            + ". Dropping Event and marking Event Queue as non-functional." );
-                    }
-                    setWorking( false );
-                    setAlive( false );
-                    return;
-                }
-                if ( log.isInfoEnabled() )
-                {
-                    log.info( "Error while running event from Queue: " + this + ". Retrying..." );
-                }
-                try
-                {
-                    Thread.sleep( waitBeforeRetry );
-                    run();
-                }
-                catch ( InterruptedException ie )
-                {
-                    if ( log.isErrorEnabled() )
-                    {
-                        log.warn( "Interrupted while sleeping for retry on event " + this + "." );
-                    }
-                    // TODO consider if this is best. maybe we shoudl just
-                    // destroy
-                    setWorking( false );
-                    setAlive( false );
-                }
+                return null;
             }
-        }
 
-        /**
-         * @exception IOException
-         */
-        protected abstract void doRun()
-            throws IOException;
-    }
+            Node node = head.next;
 
-    /**
-     * An element should be put in the cache.
-     * <p>
-     * @author asmuts
-     * @created January 15, 2002
-     */
-    private class PutEvent
-        extends AbstractCacheEvent
-    {
-        /** The element to put to the listener */
-        private final ICacheElement ice;
+            AbstractCacheEvent value = node.event;
 
-        /**
-         * Constructor for the PutEvent object.
-         * <p>
-         * @param ice
-         * @exception IOException
-         */
-        PutEvent( ICacheElement ice )
-            throws IOException
-        {
-            this.ice = ice;
-        }
+            if ( log.isDebugEnabled() )
+            {
+                log.debug( "head.event = " + head.event );
+                log.debug( "node.event = " + node.event );
+            }
 
-        /**
-         * Call put on the listener.
-         * <p>
-         * @exception IOException
-         */
-        @Override
-        protected void doRun()
-            throws IOException
-        {
-            listener.handlePut( ice );
-        }
+            // Node becomes the new head (head is always empty)
 
-        /**
-         * For debugging.
-         * <p>
-         * @return Info on the key and value.
-         */
-        @Override
-        public String toString()
-        {
-            return new StringBuffer( "PutEvent for key: " ).append( ice.getKey() ).append( " value: " )
-                .append( ice.getVal() ).toString();
-        }
+            node.event = null;
+            head = node;
 
+            size--;
+            return value;
+        }
     }
 
     /**
-     * An element should be removed from the cache.
+     * This method returns semi-structured data on this queue.
      * <p>
-     * @author asmuts
-     * @created January 15, 2002
+     * @see org.apache.jcs.engine.behavior.ICacheEventQueue#getStatistics()
+     * @return information on the status and history of the queue
      */
-    private class RemoveEvent
-        extends AbstractCacheEvent
+    public IStats getStatistics()
     {
-        /** The key to remove from the listener */
-        private final Serializable key;
-
-        /**
-         * Constructor for the RemoveEvent object
-         * <p>
-         * @param key
-         * @exception IOException
-         */
-        RemoveEvent( Serializable key )
-            throws IOException
-        {
-            this.key = key;
-        }
-
-        /**
-         * Call remove on the listener.
-         * <p>
-         * @exception IOException
-         */
-        @Override
-        protected void doRun()
-            throws IOException
-        {
-            listener.handleRemove( cacheName, key );
-        }
+        IStats stats = new Stats();
+        stats.setTypeName( "Cache Event Queue" );
 
-        /**
-         * For debugging.
-         * <p>
-         * @return Info on the key to remove.
-         */
-        @Override
-        public String toString()
-        {
-            return new StringBuffer( "RemoveEvent for " ).append( key ).toString();
-        }
+        ArrayList<IStatElement> elems = new ArrayList<IStatElement>();
 
-    }
+        IStatElement se = null;
 
-    /**
-     * All elements should be removed from the cache when this event is processed.
-     * <p>
-     * @author asmuts
-     * @created January 15, 2002
-     */
-    protected class RemoveAllEvent
-        extends AbstractCacheEvent
-    {
-        /**
-         * Call removeAll on the listener.
-         * <p>
-         * @exception IOException
-         */
-        @Override
-        protected void doRun()
-            throws IOException
-        {
-            listener.handleRemoveAll( cacheName );
-        }
+        se = new StatElement();
+        se.setName( "Working" );
+        se.setData( "" + this.working );
+        elems.add( se );
 
-        /**
-         * For debugging.
-         * <p>
-         * @return The name of the event.
-         */
-        @Override
-        public String toString()
-        {
-            return "RemoveAllEvent";
-        }
+        se = new StatElement();
+        se.setName( "Alive" );
+        se.setData( "" + this.isAlive() );
+        elems.add( se );
 
-    }
+        se = new StatElement();
+        se.setName( "Empty" );
+        se.setData( "" + this.isEmpty() );
+        elems.add( se );
 
-    /**
-     * The cache should be disposed when this event is processed.
-     * <p>
-     * @author asmuts
-     * @created January 15, 2002
-     */
-    protected class DisposeEvent
-        extends AbstractCacheEvent
-    {
-        /**
-         * Called when gets to the end of the queue
-         * <p>
-         * @exception IOException
-         */
-        @Override
-        protected void doRun()
-            throws IOException
+        int size = 0;
+        synchronized ( queueLock )
         {
-            listener.handleDispose( cacheName );
-        }
+            // wait until there is something to read
+            if ( head == tail )
+            {
+                size = 0;
+            }
+            else
+            {
+                Node n = head;
+                while ( n != null )
+                {
+                    n = n.next;
+                    size++;
+                }
+            }
 
-        /**
-         * For debugging.
-         * <p>
-         * @return The name of the event.
-         */
-        @Override
-        public String toString()
-        {
-            return "DisposeEvent";
+            se = new StatElement();
+            se.setName( "Size" );
+            se.setData( "" + size );
+            elems.add( se );
         }
-    }
 
-    /**
-     * @return whether the queue is functional.
-     */
-    public boolean isWorking()
-    {
-        return working;
-    }
+        // get an array and put them in the Stats object
+        IStatElement[] ses = elems.toArray( new StatElement[0] );
+        stats.setStatElements( ses );
 
-    /**
-     * This means that the queue is functional. If we reached the max number of failures, the queue
-     * is marked as non functional and will never work again.
-     * <p>
-     * @param b
-     */
-    public void setWorking( boolean b )
-    {
-        working = b;
+        return stats;
     }
 
     /**

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/PooledCacheEventQueue.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/PooledCacheEventQueue.java?rev=1156345&r1=1156344&r2=1156345&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/PooledCacheEventQueue.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/PooledCacheEventQueue.java Wed Aug 10 20:06:42 2011
@@ -19,16 +19,10 @@ package org.apache.jcs.engine;
  * under the License.
  */
 
-import java.io.IOException;
-import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.ThreadPoolExecutor;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-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.stats.StatElement;
 import org.apache.jcs.engine.stats.Stats;
@@ -47,39 +41,11 @@ import org.apache.jcs.utils.threadpool.T
  * light of this, having one thread per region seems unnecessary. This may prove to be false.
  */
 public class PooledCacheEventQueue
-    implements ICacheEventQueue
+    extends AbstractCacheEventQueue
 {
     /** The type of event queue */
     private static final String queueType = POOLED_QUEUE_TYPE;
 
-    /** The logger */
-    protected static final Log log = LogFactory.getLog( PooledCacheEventQueue.class );
-
-    /** time to wait for an event before snuffing the background thread
-    if the queue is empty.   make configurable later */
-    private int waitToDieMillis = 10000;
-
-    /** The listener to process events */
-    protected ICacheListener listener;
-
-    /** The listener id */
-    private long listenerId;
-
-    /** The name of the cache */
-    protected String cacheName;
-
-    /** Max failures before self destruction */
-    protected int maxFailure;
-
-    /** in milliseconds */
-    protected int waitBeforeRetry;
-
-    /** Has the pool been destroyed */
-    private boolean destroyed = true;
-
-    /** Is it working */
-    private boolean working = true;
-
     /** The Thread Pool to execute events with. */
     private ThreadPoolExecutor pool = null;
 
@@ -153,59 +119,6 @@ public class PooledCacheEventQueue
     }
 
     /**
-     * Returns the time to wait for events before killing the background thread.
-     * <p>
-     * @return the time to wait before shutting down in ms.
-     */
-    public int getWaitToDieMillis()
-    {
-        return waitToDieMillis;
-    }
-
-    /**
-     * Sets the time to wait for events before killing the background thread.
-     * <p>
-     * @param wtdm
-     */
-    public void setWaitToDieMillis( int wtdm )
-    {
-        waitToDieMillis = wtdm;
-    }
-
-    /**
-     * @return String info.
-     */
-    @Override
-    public String toString()
-    {
-        return "CacheEventQueue [listenerId=" + listenerId + ", cacheName=" + cacheName + "]";
-    }
-
-    /**
-     * @return true if not destroyed.
-     */
-    public boolean isAlive()
-    {
-        return ( !destroyed );
-    }
-
-    /**
-     * @param aState
-     */
-    public void setAlive( boolean aState )
-    {
-        destroyed = !aState;
-    }
-
-    /**
-     * @return The listenerId value
-     */
-    public long getListenerId()
-    {
-        return listenerId;
-    }
-
-    /**
      * Destroy the queue. Interrupt all threads.
      */
     public synchronized void destroy()
@@ -222,91 +135,12 @@ public class PooledCacheEventQueue
     }
 
     /**
-     * Constructs a PutEvent for the object and passes it to the event queue.
-     * <p>
-     * @param ce The feature to be added to the PutEvent attribute
-     * @exception IOException
-     */
-    public synchronized void addPutEvent( ICacheElement ce )
-        throws IOException
-    {
-        if ( isWorking() )
-        {
-            put( new PutEvent( ce ) );
-        }
-        else
-        {
-            if ( log.isWarnEnabled() )
-            {
-                log.warn( "Not enqueuing Put Event for [" + this + "] because it's non-functional." );
-            }
-        }
-    }
-
-    /**
-     * @param key The feature to be added to the RemoveEvent attribute
-     * @exception IOException
-     */
-    public synchronized void addRemoveEvent( Serializable key )
-        throws IOException
-    {
-        if ( isWorking() )
-        {
-            put( new RemoveEvent( key ) );
-        }
-        else
-        {
-            if ( log.isWarnEnabled() )
-            {
-                log.warn( "Not enqueuing Remove Event for [" + this + "] because it's non-functional." );
-            }
-        }
-    }
-
-    /**
-     * @exception IOException
-     */
-    public synchronized void addRemoveAllEvent()
-        throws IOException
-    {
-        if ( isWorking() )
-        {
-            put( new RemoveAllEvent() );
-        }
-        else
-        {
-            if ( log.isWarnEnabled() )
-            {
-                log.warn( "Not enqueuing RemoveAll Event for [" + this + "] because it's non-functional." );
-            }
-        }
-    }
-
-    /**
-     * @exception IOException
-     */
-    public synchronized void addDisposeEvent()
-        throws IOException
-    {
-        if ( isWorking() )
-        {
-            put( new DisposeEvent() );
-        }
-        else
-        {
-            if ( log.isWarnEnabled() )
-            {
-                log.warn( "Not enqueuing Dispose Event for [" + this + "] because it's non-functional." );
-            }
-        }
-    }
-
-    /**
      * Adds an event to the queue.
      * <p>
      * @param event
      */
-    private void put( AbstractCacheEvent event )
+    @Override
+    protected void put( AbstractCacheEvent event )
     {
         pool.execute( event );
     }
@@ -377,227 +211,6 @@ public class PooledCacheEventQueue
         return stats;
     }
 
-    // /////////////////////////// Inner classes /////////////////////////////
-
-    /**
-     * Retries before declaring failure.
-     * <p>
-     * @author asmuts
-     * @created January 15, 2002
-     */
-    protected abstract class AbstractCacheEvent
-        implements Runnable
-    {
-        /** Times failed to process */
-        int failures = 0;
-
-        /** Has the event been processed */
-        boolean done = false;
-
-        /**
-         * Main processing method for the AbstractCacheEvent object. It calls the abstract doRun
-         * method that all concrete instances must implement.
-         */
-        public void run()
-        {
-            try
-            {
-                doRun();
-            }
-            catch ( IOException e )
-            {
-                if ( log.isWarnEnabled() )
-                {
-                    log.warn( e );
-                }
-                if ( ++failures >= maxFailure )
-                {
-                    if ( log.isWarnEnabled() )
-                    {
-                        log.warn( "Error while running event from Queue: " + this
-                            + ". Dropping Event and marking Event Queue as non-functional." );
-                    }
-                    setWorking( false );
-                    setAlive( false );
-                    return;
-                }
-                if ( log.isInfoEnabled() )
-                {
-                    log.info( "Error while running event from Queue: " + this + ". Retrying..." );
-                }
-                try
-                {
-                    Thread.sleep( waitBeforeRetry );
-                    run();
-                }
-                catch ( InterruptedException ie )
-                {
-                    if ( log.isErrorEnabled() )
-                    {
-                        log.warn( "Interrupted while sleeping for retry on event " + this + "." );
-                    }
-                    setWorking( false );
-                    setAlive( false );
-                }
-            }
-        }
-
-        /**
-         * @exception IOException
-         */
-        protected abstract void doRun()
-            throws IOException;
-    }
-
-    /**
-     * An event that puts an item to a ICacheListener
-     */
-    private class PutEvent
-        extends AbstractCacheEvent
-    {
-        /** The payload */
-        private final ICacheElement ice;
-
-        /**
-         * Constructor for the PutEvent object
-         * @param ice
-         * @exception IOException
-         */
-        PutEvent( ICacheElement ice )
-            throws IOException
-        {
-            this.ice = ice;
-        }
-
-        /**
-         * Tells the ICacheListener to handle the put.
-         * <p>
-         * @exception IOException
-         */
-        @Override
-        protected void doRun()
-            throws IOException
-        {
-            listener.handlePut( ice );
-        }
-
-        /** @return debugging info */
-        @Override
-        public String toString()
-        {
-            return new StringBuffer( "PutEvent for key: " ).append( ice.getKey() ).append( " value: " )
-                .append( ice.getVal() ).toString();
-        }
-    }
-
-    /**
-     * An event that knows how to call remove on an ICacheListener
-     */
-    private class RemoveEvent
-        extends AbstractCacheEvent
-    {
-        /** The payload, the key to remove */
-        private final Serializable key;
-
-        /**
-         * Constructor for the RemoveEvent object
-         * @param key
-         * @exception IOException
-         */
-        RemoveEvent( Serializable key )
-            throws IOException
-        {
-            this.key = key;
-        }
-
-        /**
-         * Calls remove on the listener.
-         * <p>
-         * @exception IOException
-         */
-        @Override
-        protected void doRun()
-            throws IOException
-        {
-            listener.handleRemove( cacheName, key );
-        }
-
-        /** @return debugging info */
-        @Override
-        public String toString()
-        {
-            return new StringBuffer( "RemoveEvent for " ).append( key ).toString();
-        }
-    }
-
-    /**
-     * An event that knows how to call remove all on an ICacheListener
-     */
-    protected class RemoveAllEvent
-        extends AbstractCacheEvent
-    {
-        /**
-         * Call removeAll on the listener.
-         * <p>
-         * @exception IOException
-         */
-        @Override
-        protected void doRun()
-            throws IOException
-        {
-            listener.handleRemoveAll( cacheName );
-        }
-
-        /** @return debugging info */
-        @Override
-        public String toString()
-        {
-            return "RemoveAllEvent";
-        }
-    }
-
-    /**
-     * The Event put into the queue for dispose requests.
-     */
-    protected class DisposeEvent
-        extends AbstractCacheEvent
-    {
-        /**
-         * Called when gets to the end of the queue
-         * <p>
-         * @exception IOException
-         */
-        @Override
-        protected void doRun()
-            throws IOException
-        {
-            listener.handleDispose( cacheName );
-        }
-
-        /** @return debugging info */
-        @Override
-        public String toString()
-        {
-            return "DisposeEvent";
-        }
-    }
-
-    /**
-     * @return whether or not the queue is functional
-     */
-    public boolean isWorking()
-    {
-        return working;
-    }
-
-    /**
-     * @param isWorkingArg whether the queue is functional
-     */
-    public void setWorking( boolean isWorkingArg )
-    {
-        working = isWorkingArg;
-    }
-
     /**
      * If the Queue is using a bounded channel we can determine the size. If it is zero or we can't
      * determine the size, we return true.

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/ZombieCacheService.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/ZombieCacheService.java?rev=1156345&r1=1156344&r2=1156345&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/ZombieCacheService.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/ZombieCacheService.java Wed Aug 10 20:06:42 2011
@@ -136,7 +136,6 @@ public class ZombieCacheService
     public void dispose( String cacheName )
     {
         // zombies have no inner life
-        return;
     }
 
     /**
@@ -145,6 +144,5 @@ public class ZombieCacheService
     public void release()
     {
         // zombies have no inner life
-        return;
     }
 }

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=1156345&r1=1156344&r2=1156345&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 Wed Aug 10 20:06:42 2011
@@ -98,7 +98,6 @@ public class ZombieCacheServiceNonLocal
             queue.add( event );
         }
         // Zombies have no inner life
-        return;
     }
 
     /**
@@ -116,7 +115,6 @@ public class ZombieCacheServiceNonLocal
             queue.add( event );
         }
         // Zombies have no inner life
-        return;
     }
 
     /**
@@ -133,7 +131,6 @@ public class ZombieCacheServiceNonLocal
             queue.add( event );
         }
         // Zombies have no inner life
-        return;
     }
 
     /**

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/ZombieCacheWatch.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/ZombieCacheWatch.java?rev=1156345&r1=1156344&r2=1156345&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/ZombieCacheWatch.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/ZombieCacheWatch.java Wed Aug 10 20:06:42 2011
@@ -19,10 +19,9 @@ package org.apache.jcs.engine;
  * under the License.
  */
 
+import org.apache.jcs.engine.behavior.ICacheListener;
 import org.apache.jcs.engine.behavior.ICacheObserver;
-
 import org.apache.jcs.engine.behavior.IZombie;
-import org.apache.jcs.engine.behavior.ICacheListener;
 
 /**
  * Zombie Observer.
@@ -38,7 +37,7 @@ public class ZombieCacheWatch
      */
     public void addCacheListener( String cacheName, ICacheListener obj )
     {
-        return;
+        // empty
     }
 
     /**
@@ -48,7 +47,7 @@ public class ZombieCacheWatch
      */
     public void addCacheListener( ICacheListener obj )
     {
-        return;
+        // empty
     }
 
     /**
@@ -57,7 +56,7 @@ public class ZombieCacheWatch
      */
     public void removeCacheListener( String cacheName, ICacheListener obj )
     {
-        return;
+        // empty
     }
 
     /**
@@ -65,6 +64,6 @@ public class ZombieCacheWatch
      */
     public void removeCacheListener( ICacheListener obj )
     {
-        return;
+        // empty
     }
 }

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=1156345&r1=1156344&r2=1156345&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 Wed Aug 10 20:06:42 2011
@@ -1284,7 +1284,6 @@ public class CompositeCache
                 }
             }
         }
-        return;
     }
 
     /**

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/control/event/behavior/IElementEventQueue.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/control/event/behavior/IElementEventQueue.java?rev=1156345&r1=1156344&r2=1156345&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/control/event/behavior/IElementEventQueue.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/engine/control/event/behavior/IElementEventQueue.java Wed Aug 10 20:06:42 2011
@@ -21,9 +21,6 @@ package org.apache.jcs.engine.control.ev
 
 import java.io.IOException;
 
-import org.apache.jcs.engine.control.event.behavior.IElementEventHandler;
-import org.apache.jcs.engine.control.event.behavior.IElementEvent;
-
 /**
  * Interface for an element event queue. An event queue is used to propagate
  * ordered element events in one region.

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=1156345&r1=1156344&r2=1156345&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 Wed Aug 10 20:06:42 2011
@@ -373,7 +373,7 @@ public abstract class AbstractMemoryCach
     /**
      * Allows us to set the daemon status on the clockdaemon
      */
-    class MyThreadFactory
+    protected static class MyThreadFactory
         implements ThreadFactory
     {
         /**

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/discovery/UDPDiscoveryReceiver.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/discovery/UDPDiscoveryReceiver.java?rev=1156345&r1=1156344&r2=1156345&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/discovery/UDPDiscoveryReceiver.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/discovery/UDPDiscoveryReceiver.java Wed Aug 10 20:06:42 2011
@@ -237,7 +237,6 @@ public class UDPDiscoveryReceiver
                 log.error( "Problem sleeping", e2 );
             }
         }
-        return;
     }
 
     /**
@@ -348,7 +347,7 @@ public class UDPDiscoveryReceiver
     /**
      * Allows us to set the daemon status on the executor threads
      */
-    class MyThreadFactory
+    protected static class MyThreadFactory
         implements ThreadFactory
     {
         /**

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=1156345&r1=1156344&r2=1156345&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 Wed Aug 10 20:06:42 2011
@@ -326,7 +326,7 @@ public class UDPDiscoveryService
      * <p>
      * @author aaronsm
      */
-    class MyThreadFactory
+    protected static class MyThreadFactory
         implements ThreadFactory
     {
         /**

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=1156345&r1=1156344&r2=1156345&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 Wed Aug 10 20:06:42 2011
@@ -88,7 +88,6 @@ public class DoubleLinkedList<T extends 
         }
         first = me;
         size++;
-        return;
     }
 
     /**

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/struct/LRUMap.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/struct/LRUMap.java?rev=1156345&r1=1156344&r2=1156345&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/struct/LRUMap.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/struct/LRUMap.java Wed Aug 10 20:06:42 2011
@@ -385,7 +385,6 @@ public class LRUMap<K, V>
     {
         LRUElementDescriptor<K, V> me = new LRUElementDescriptor<K, V>(key, val);
         list.addFirst( me );
-        return;
     }
 
     /**

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/struct/SortedPreferentialArray.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/struct/SortedPreferentialArray.java?rev=1156345&r1=1156344&r2=1156345&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/struct/SortedPreferentialArray.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/struct/SortedPreferentialArray.java Wed Aug 10 20:06:42 2011
@@ -109,7 +109,6 @@ public class SortedPreferentialArray<T e
         }
         // obj is less than the largest.
         insert( obj );
-        return;
     }
 
     /**
@@ -587,7 +586,6 @@ public class SortedPreferentialArray<T e
                 throw ibe;
             }
         }
-        return;
     }
 
     /**

Modified: commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/threadpool/ThreadPoolManager.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/threadpool/ThreadPoolManager.java?rev=1156345&r1=1156344&r2=1156345&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/threadpool/ThreadPoolManager.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/jcs/utils/threadpool/ThreadPoolManager.java Wed Aug 10 20:06:42 2011
@@ -445,7 +445,7 @@ public class ThreadPoolManager
      * <p>
      * @author aaronsm
      */
-    class MyThreadFactory
+    protected static class MyThreadFactory
         implements ThreadFactory
     {
         /**



Mime
View raw message