commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t.@apache.org
Subject svn commit: r1583059 - in /commons/proper/jcs/trunk/src/java/org/apache/commons/jcs: auxiliary/disk/ auxiliary/disk/behavior/ auxiliary/disk/block/ auxiliary/disk/file/ auxiliary/disk/indexed/ auxiliary/lateral/ auxiliary/lateral/socket/tcp/ auxiliary/...
Date Sat, 29 Mar 2014 21:36:25 GMT
Author: tv
Date: Sat Mar 29 21:36:24 2014
New Revision: 1583059

URL: http://svn.apache.org/r1583059
Log:
Clean up some Findbugs complaints

Removed:
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/LateralCacheInfo.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServerInfo.java
Modified:
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/AbstractDiskCacheAttributes.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/behavior/IDiskCacheAttributes.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskCache.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskKeyStore.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/file/FileDiskCache.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexedDiskCache.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/LateralCache.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/LateralCacheNoWait.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPCacheFactory.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPCacheManager.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPListener.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPSender.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPService.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/RemoteCacheFactory.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/RemoteCacheFailoverRunner.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/http/client/RemoteHttpCacheFactory.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServer.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheStartupServlet.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/CacheInfo.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/ElementAttributes.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/control/CompositeCacheConfigurator.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/control/CompositeCacheManager.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/stats/StatElement.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/stats/behavior/IStatElement.java

Modified: commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/AbstractDiskCacheAttributes.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/AbstractDiskCacheAttributes.java?rev=1583059&r1=1583058&r2=1583059&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/AbstractDiskCacheAttributes.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/AbstractDiskCacheAttributes.java Sat Mar 29 21:36:24 2014
@@ -19,9 +19,13 @@ package org.apache.commons.jcs.auxiliary
  * under the License.
  */
 
+import java.io.File;
+
 import org.apache.commons.jcs.auxiliary.AbstractAuxiliaryCacheAttributes;
 import org.apache.commons.jcs.auxiliary.AuxiliaryCacheAttributes;
 import org.apache.commons.jcs.auxiliary.disk.behavior.IDiskCacheAttributes;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 /**
  * This has common attributes that any conceivable disk cache would need.
@@ -33,14 +37,17 @@ public abstract class AbstractDiskCacheA
     /** Don't change. */
     private static final long serialVersionUID = 8306631920391711229L;
 
+    /** The logger */
+    private final static Log log = LogFactory.getLog( AbstractDiskCacheAttributes.class );
+
     /** path to disk */
-    protected String diskPath;
+    protected File diskPath;
 
     /** if this is false, we will not execute remove all */
     private boolean allowRemoveAll = true;
 
     /** default to 5000 */
-    protected int maxPurgatorySize = MAX_PURGATORY_SIZE_DEFUALT;
+    protected int maxPurgatorySize = MAX_PURGATORY_SIZE_DEFAULT;
 
     /** Default amount of time to allow for key persistence on shutdown */
     private static final int DEFAULT_shutdownSpoolTimeLimit = 60;
@@ -58,7 +65,13 @@ public abstract class AbstractDiskCacheA
      */
     public void setDiskPath( String path )
     {
-        this.diskPath = path.trim();
+        this.diskPath = new File( path );
+        boolean result = this.diskPath.mkdirs();
+
+        if (!result)
+        {
+            log.error("Failed to create directory " + path);
+        }
     }
 
     /**
@@ -66,7 +79,7 @@ public abstract class AbstractDiskCacheA
      * <p>
      * @return The diskPath value
      */
-    public String getDiskPath()
+    public File getDiskPath()
     {
         return this.diskPath;
     }

Modified: commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/behavior/IDiskCacheAttributes.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/behavior/IDiskCacheAttributes.java?rev=1583059&r1=1583058&r2=1583059&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/behavior/IDiskCacheAttributes.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/behavior/IDiskCacheAttributes.java Sat Mar 29 21:36:24 2014
@@ -19,6 +19,8 @@ package org.apache.commons.jcs.auxiliary
  * under the License.
  */
 
+import java.io.File;
+
 import org.apache.commons.jcs.auxiliary.AuxiliaryCacheAttributes;
 
 /**
@@ -32,7 +34,7 @@ public interface IDiskCacheAttributes
      * items to be spooled are temporarily stored. It basically provides access
      * to items on the to-be-spooled queue.
      */
-    int MAX_PURGATORY_SIZE_DEFUALT = 5000;
+    int MAX_PURGATORY_SIZE_DEFAULT = 5000;
 
     /**
      * Sets the diskPath attribute of the IJISPCacheAttributes object
@@ -47,7 +49,7 @@ public interface IDiskCacheAttributes
      * <p>
      * @return The diskPath value
      */
-    String getDiskPath();
+    File getDiskPath();
 
     /**
      * Gets the maxKeySize attribute of the DiskCacheAttributes object

Modified: commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskCache.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskCache.java?rev=1583059&r1=1583058&r2=1583059&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskCache.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskCache.java Sat Mar 29 21:36:24 2014
@@ -118,13 +118,11 @@ public class BlockDiskCache<K extends Se
 
         // Make a clean file name
         this.fileName = getCacheName().replaceAll("[^a-zA-Z0-9-_\\.]", "_");
-        String rootDirName = cacheAttributes.getDiskPath();
-        this.rootDirectory = new File( rootDirName );
-        this.rootDirectory.mkdirs();
+        this.rootDirectory = cacheAttributes.getDiskPath();
 
         if ( log.isInfoEnabled() )
         {
-            log.info( logCacheName + "Cache file root directory: [" + rootDirName + "]" );
+            log.info( logCacheName + "Cache file root directory: [" + rootDirectory + "]");
         }
 
         try
@@ -158,7 +156,7 @@ public class BlockDiskCache<K extends Se
         catch ( IOException e )
         {
             log.error( logCacheName + "Failure initializing for fileName: " + fileName + " and root directory: "
-                + rootDirName, e );
+                + rootDirectory, e );
         }
     }
 

Modified: commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskKeyStore.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskKeyStore.java?rev=1583059&r1=1583058&r2=1583059&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskKeyStore.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskKeyStore.java Sat Mar 29 21:36:24 2014
@@ -84,13 +84,11 @@ public class BlockDiskKeyStore<K extends
         this.maxKeySize = cacheAttributes.getMaxKeySize();
         this.blockDiskCache = blockDiskCache;
 
-        String rootDirName = cacheAttributes.getDiskPath();
-        File rootDirectory = new File( rootDirName );
-        rootDirectory.mkdirs();
+        File rootDirectory = cacheAttributes.getDiskPath();
 
         if ( log.isInfoEnabled() )
         {
-            log.info( logCacheName + "Cache file root directory [" + rootDirName + "]" );
+            log.info( logCacheName + "Cache file root directory [" + rootDirectory + "]" );
         }
 
         this.keyFile = new File( rootDirectory, fileName + ".key" );

Modified: commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/file/FileDiskCache.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/file/FileDiskCache.java?rev=1583059&r1=1583058&r2=1583059&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/file/FileDiskCache.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/file/FileDiskCache.java Sat Mar 29 21:36:24 2014
@@ -100,12 +100,11 @@ public class FileDiskCache<K extends Ser
     private boolean initializeFileSystem( FileDiskCacheAttributes cattr )
     {
         // TODO, we might need to make this configurable
-        String rootDirName = cattr.getDiskPath() + "/" + cattr.getCacheName();
-        this.setDirectory( new File( rootDirName ) );
+        this.setDirectory( new File( cattr.getDiskPath(), cattr.getCacheName() ) );
         boolean createdDirectories = getDirectory().mkdirs();
         if ( log.isInfoEnabled() )
         {
-            log.info( logCacheName + "Cache file root directory: " + rootDirName );
+            log.info( logCacheName + "Cache file root directory: " + getDirectory() );
             log.info( logCacheName + "Created root directory: " + createdDirectories );
         }
 
@@ -408,10 +407,10 @@ public class FileDiskCache<K extends Ser
                 os.close();
             }
             deleteWithRetry( file );
-            tmp.renameTo( file );
+            boolean result = tmp.renameTo( file );
             if ( log.isDebugEnabled() )
             {
-                log.debug( logCacheName + "Renamed to: " + file );
+                log.debug( logCacheName + "Renamed to: " + file + " Result: " + result);
             }
         }
         catch ( IOException e )

Modified: commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexedDiskCache.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexedDiskCache.java?rev=1583059&r1=1583058&r2=1583059&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexedDiskCache.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexedDiskCache.java Sat Mar 29 21:36:24 2014
@@ -205,13 +205,10 @@ public class IndexedDiskCache<K extends 
      */
     private void initializeFileSystem( IndexedDiskCacheAttributes cattr )
     {
-        String rootDirName = cattr.getDiskPath();
-        this.rafDir = new File( rootDirName );
-        boolean createdDirectories = this.rafDir.mkdirs();
+        this.rafDir = cattr.getDiskPath();
         if ( log.isInfoEnabled() )
         {
-            log.info( logCacheName + "Cache file root directory: " + rootDirName );
-            log.info( logCacheName + "Created root directory: " + createdDirectories );
+            log.info( logCacheName + "Cache file root directory: " + rafDir );
         }
     }
 
@@ -964,24 +961,31 @@ public class IndexedDiskCache<K extends 
                 dataFile.close();
             }
             File dataFileTemp = new File( rafDir, fileName + ".data" );
-            dataFileTemp.delete();
+            boolean result = dataFileTemp.delete();
+            if (!result && log.isDebugEnabled())
+            {
+                log.debug("Could not delete file " + dataFileTemp);
+            }
 
             if ( keyFile != null )
             {
                 keyFile.close();
             }
             File keyFileTemp = new File( rafDir, fileName + ".key" );
-            keyFileTemp.delete();
+            result = keyFileTemp.delete();
+            if (!result && log.isDebugEnabled())
+            {
+                log.debug("Could not delete file " + keyFileTemp);
+            }
 
             dataFile = new IndexedDisk( new File( rafDir, fileName + ".data" ), getElementSerializer() );
-
             keyFile = new IndexedDisk( new File( rafDir, fileName + ".key" ), getElementSerializer() );
 
             initializeRecycleBin();
 
             initializeKeyMap();
         }
-        catch ( Exception e )
+        catch ( IOException e )
         {
             log.error( logCacheName + "Failure reseting state", e );
         }

Modified: commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/LateralCache.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/LateralCache.java?rev=1583059&r1=1583058&r2=1583059&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/LateralCache.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/LateralCache.java Sat Mar 29 21:36:24 2014
@@ -29,6 +29,7 @@ import java.util.Set;
 import org.apache.commons.jcs.auxiliary.AbstractAuxiliaryCacheEventLogging;
 import org.apache.commons.jcs.auxiliary.AuxiliaryCacheAttributes;
 import org.apache.commons.jcs.auxiliary.lateral.behavior.ILateralCacheAttributes;
+import org.apache.commons.jcs.engine.CacheInfo;
 import org.apache.commons.jcs.engine.CacheStatus;
 import org.apache.commons.jcs.engine.ZombieCacheServiceNonLocal;
 import org.apache.commons.jcs.engine.behavior.ICacheElement;
@@ -103,10 +104,10 @@ public class LateralCache<K extends Seri
         {
             if ( log.isDebugEnabled() )
             {
-                log.debug( "update: lateral = [" + lateralCacheService + "], " + "LateralCacheInfo.listenerId = "
-                    + LateralCacheInfo.listenerId );
+                log.debug( "update: lateral = [" + lateralCacheService + "], " + "CacheInfo.listenerId = "
+                    + CacheInfo.listenerId );
             }
-            lateralCacheService.update( ce, LateralCacheInfo.listenerId );
+            lateralCacheService.update( ce, CacheInfo.listenerId );
         }
         catch ( NullPointerException npe )
         {
@@ -243,7 +244,7 @@ public class LateralCache<K extends Seri
 
         try
         {
-            lateralCacheService.remove( cacheName, key, LateralCacheInfo.listenerId );
+            lateralCacheService.remove( cacheName, key, CacheInfo.listenerId );
         }
         catch ( Exception ex )
         {
@@ -264,7 +265,7 @@ public class LateralCache<K extends Seri
     {
         try
         {
-            lateralCacheService.removeAll( cacheName, LateralCacheInfo.listenerId );
+            lateralCacheService.removeAll( cacheName, CacheInfo.listenerId );
         }
         catch ( Exception ex )
         {

Modified: commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/LateralCacheNoWait.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/LateralCacheNoWait.java?rev=1583059&r1=1583058&r2=1583059&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/LateralCacheNoWait.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/LateralCacheNoWait.java Sat Mar 29 21:36:24 2014
@@ -34,6 +34,7 @@ import org.apache.commons.jcs.auxiliary.
 import org.apache.commons.jcs.auxiliary.AuxiliaryCacheAttributes;
 import org.apache.commons.jcs.engine.CacheAdaptor;
 import org.apache.commons.jcs.engine.CacheEventQueueFactory;
+import org.apache.commons.jcs.engine.CacheInfo;
 import org.apache.commons.jcs.engine.CacheStatus;
 import org.apache.commons.jcs.engine.behavior.ICacheElement;
 import org.apache.commons.jcs.engine.behavior.ICacheEventQueue;
@@ -89,7 +90,7 @@ public class LateralCacheNoWait<K extend
         }
 
         CacheEventQueueFactory<K, V> fact = new CacheEventQueueFactory<K, V>();
-        this.eventQueue = fact.createCacheEventQueue( new CacheAdaptor<K, V>( cache ), LateralCacheInfo.listenerId, cache
+        this.eventQueue = fact.createCacheEventQueue( new CacheAdaptor<K, V>( cache ), CacheInfo.listenerId, cache
             .getCacheName(), cache.getAuxiliaryCacheAttributes().getEventQueuePoolName(), cache
             .getAuxiliaryCacheAttributes().getEventQueueType() );
 
@@ -354,7 +355,7 @@ public class LateralCacheNoWait<K extend
             eventQueue.destroy();
         }
         CacheEventQueueFactory<K, V> fact = new CacheEventQueueFactory<K, V>();
-        this.eventQueue = fact.createCacheEventQueue( new CacheAdaptor<K, V>( cache ), LateralCacheInfo.listenerId, cache
+        this.eventQueue = fact.createCacheEventQueue( new CacheAdaptor<K, V>( cache ), CacheInfo.listenerId, cache
             .getCacheName(), cache.getAuxiliaryCacheAttributes().getEventQueuePoolName(), cache
             .getAuxiliaryCacheAttributes().getEventQueueType() );
     }

Modified: commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPCacheFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPCacheFactory.java?rev=1583059&r1=1583058&r2=1583059&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPCacheFactory.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPCacheFactory.java Sat Mar 29 21:36:24 2014
@@ -104,17 +104,7 @@ public class LateralTCPCacheFactory
                 }
 
                 ICache<K, V> ic = lcm.getCache( lacC.getCacheName() );
-                if ( ic != null )
-                {
-                    noWaits.add( ic );
-                }
-                else
-                {
-                    if ( log.isDebugEnabled() )
-                    {
-                        log.debug( "noWait is null, no lateral connection made" );
-                    }
-                }
+                noWaits.add( ic );
             }
         }
 

Modified: commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPCacheManager.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPCacheManager.java?rev=1583059&r1=1583058&r2=1583059&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPCacheManager.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPCacheManager.java Sat Mar 29 21:36:24 2014
@@ -66,7 +66,7 @@ public class LateralTCPCacheManager
     private static LateralCacheMonitor monitor;
 
     /** Address to instance map. */
-    protected static Map<String, LateralTCPCacheManager> instances =
+    protected static final Map<String, LateralTCPCacheManager> instances =
         new ConcurrentHashMap<String, LateralTCPCacheManager>();
 
     /** ITCPLateralCacheAttributes */

Modified: commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPListener.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPListener.java?rev=1583059&r1=1583058&r2=1583059&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPListener.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPListener.java Sat Mar 29 21:36:24 2014
@@ -35,10 +35,10 @@ import java.util.concurrent.Executors;
 import java.util.concurrent.ThreadFactory;
 
 import org.apache.commons.jcs.access.exception.CacheException;
-import org.apache.commons.jcs.auxiliary.lateral.LateralCacheInfo;
 import org.apache.commons.jcs.auxiliary.lateral.LateralElementDescriptor;
 import org.apache.commons.jcs.auxiliary.lateral.behavior.ILateralCacheListener;
 import org.apache.commons.jcs.auxiliary.lateral.socket.tcp.behavior.ITCPLateralCacheAttributes;
+import org.apache.commons.jcs.engine.CacheInfo;
 import org.apache.commons.jcs.engine.behavior.ICacheElement;
 import org.apache.commons.jcs.engine.behavior.ICompositeCacheManager;
 import org.apache.commons.jcs.engine.behavior.IShutdownObserver;
@@ -53,11 +53,8 @@ import org.apache.commons.logging.LogFac
  * passed to a pooled executor which then calls the appropriate handle method.
  */
 public class LateralTCPListener<K extends Serializable, V extends Serializable>
-    implements ILateralCacheListener<K, V>, Serializable, IShutdownObserver
+    implements ILateralCacheListener<K, V>, IShutdownObserver
 {
-    /** Don't change. */
-    private static final long serialVersionUID = -9107062664967131738L;
-
     /** The logger */
     protected final static Log log = LogFactory.getLog( LateralTCPListener.class );
 
@@ -96,7 +93,7 @@ public class LateralTCPListener<K extend
      * Use the vmid by default. This can be set for testing. If we ever need to run more than one
      * per vm, then we need a new technique.
      */
-    private long listenerId = LateralCacheInfo.listenerId;
+    private long listenerId = CacheInfo.listenerId;
 
     /** is this shut down? */
     protected boolean shutdown = false;

Modified: commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPSender.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPSender.java?rev=1583059&r1=1583058&r2=1583059&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPSender.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPSender.java Sat Mar 29 21:36:24 2014
@@ -87,7 +87,7 @@ public class LateralTCPSender
                 log.debug( "po = " + po );
             }
 
-            if ( h2 == null )
+            if ( h2.length() == 0 )
             {
                 throw new IOException( "Cannot connect to invalid address [" + h2 + ":" + po + "]" );
             }

Modified: commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPService.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPService.java?rev=1583059&r1=1583058&r2=1583059&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPService.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPService.java Sat Mar 29 21:36:24 2014
@@ -28,12 +28,12 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
 
-import org.apache.commons.jcs.auxiliary.lateral.LateralCacheInfo;
 import org.apache.commons.jcs.auxiliary.lateral.LateralCommand;
 import org.apache.commons.jcs.auxiliary.lateral.LateralElementDescriptor;
 import org.apache.commons.jcs.auxiliary.lateral.behavior.ILateralCacheObserver;
 import org.apache.commons.jcs.auxiliary.lateral.socket.tcp.behavior.ITCPLateralCacheAttributes;
 import org.apache.commons.jcs.engine.CacheElement;
+import org.apache.commons.jcs.engine.CacheInfo;
 import org.apache.commons.jcs.engine.behavior.ICacheElement;
 import org.apache.commons.jcs.engine.behavior.ICacheListener;
 import org.apache.commons.jcs.engine.behavior.ICacheServiceNonLocal;
@@ -56,7 +56,7 @@ public class LateralTCPService<K extends
     private LateralTCPSender sender;
 
     /** use the vmid by default */
-    private long listenerId = LateralCacheInfo.listenerId;
+    private long listenerId = CacheInfo.listenerId;
 
     /**
      * Constructor for the LateralTCPService object
@@ -422,7 +422,7 @@ public class LateralTCPService<K extends
             boolean notDone = true;
             String message = null;
             // wait to dispose
-            BufferedReader br = new BufferedReader( new InputStreamReader( System.in ) );
+            BufferedReader br = new BufferedReader( new InputStreamReader( System.in, "UTF-8" ) );
 
             while ( notDone )
             {

Modified: commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/RemoteCacheFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/RemoteCacheFactory.java?rev=1583059&r1=1583058&r2=1583059&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/RemoteCacheFactory.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/RemoteCacheFactory.java Sat Mar 29 21:36:24 2014
@@ -32,8 +32,6 @@ import org.apache.commons.jcs.engine.beh
 import org.apache.commons.jcs.engine.behavior.ICompositeCacheManager;
 import org.apache.commons.jcs.engine.behavior.IElementSerializer;
 import org.apache.commons.jcs.engine.logging.behavior.ICacheEventLogger;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 
 /**
  * The RemoteCacheFactory creates remote caches for the cache hub. It returns a no wait facade which
@@ -44,9 +42,6 @@ import org.apache.commons.logging.LogFac
 public class RemoteCacheFactory
     implements AuxiliaryCacheFactory
 {
-    /** The logger. */
-    private final static Log log = LogFactory.getLog( RemoteCacheFactory.class );
-
     /** The name of this auxiliary */
     private String name;
 
@@ -94,14 +89,7 @@ public class RemoteCacheFactory
                 RemoteCacheManager rcm = RemoteCacheManager.getInstance( rca, cacheMgr, cacheEventLogger,
                                                                          elementSerializer );
                 ICache<K, V> ic = rcm.getCache( rca );
-                if ( ic != null )
-                {
-                    noWaits.add( ic );
-                }
-                else
-                {
-                    log.info( "noWait is null" );
-                }
+                noWaits.add( ic );
             }
 
             // GET HANDLE BUT DONT REGISTER A LISTENER FOR FAILOVERS
@@ -126,14 +114,7 @@ public class RemoteCacheFactory
                     if ( ( !primayDefined && fCnt == 1 ) || noWaits.size() <= 0 )
                     {
                         ICache<K, V> ic = rcm.getCache( rca );
-                        if ( ic != null )
-                        {
-                            noWaits.add( ic );
-                        }
-                        else
-                        {
-                            log.info( "noWait is null" );
-                        }
+                        noWaits.add( ic );
                     }
                 }
                 // end while
@@ -159,14 +140,7 @@ public class RemoteCacheFactory
                                                                          elementSerializer );
                 rca.setRemoteType( RemoteType.CLUSTER );
                 ICache<K, V> ic = rcm.getCache( rca );
-                if ( ic != null )
-                {
-                    noWaits.add( ic );
-                }
-                else
-                {
-                    log.info( "noWait is null" );
-                }
+                noWaits.add( ic );
             }
 
         }

Modified: commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/RemoteCacheFailoverRunner.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/RemoteCacheFailoverRunner.java?rev=1583059&r1=1583058&r2=1583059&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/RemoteCacheFailoverRunner.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/RemoteCacheFailoverRunner.java Sat Mar 29 21:36:24 2014
@@ -214,49 +214,42 @@ public class RemoteCacheFailoverRunner<K
                         // add a listener if there are none, need to tell rca
                         // what number it is at
                         ICache<K, V> ic = rcm.getCache( rca.getCacheName() );
-                        if ( ic != null )
+                        if ( ic.getStatus() == CacheStatus.ALIVE )
                         {
-                            if ( ic.getStatus() == CacheStatus.ALIVE )
-                            {
-                                // may need to do this more gracefully
-                                log.debug( "resetting no wait" );
-                                facade.noWaits = new RemoteCacheNoWait[1];
-                                facade.noWaits[0] = (RemoteCacheNoWait<K, V>) ic;
-                                facade.remoteCacheAttributes.setFailoverIndex( i );
+                            // may need to do this more gracefully
+                            log.debug( "resetting no wait" );
+                            facade.noWaits = new RemoteCacheNoWait[1];
+                            facade.noWaits[0] = (RemoteCacheNoWait<K, V>) ic;
+                            facade.remoteCacheAttributes.setFailoverIndex( i );
 
-                                synchronized ( this )
+                            synchronized ( this )
+                            {
+                                if ( log.isDebugEnabled() )
                                 {
-                                    if ( log.isDebugEnabled() )
+                                    log.debug( "setting ALRIGHT to true" );
+                                    if ( i > 0 )
                                     {
-                                        log.debug( "setting ALRIGHT to true" );
-                                        if ( i > 0 )
-                                        {
-                                            log.debug( "Moving to Primary Recovery Mode, failover index = " + i );
-                                        }
-                                        else
+                                        log.debug( "Moving to Primary Recovery Mode, failover index = " + i );
+                                    }
+                                    else
+                                    {
+                                        if ( log.isInfoEnabled() )
                                         {
-                                            if ( log.isInfoEnabled() )
-                                            {
-                                                String message = "No need to connect to failover, the primary server is back up.";
-                                                log.info( message );
-                                            }
+                                            String message = "No need to connect to failover, the primary server is back up.";
+                                            log.info( message );
                                         }
                                     }
+                                }
 
-                                    alright = true;
+                                alright = true;
 
-                                    if ( log.isInfoEnabled() )
-                                    {
-                                        log.info( "CONNECTED to host = [" + rca.getRemoteHost() + "] port = ["
-                                            + rca.getRemotePort() + "]" );
-                                    }
+                                if ( log.isInfoEnabled() )
+                                {
+                                    log.info( "CONNECTED to host = [" + rca.getRemoteHost() + "] port = ["
+                                        + rca.getRemotePort() + "]" );
                                 }
                             }
                         }
-                        else
-                        {
-                            log.info( "noWait is null" );
-                        }
                     }
                     catch ( Exception ex )
                     {
@@ -368,116 +361,106 @@ public class RemoteCacheFailoverRunner<K
             // If the remote server was rebooted this could be a problem if new
             // locals were also added.
 
-            if ( ic != null )
+            if ( ic.getStatus() == CacheStatus.ALIVE )
             {
-                if ( ic.getStatus() == CacheStatus.ALIVE )
+                try
                 {
-                    try
+                    // we could have more than one listener registered right
+                    // now.
+                    // this will not result in a loop, only duplication
+                    // stop duplicate listening.
+                    if ( facade.noWaits[0] != null && facade.noWaits[0].getStatus() == CacheStatus.ALIVE )
                     {
-                        // we could have more than one listener registered right
-                        // now.
-                        // this will not result in a loop, only duplication
-                        // stop duplicate listening.
-                        if ( facade.noWaits[0] != null && facade.noWaits[0].getStatus() == CacheStatus.ALIVE )
+                        int fidx = facade.remoteCacheAttributes.getFailoverIndex();
+
+                        if ( fidx > 0 )
                         {
-                            int fidx = facade.remoteCacheAttributes.getFailoverIndex();
+                            String serverOld = failovers[fidx];
 
-                            if ( fidx > 0 )
+                            if ( log.isDebugEnabled() )
                             {
-                                String serverOld = failovers[fidx];
+                                log.debug( "Failover Index = " + fidx + " the server at that index is ["
+                                    + serverOld + "]" );
+                            }
 
-                                if ( log.isDebugEnabled() )
-                                {
-                                    log.debug( "Failover Index = " + fidx + " the server at that index is ["
-                                        + serverOld + "]" );
-                                }
+                            if ( serverOld != null )
+                            {
+                                // create attributes that reflect the
+                                // previous failed over configuration.
+                                RemoteCacheAttributes rcaOld = (RemoteCacheAttributes) facade.remoteCacheAttributes.copy();
+                                rcaOld.setRemoteHost( serverOld.substring( 0, serverOld.indexOf( ":" ) ) );
+                                rcaOld.setRemotePort( Integer.parseInt( serverOld.substring( serverOld
+                                    .indexOf( ":" ) + 1 ) ) );
+                                RemoteCacheManager rcmOld = RemoteCacheManager.getInstance( rcaOld, cacheMgr, cacheEventLogger, elementSerializer );
 
-                                if ( serverOld != null )
+                                if ( rcmOld != null )
                                 {
-                                    // create attributes that reflect the
-                                    // previous failed over configuration.
-                                    RemoteCacheAttributes rcaOld = (RemoteCacheAttributes) facade.remoteCacheAttributes.copy();
-                                    rcaOld.setRemoteHost( serverOld.substring( 0, serverOld.indexOf( ":" ) ) );
-                                    rcaOld.setRemotePort( Integer.parseInt( serverOld.substring( serverOld
-                                        .indexOf( ":" ) + 1 ) ) );
-                                    RemoteCacheManager rcmOld = RemoteCacheManager.getInstance( rcaOld, cacheMgr, cacheEventLogger, elementSerializer );
-
-                                    if ( rcmOld != null )
-                                    {
-                                        // manager can remove by name if
-                                        // necessary
-                                        rcmOld.removeRemoteCacheListener( rcaOld );
-                                    }
-                                    if ( log.isInfoEnabled() )
-                                    {
-                                        log.info( "Successfully deregistered from FAILOVER remote server = "
-                                            + serverOld );
-                                    }
+                                    // manager can remove by name if
+                                    // necessary
+                                    rcmOld.removeRemoteCacheListener( rcaOld );
                                 }
-                            }
-                            else if ( fidx == 0 )
-                            {
-                                // this should never happen. If there are no
-                                // failovers this shouldn't get called.
-                                if ( log.isDebugEnabled() )
+                                if ( log.isInfoEnabled() )
                                 {
-                                    log.debug( "No need to restore primary, it is already restored." );
-                                    return true;
+                                    log.info( "Successfully deregistered from FAILOVER remote server = "
+                                        + serverOld );
                                 }
                             }
-                            else if ( fidx < 0 )
+                        }
+                        else if ( fidx == 0 )
+                        {
+                            // this should never happen. If there are no
+                            // failovers this shouldn't get called.
+                            if ( log.isDebugEnabled() )
                             {
-                                // this should never happen
-                                log.warn( "Failover index is less than 0, this shouldn't happen" );
+                                log.debug( "No need to restore primary, it is already restored." );
+                                return true;
                             }
                         }
-                    }
-                    catch ( IOException e )
-                    {
-                        // TODO, should try again, or somehow stop the listener
-                        log.error(
-                                   "Trouble trying to deregister old failover listener prior to restoring the primary = "
-                                       + server, e );
-                    }
-
-                    // Restore primary
-                    // may need to do this more gracefully, letting the failover finish in the background
-                    RemoteCacheNoWait<K, V> failoverNoWait = facade.noWaits[0];
-
-                    // swap in a new one
-                    facade.noWaits = new RemoteCacheNoWait[1];
-                    facade.noWaits[0] = (RemoteCacheNoWait<K, V>) ic;
-                    facade.remoteCacheAttributes.setFailoverIndex( 0 );
-
-                    if ( log.isInfoEnabled() )
-                    {
-                        String message = "Successfully reconnected to PRIMARY remote server.  Substituted primary for failoverNoWait [" + failoverNoWait + "]";
-                        log.info( message );
-
-                        if ( facade.getCacheEventLogger() != null )
+                        else if ( fidx < 0 )
                         {
-                            facade.getCacheEventLogger().logApplicationEvent( "RemoteCacheFailoverRunner", "RestoredPrimary",
-                                                                              message );
+                            // this should never happen
+                            log.warn( "Failover index is less than 0, this shouldn't happen" );
                         }
                     }
-                    return true;
+                }
+                catch ( IOException e )
+                {
+                    // TODO, should try again, or somehow stop the listener
+                    log.error(
+                               "Trouble trying to deregister old failover listener prior to restoring the primary = "
+                                   + server, e );
                 }
 
-                // 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.
-                if ( log.isDebugEnabled() )
+                // Restore primary
+                // may need to do this more gracefully, letting the failover finish in the background
+                RemoteCacheNoWait<K, V> failoverNoWait = facade.noWaits[0];
+
+                // swap in a new one
+                facade.noWaits = new RemoteCacheNoWait[1];
+                facade.noWaits[0] = (RemoteCacheNoWait<K, V>) ic;
+                facade.remoteCacheAttributes.setFailoverIndex( 0 );
+
+                if ( log.isInfoEnabled() )
                 {
-                    log.debug( "Primary server status in error, not connected." );
+                    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;
             }
-            else
+
+            // 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.
+            if ( log.isDebugEnabled() )
             {
-                if ( log.isDebugEnabled() )
-                {
-                    log.debug( "Primary server is null, not connected." );
-                }
+                log.debug( "Primary server status in error, not connected." );
             }
         }
         catch ( NumberFormatException ex )

Modified: commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/http/client/RemoteHttpCacheFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/http/client/RemoteHttpCacheFactory.java?rev=1583059&r1=1583058&r2=1583059&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/http/client/RemoteHttpCacheFactory.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/http/client/RemoteHttpCacheFactory.java Sat Mar 29 21:36:24 2014
@@ -33,8 +33,6 @@ import org.apache.commons.jcs.engine.beh
 import org.apache.commons.jcs.engine.behavior.ICompositeCacheManager;
 import org.apache.commons.jcs.engine.behavior.IElementSerializer;
 import org.apache.commons.jcs.engine.logging.behavior.ICacheEventLogger;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 
 /**
  * The RemoteCacheFactory creates remote caches for the cache hub. It returns a no wait facade which
@@ -45,9 +43,6 @@ import org.apache.commons.logging.LogFac
 public class RemoteHttpCacheFactory
     implements AuxiliaryCacheFactory
 {
-    /** The logger. */
-    private final static Log log = LogFactory.getLog( RemoteHttpCacheFactory.class );
-
     /** The name of this auxiliary */
     private String name;
 
@@ -79,14 +74,7 @@ public class RemoteHttpCacheFactory
         // TODO, use the configured value.
         rca.setRemoteType( RemoteType.LOCAL );
         ICache<K, V> ic = rcm.getCache( rca );
-        if ( ic != null )
-        {
-            noWaits.add( ic );
-        }
-        else
-        {
-            log.info( "noWait is null" );
-        }
+        noWaits.add( ic );
 
         @SuppressWarnings("unchecked") // No generic arrays in java
         RemoteCacheNoWait<K, V>[] rcnwArray = noWaits.toArray( new RemoteCacheNoWait[0] );

Modified: commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServer.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServer.java?rev=1583059&r1=1583058&r2=1583059&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServer.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServer.java Sat Mar 29 21:36:24 2014
@@ -93,7 +93,7 @@ public class RemoteCacheServer<K extends
         new Hashtable<String, CacheListeners<K, V>>();
 
     /** The central hub */
-    private CompositeCacheManager cacheManager;
+    private transient CompositeCacheManager cacheManager;
 
     /** relates listener id with a type */
     private final Hashtable<Long, RemoteType> idTypeMap = new Hashtable<Long, RemoteType>();
@@ -342,24 +342,13 @@ public class RemoteCacheServer<K extends
                 if ( !fromCluster || ( fromCluster && remoteCacheServerAttributes.isLocalClusterConsistency() ) )
                 {
                     ICacheEventQueue<K, V>[] qlist = getEventQList( cacheDesc, requesterId );
-
-                    if ( qlist != null )
+                    if ( log.isDebugEnabled() )
                     {
-                        if ( log.isDebugEnabled() )
-                        {
-                            log.debug( "qlist.length = " + qlist.length );
-                        }
-                        for ( int i = 0; i < qlist.length; i++ )
-                        {
-                            qlist[i].addPutEvent( item );
-                        }
+                        log.debug( "qlist.length = " + qlist.length );
                     }
-                    else
+                    for ( int i = 0; i < qlist.length; i++ )
                     {
-                        if ( log.isDebugEnabled() )
-                        {
-                            log.debug( "q list is null" );
-                        }
+                        qlist[i].addPutEvent( item );
                     }
                 }
             }

Modified: commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheStartupServlet.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheStartupServlet.java?rev=1583059&r1=1583058&r2=1583059&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheStartupServlet.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheStartupServlet.java Sat Mar 29 21:36:24 2014
@@ -210,8 +210,14 @@ public class RemoteCacheStartupServlet
 
         try
         {
+            String characterEncoding = response.getCharacterEncoding();
+            if (characterEncoding == null)
+            {
+                characterEncoding = "UTF-8";
+                response.setCharacterEncoding(characterEncoding);
+            }
             OutputStream os = response.getOutputStream();
-            os.write( stats.getBytes() );
+            os.write( stats.getBytes(characterEncoding) );
             os.close();
         }
         catch ( IOException e )

Modified: commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/CacheInfo.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/CacheInfo.java?rev=1583059&r1=1583058&r2=1583059&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/CacheInfo.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/CacheInfo.java Sat Mar 29 21:36:24 2014
@@ -40,8 +40,8 @@ public final class CacheInfo
      * TODO: may have some trouble in failover mode if the cache keeps its old
      * id. We may need to reset this when moving into failover.
      */
-    protected static VMID vmid = new VMID();
+    protected static final VMID vmid = new VMID();
 
     /** By default this is the hashcode of the VMID */
-    public static long listenerId = vmid.hashCode();
+    public static final long listenerId = vmid.hashCode();
 }

Modified: commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/ElementAttributes.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/ElementAttributes.java?rev=1583059&r1=1583058&r2=1583059&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/ElementAttributes.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/ElementAttributes.java Sat Mar 29 21:36:24 2014
@@ -19,11 +19,6 @@ package org.apache.commons.jcs.engine;
  * under the License.
  */
 
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
 import java.io.Serializable;
 import java.util.ArrayList;
 
@@ -43,7 +38,7 @@ import org.apache.commons.jcs.engine.con
  * </ol>
  */
 public class ElementAttributes
-    implements IElementAttributes, Serializable, Cloneable
+    implements IElementAttributes, Serializable
 {
     /** Don't change. */
     private static final long serialVersionUID = 7814990748035017441L;
@@ -151,42 +146,6 @@ public class ElementAttributes
     }
 
     /**
-     * Deep clone the attributes.
-     * <p>
-     * @return a clone of these attributes
-     */
-    public Object clone2()
-    {
-        try
-        {
-            ByteArrayOutputStream baos = new ByteArrayOutputStream( 100 );
-            ObjectOutputStream oos = new ObjectOutputStream( baos );
-            oos.writeObject( this );
-            byte buf[] = baos.toByteArray();
-            oos.close();
-
-            // deserialize byte array into ArrayList
-
-            ByteArrayInputStream bais = new ByteArrayInputStream( buf );
-            ObjectInputStream ois = new ObjectInputStream( bais );
-            ElementAttributes attr = (ElementAttributes) ois.readObject();
-            ois.close();
-
-            attr.createTime = System.currentTimeMillis();
-            return attr;
-        }
-        catch ( IOException e )
-        {
-            // swallow
-        }
-        catch (ClassNotFoundException e)
-        {
-            // swallow
-        }
-        return null;
-    }
-
-    /**
      * Sets the maxLife attribute of the IAttributes object.
      * <p>
      * @param mls The new MaxLifeSeconds value

Modified: commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/control/CompositeCacheConfigurator.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/control/CompositeCacheConfigurator.java?rev=1583059&r1=1583058&r2=1583059&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/control/CompositeCacheConfigurator.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/control/CompositeCacheConfigurator.java Sat Mar 29 21:36:24 2014
@@ -109,17 +109,32 @@ public class CompositeCacheConfigurator
     protected void doConfigure( String configFileName )
     {
         Properties props = new Properties();
+        FileInputStream istream = null;
+
         try
         {
-            FileInputStream istream = new FileInputStream( configFileName );
+            istream = new FileInputStream( configFileName );
             props.load( istream );
-            istream.close();
         }
         catch ( IOException e )
         {
             log.error( "Could not read configuration file, ignored: " + configFileName, e );
             return;
         }
+        finally
+        {
+            if (istream != null)
+            {
+                try
+                {
+                    istream.close();
+                }
+                catch (IOException e)
+                {
+                    log.error( "Could not close configuration file " + configFileName, e );
+                }
+            }
+        }
 
         // If we reach here, then the config file is alright.
         doConfigure( props );
@@ -155,8 +170,8 @@ public class CompositeCacheConfigurator
         // set default element attr
         setDefaultElementAttributes( properties );
 
-        // set up ssytem caches to be used by non system caches
-        // need to make sure there is no circuarity of reference
+        // set up system caches to be used by non system caches
+        // need to make sure there is no circularity of reference
         parseSystemRegions( properties );
 
         // setup preconfigured caches

Modified: commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/control/CompositeCacheManager.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/control/CompositeCacheManager.java?rev=1583059&r1=1583058&r2=1583059&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/control/CompositeCacheManager.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/control/CompositeCacheManager.java Sat Mar 29 21:36:24 2014
@@ -70,11 +70,8 @@ import org.apache.commons.logging.LogFac
  * It is recommended that you use the JCS convenience class for all cache access.
  */
 public class CompositeCacheManager
-    implements IRemoteCacheConstants, Serializable, ICompositeCacheManager, IShutdownObservable, IProvideScheduler
+    implements IRemoteCacheConstants, ICompositeCacheManager, IShutdownObservable, IProvideScheduler
 {
-    /** Don't change */
-    private static final long serialVersionUID = 7598584393134401756L;
-
     /** The logger */
     protected final static Log log = LogFactory.getLog( CompositeCacheManager.class );
 

Modified: commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/stats/StatElement.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/stats/StatElement.java?rev=1583059&r1=1583058&r2=1583059&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/stats/StatElement.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/stats/StatElement.java Sat Mar 29 21:36:24 2014
@@ -27,6 +27,9 @@ import org.apache.commons.jcs.engine.sta
 public class StatElement
     implements IStatElement
 {
+    /** Don't change */
+    private static final long serialVersionUID = -2982373725267618092L;
+
     /** name of the stat */
     private String name = null;
 

Modified: commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/stats/behavior/IStatElement.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/stats/behavior/IStatElement.java?rev=1583059&r1=1583058&r2=1583059&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/stats/behavior/IStatElement.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/stats/behavior/IStatElement.java Sat Mar 29 21:36:24 2014
@@ -1,5 +1,7 @@
 package org.apache.commons.jcs.engine.stats.behavior;
 
+import java.io.Serializable;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -22,7 +24,7 @@ package org.apache.commons.jcs.engine.st
 /**
  * IAuxiliaryCacheStats will hold these IStatElements.
  */
-public interface IStatElement
+public interface IStatElement extends Serializable
 {
     /**
      * Get the name of the stat element, ex. HitCount



Mime
View raw message