commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t.@apache.org
Subject svn commit: r1570993 [1/24] - in /commons/proper/jcs/trunk/src: assembly/ changes/ conf/ java/org/apache/commons/jcs/access/ java/org/apache/commons/jcs/access/exception/ java/org/apache/commons/jcs/admin/ java/org/apache/commons/jcs/auxiliary/ java/or...
Date Sun, 23 Feb 2014 10:37:52 GMT
Author: tv
Date: Sun Feb 23 10:37:48 2014
New Revision: 1570993

URL: http://svn.apache.org/r1570993
Log:
Strip trailing whitespace and add/fix missing license headers.
Thanks to Hennings code wrestler!

Modified:
    commons/proper/jcs/trunk/src/assembly/bin.xml
    commons/proper/jcs/trunk/src/assembly/src.xml
    commons/proper/jcs/trunk/src/changes/changes.xml
    commons/proper/jcs/trunk/src/conf/remote.cacheCEL.ccf
    commons/proper/jcs/trunk/src/conf/remote.cacheCEL_CSF.ccf
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/access/PartitionedCacheAccess.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/access/exception/ConfigurationException.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/admin/CacheElementInfo.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/admin/CacheRegionInfo.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/admin/JCSJMXBean.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/AbstractAuxiliaryCache.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/AbstractAuxiliaryCacheAttributes.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/AbstractAuxiliaryCacheEventLogging.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/AuxiliaryCacheAttributes.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/AuxiliaryCacheConfigurator.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/AuxiliaryCacheFactory.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/AbstractDiskCacheManager.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/file/FileDiskCacheAttributes.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/file/FileDiskCacheFactory.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/file/FileDiskCacheManager.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/indexed/IndexedDiskDumper.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/jdbc/JDBCDiskCacheAttributes.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/jdbc/JDBCDiskCachePoolAccessAttributes.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/jdbc/JDBCDiskCachePoolAccessFactory.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/disk/jdbc/JDBCDiskCachePoolAccessManager.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/LateralCacheAttributes.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/behavior/ILateralCacheAttributes.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPDiscoveryListener.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPDiscoveryListenerManager.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/TCPLateralCacheAttributes.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/behavior/ITCPLateralCacheAttributes.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/AbstractRemoteAuxiliaryCache.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/AbstractRemoteCacheListener.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/AbstractRemoteCacheNoWaitFacade.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/behavior/IRemoteCacheAttributes.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/behavior/IRemoteCacheConstants.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/behavior/IRemoteCacheDispatcher.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/http/behavior/IRemoteHttpCacheConstants.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/http/client/AbstractHttpClient.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/http/client/RemoteHttpCache.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/http/client/RemoteHttpCacheAttributes.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/http/client/RemoteHttpCacheClient.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/http/client/RemoteHttpCacheDispatcher.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/http/client/RemoteHttpCacheManager.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/http/client/RemoteHttpCacheMonitor.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/http/client/RemoteHttpClientListener.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/http/client/behavior/IRemoteHttpCacheClient.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/http/server/AbstractRemoteCacheService.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/http/server/RemoteCacheServiceAdaptor.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/http/server/RemoteHttpCacheServerAttributes.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/http/server/RemoteHttpCacheService.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/http/server/RemoteHttpCacheServlet.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/http/server/RemoteHttpCacheSeviceFactory.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/server/RegistryKeepAliveRunner.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/RemoteCacheServerAttributes.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/server/TimeoutConfigurableRMIScoketFactory.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/server/behavior/RemoteType.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/util/RemoteCacheRequestFactory.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/value/RemoteCacheRequest.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/value/RemoteCacheResponse.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/auxiliary/remote/value/RemoteRequestType.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/ZombieCacheServiceNonLocal.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/behavior/ICacheManager.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/behavior/ICacheServiceNonLocal.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/behavior/ICacheType.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/behavior/IProvideScheduler.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/behavior/IRequireScheduler.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/logging/CacheEvent.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/logging/CacheEventLoggerDebugLogger.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/logging/behavior/ICacheEvent.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/logging/behavior/ICacheEventLogger.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/match/KeyMatcherPatternImpl.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/match/behavior/IKeyMatcher.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/memory/AbstractDoubleLinkedListMemoryCache.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/memory/MemoryCache.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/memory/fifo/FIFOMemoryCache.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/engine/memory/lru/LHMLRUMemoryCache.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/date/DateFormatter.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/date/ThreadSafeSimpleDateFormat.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/discovery/DiscoveredService.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/discovery/UDPCleanupRunner.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/discovery/UDPDiscoveryAttributes.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/discovery/UDPDiscoveryInfo.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/discovery/behavior/IDiscoveryListener.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/key/KeyGeneratorUtil.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/net/AddressUtil.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/props/AbstractPropertyContainer.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/props/PropertiesFactory.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/props/PropertiesFactoryFileImpl.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/threadpool/PoolConfiguration.java
    commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/utils/zip/CompressionUtil.java
    commons/proper/jcs/trunk/src/site/site.xml
    commons/proper/jcs/trunk/src/test-conf/TestJCS-73.ccf
    commons/proper/jcs/trunk/src/test-conf/TestLHMLRUCache.ccf
    commons/proper/jcs/trunk/src/test-conf/TestRemoteCacheEventLogging.ccf
    commons/proper/jcs/trunk/src/test-conf/TestTCPLateralRemoveFilter.ccf
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/ConcurrentRemovalLoadTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/JCSConcurrentCacheAccessUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/TestLogConfigurationUtil.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/access/CacheAccessUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/admin/TestJMX.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/AuxiliaryCacheConfiguratorUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/MockAuxiliaryCache.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/MockAuxiliaryCacheAttributes.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/MockAuxiliaryCacheFactory.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/MockCacheEventLogger.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/AbstractDiskCacheUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/LRUMapJCSUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/PurgatoryElementUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskCacheConcurrentUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskCacheManagerUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskCacheSameRegionConcurrentUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskCacheUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/block/BlockDiskUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/file/FileDiskCacheFactoryUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/file/FileDiskCacheUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/indexed/IndexDiskCacheUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/indexed/IndexedDiskCacheConcurrentNoDeadLockUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/indexed/IndexedDiskCacheConcurrentUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/indexed/IndexedDiskCacheManagerUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/indexed/IndexedDiskCacheNoMemoryUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/indexed/IndexedDiskCacheSameRegionConcurrentUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/jdbc/HsqlSetupTableUtil.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManagerUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/jdbc/JDBCDiskCachePoolAccessManagerUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/jdbc/JDBCDiskCacheSharedPoolUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/jdbc/JDBCDiskCacheUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheConcurrentUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheHsqlBackedUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheManagerUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/lateral/LateralCacheNoWaitFacadeUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPDiscoveryListenerUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPIssueRemoveOnPutUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/MockRemoteCacheClient.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/MockRemoteCacheService.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/RemoteCacheNoWaitUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/http/client/MockRemoteCacheDispatcher.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/http/client/RemoteHttpCacheClientUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/http/client/RemoteHttpCacheDispatcherUniTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/http/client/RemoteHttpCacheManagerUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/http/client/RemoteHttpCacheManualTester.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/http/server/RemoteCacheServiceAdaptorUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/http/server/RemoteHttpCacheServiceUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/http/server/RemoteHttpCacheSeviceFactoryUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/server/BasicRemoteCacheClientServerUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/server/MockRMISocketFactory.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/server/RegistryKeepAliveRunnerUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/server/RemoteCacheServerFactoryUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/server/TimeoutConfigurableRMIScoketFactoryUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/auxiliary/remote/util/RemoteCacheRequestFactoryUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/engine/CacheEventQueueFactoryUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/engine/MockCacheEventQueue.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/engine/MockCacheServiceNonLocal.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/engine/control/CompositeCacheConfiguratorUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/engine/control/CompositeCacheDiskUsageUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/engine/control/MockElementSerializer.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/engine/logging/CacheEventLoggerDebugLoggerUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/engine/logging/MockCacheEventLogger.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/engine/match/KeyMatcherPatternImpllUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/engine/memory/MockMemoryCache.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/engine/memory/fifo/FIFOMemoryCacheUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/engine/memory/lru/LHMLRUMemoryCacheConcurrentUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/engine/memory/lru/LHMLRUMemoryCacheUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/engine/memory/mru/MRUMemoryCacheUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/utils/date/DateFormatterUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/utils/date/ThreadSafeSimpleDateFormatUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/utils/discovery/MockDiscoveryListener.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/utils/discovery/UDPDiscoverySenderUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/utils/discovery/UDPDiscoveryServiceUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/utils/key/KeyGeneratorUtilUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/utils/net/AddressUtilUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/utils/net/HostNameUtilUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/utils/serialization/StandardSerializerUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/utils/struct/DoubleLinkedListUnitTest.java
    commons/proper/jcs/trunk/src/test/org/apache/commons/jcs/utils/zip/CompressionUtilUnitTest.java

Modified: commons/proper/jcs/trunk/src/assembly/bin.xml
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/assembly/bin.xml?rev=1570993&r1=1570992&r2=1570993&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/assembly/bin.xml (original)
+++ commons/proper/jcs/trunk/src/assembly/bin.xml Sun Feb 23 10:37:48 2014
@@ -41,4 +41,4 @@
             <outputDirectory>apidocs</outputDirectory>
         </fileSet>
     </fileSets>
-</assembly>
\ No newline at end of file
+</assembly>

Modified: commons/proper/jcs/trunk/src/assembly/src.xml
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/assembly/src.xml?rev=1570993&r1=1570992&r2=1570993&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/assembly/src.xml (original)
+++ commons/proper/jcs/trunk/src/assembly/src.xml Sun Feb 23 10:37:48 2014
@@ -38,4 +38,4 @@
             <directory>src</directory>
         </fileSet>
     </fileSets>
-</assembly>
\ No newline at end of file
+</assembly>

Modified: commons/proper/jcs/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/changes/changes.xml?rev=1570993&r1=1570992&r2=1570993&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/changes/changes.xml (original)
+++ commons/proper/jcs/trunk/src/changes/changes.xml Sun Feb 23 10:37:48 2014
@@ -24,10 +24,10 @@
                 Update documentation to reflect generics and API changes
             </action>
             <action dev="tv" type="remove">
-                Remove dependency on commons-lang3 
+                Remove dependency on commons-lang3
             </action>
             <action dev="tv" type="add">
-                Add simple JMX monitoring feature by exposing the JCSAdminBean to JMX 
+                Add simple JMX monitoring feature by exposing the JCSAdminBean to JMX
             </action>
             <action dev="tv" type="update" issue="JCS-109" due-to="Xiong LIU">
                 Improve performance of BlockDisk.write(Serializable)
@@ -58,8 +58,8 @@
                 Use type-safe enums instead of integer constants to clean up the code.
             </action>
             <action dev="tv" type="fix" issue="JCS-91" due-to="Diego Rivera">
-                JCS fails to properly dispose of the lateral TCP listener thread. 
-                If a webapp that uses JCS lateral TCP cache is undeployed, the listener is left 
+                JCS fails to properly dispose of the lateral TCP listener thread.
+                If a webapp that uses JCS lateral TCP cache is undeployed, the listener is left
                 hanging with no hope for exit.
             </action>
             <action dev="tv" type="fix" issue="JCS-49" due-to="David Easley">
@@ -79,16 +79,16 @@
                 Concurrent cache access causes values loss.
             </action>
             <action dev="tv" type="fix" issue="JCS-77" due-to="Matt Morrisson">
-                NullPointerException thrown by IndexedDiskCache if IndexedDisk calls fail to 
+                NullPointerException thrown by IndexedDiskCache if IndexedDisk calls fail to
                 initialize.
             </action>
             <action dev="tv" type="fix" issue="JCS-90" due-to="Diego Rivera">
-                When issuing a shutDown() command, JCS fails to clean up the Queue Processor 
+                When issuing a shutDown() command, JCS fails to clean up the Queue Processor
                 thread.
             </action>
             <action dev="tv" type="fix" issue="JCS-89" due-to="Diego Rivera">
-                UDP Discovery fails to report correct IP address to peers for back-connect 
-                when InetAddress.getLocalHost() fails to return an externally-visible 
+                UDP Discovery fails to report correct IP address to peers for back-connect
+                when InetAddress.getLocalHost() fails to return an externally-visible
                 address (i.e. returns a local address)
             </action>
             <action dev="tv" type="fix" issue="JCS-88" due-to="Diego Rivera">

Modified: commons/proper/jcs/trunk/src/conf/remote.cacheCEL.ccf
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/conf/remote.cacheCEL.ccf?rev=1570993&r1=1570992&r2=1570993&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/conf/remote.cacheCEL.ccf (original)
+++ commons/proper/jcs/trunk/src/conf/remote.cacheCEL.ccf Sun Feb 23 10:37:48 2014
@@ -1,68 +1,68 @@
-# 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.
-# #############################################################
-# ################# REMOTE SERVER CONFIG  #####################
-# Registry used to register and provide the IRmiCacheService service.
-registry.host=localhost
-registry.port=1101
-remote.cache.service.port=1101
-remote.cluster.LocalClusterConsistency=true
-remote.cacheeventlogger=org.apache.commons.jcs.engine.logging.CacheEventLoggerDebugLogger
-remote.cacheeventlogger.attributes.logCategoryName=test.RCSEventLogCategory
-
-# #############################################################
-# ################# DEFAULT CACHE REGION  #####################
-# sets the default aux value for any non configured caches
-jcs.default=DC,RCluster
-jcs.default.cacheattributes=org.apache.commons.jcs.engine.CompositeCacheAttributes
-jcs.default.cacheattributes.MaxObjects=200000
-jcs.default.cacheattributes.MemoryCacheName=org.apache.commons.jcs.engine.memory.lru.LRUMemoryCache
-jcs.default.cacheattributes.UseMemoryShrinker=true
-jcs.default.cacheattributes.MaxMemoryIdleTimeSeconds=3600
-jcs.default.cacheattributes.ShrinkerIntervalSeconds=60
-jcs.default.elementattributes=org.apache.commons.jcs.engine.ElementAttributes
-jcs.default.elementattributes.IsEternal=false
-jcs.default.elementattributes.MaxLifeSeconds=7000
-jcs.default.elementattributes.IdleTime=1800
-jcs.default.elementattributes.IsSpool=true
-jcs.default.elementattributes.IsRemote=true
-jcs.default.elementattributes.IsLateral=true
-
-
-# #############################################################
-# ################# CACHE REGIONS AVAILABLE ###################
-jcs.region.testCache1=DC,RCluster
-jcs.region.testCache1.cacheattributes=org.apache.commons.jcs.engine.CompositeCacheAttributes
-jcs.region.testCache1.cacheattributes.MaxObjects=200002
-
-
-# #############################################################
-# ################# AUXILIARY CACHES AVAILABLE ################
-# server to update for clustering -- remote.cache2.ccf(1102)  and remote.cache3.ccf(1103)
-jcs.auxiliary.RCluster=org.apache.commons.jcs.auxiliary.remote.RemoteCacheFactory
-jcs.auxiliary.RCluster.attributes=org.apache.commons.jcs.auxiliary.remote.RemoteCacheAttributes
-jcs.auxiliary.RCluster.attributes.RemoteTypeName=CLUSTER
-jcs.auxiliary.RCluster.attributes.RemoveUponRemotePut=false
-jcs.auxiliary.RCluster.attributes.ClusterServers=localhost:1102
-jcs.auxiliary.RCluster.attributes.GetOnly=false
-jcs.auxiliary.RCluster.attributes.LocalClusterConsistency=true
-
-
-jcs.auxiliary.DC=org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory
-jcs.auxiliary.DC.attributes=org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes
-jcs.auxiliary.DC.attributes.DiskPath=@project_home@/raf/remote
-
+# 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.
+# #############################################################
+# ################# REMOTE SERVER CONFIG  #####################
+# Registry used to register and provide the IRmiCacheService service.
+registry.host=localhost
+registry.port=1101
+remote.cache.service.port=1101
+remote.cluster.LocalClusterConsistency=true
+remote.cacheeventlogger=org.apache.commons.jcs.engine.logging.CacheEventLoggerDebugLogger
+remote.cacheeventlogger.attributes.logCategoryName=test.RCSEventLogCategory
+
+# #############################################################
+# ################# DEFAULT CACHE REGION  #####################
+# sets the default aux value for any non configured caches
+jcs.default=DC,RCluster
+jcs.default.cacheattributes=org.apache.commons.jcs.engine.CompositeCacheAttributes
+jcs.default.cacheattributes.MaxObjects=200000
+jcs.default.cacheattributes.MemoryCacheName=org.apache.commons.jcs.engine.memory.lru.LRUMemoryCache
+jcs.default.cacheattributes.UseMemoryShrinker=true
+jcs.default.cacheattributes.MaxMemoryIdleTimeSeconds=3600
+jcs.default.cacheattributes.ShrinkerIntervalSeconds=60
+jcs.default.elementattributes=org.apache.commons.jcs.engine.ElementAttributes
+jcs.default.elementattributes.IsEternal=false
+jcs.default.elementattributes.MaxLifeSeconds=7000
+jcs.default.elementattributes.IdleTime=1800
+jcs.default.elementattributes.IsSpool=true
+jcs.default.elementattributes.IsRemote=true
+jcs.default.elementattributes.IsLateral=true
+
+
+# #############################################################
+# ################# CACHE REGIONS AVAILABLE ###################
+jcs.region.testCache1=DC,RCluster
+jcs.region.testCache1.cacheattributes=org.apache.commons.jcs.engine.CompositeCacheAttributes
+jcs.region.testCache1.cacheattributes.MaxObjects=200002
+
+
+# #############################################################
+# ################# AUXILIARY CACHES AVAILABLE ################
+# server to update for clustering -- remote.cache2.ccf(1102)  and remote.cache3.ccf(1103)
+jcs.auxiliary.RCluster=org.apache.commons.jcs.auxiliary.remote.RemoteCacheFactory
+jcs.auxiliary.RCluster.attributes=org.apache.commons.jcs.auxiliary.remote.RemoteCacheAttributes
+jcs.auxiliary.RCluster.attributes.RemoteTypeName=CLUSTER
+jcs.auxiliary.RCluster.attributes.RemoveUponRemotePut=false
+jcs.auxiliary.RCluster.attributes.ClusterServers=localhost:1102
+jcs.auxiliary.RCluster.attributes.GetOnly=false
+jcs.auxiliary.RCluster.attributes.LocalClusterConsistency=true
+
+
+jcs.auxiliary.DC=org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory
+jcs.auxiliary.DC.attributes=org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes
+jcs.auxiliary.DC.attributes.DiskPath=@project_home@/raf/remote
+

Modified: commons/proper/jcs/trunk/src/conf/remote.cacheCEL_CSF.ccf
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/conf/remote.cacheCEL_CSF.ccf?rev=1570993&r1=1570992&r2=1570993&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/conf/remote.cacheCEL_CSF.ccf (original)
+++ commons/proper/jcs/trunk/src/conf/remote.cacheCEL_CSF.ccf Sun Feb 23 10:37:48 2014
@@ -1,69 +1,69 @@
-# 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.
-# #############################################################
-# ################# REMOTE SERVER CONFIG  #####################
-# Registry used to register and provide the IRmiCacheService service.
-registry.host=localhost
-registry.port=1101
-jcs.remotecache.serverattributes.servicePort=1301
-jcs.remotecache.serverattributes.localClusterConsistency=true
-jcs.remotecache.customrmisocketfactory=org.apache.commons.jcs.auxiliary.remote.server.MockRMISocketFactory
-jcs.remotecache.cacheeventlogger=org.apache.commons.jcs.engine.logging.CacheEventLoggerDebugLogger
-jcs.remotecache.cacheeventlogger.attributes.logCategoryName=test.RCSEventLogCategory
-
-# #############################################################
-# ################# DEFAULT CACHE REGION  #####################
-# sets the default aux value for any non configured caches
-jcs.default=DC,RCluster
-jcs.default.cacheattributes=org.apache.commons.jcs.engine.CompositeCacheAttributes
-jcs.default.cacheattributes.MaxObjects=200000
-jcs.default.cacheattributes.MemoryCacheName=org.apache.commons.jcs.engine.memory.lru.LRUMemoryCache
-jcs.default.cacheattributes.UseMemoryShrinker=true
-jcs.default.cacheattributes.MaxMemoryIdleTimeSeconds=3600
-jcs.default.cacheattributes.ShrinkerIntervalSeconds=60
-jcs.default.elementattributes=org.apache.commons.jcs.engine.ElementAttributes
-jcs.default.elementattributes.IsEternal=false
-jcs.default.elementattributes.MaxLifeSeconds=7000
-jcs.default.elementattributes.IdleTime=1800
-jcs.default.elementattributes.IsSpool=true
-jcs.default.elementattributes.IsRemote=true
-jcs.default.elementattributes.IsLateral=true
-
-
-# #############################################################
-# ################# CACHE REGIONS AVAILABLE ###################
-jcs.region.testCache1=DC,RCluster
-jcs.region.testCache1.cacheattributes=org.apache.commons.jcs.engine.CompositeCacheAttributes
-jcs.region.testCache1.cacheattributes.MaxObjects=200002
-
-
-# #############################################################
-# ################# AUXILIARY CACHES AVAILABLE ################
-# server to update for clustering -- remote.cache2.ccf(1102)  and remote.cache3.ccf(1103)
-jcs.auxiliary.RCluster=org.apache.commons.jcs.auxiliary.remote.RemoteCacheFactory
-jcs.auxiliary.RCluster.attributes=org.apache.commons.jcs.auxiliary.remote.RemoteCacheAttributes
-jcs.auxiliary.RCluster.attributes.RemoteTypeName=CLUSTER
-jcs.auxiliary.RCluster.attributes.RemoveUponRemotePut=false
-jcs.auxiliary.RCluster.attributes.ClusterServers=localhost:1102
-jcs.auxiliary.RCluster.attributes.GetOnly=false
-jcs.auxiliary.RCluster.attributes.LocalClusterConsistency=true
-
-
-jcs.auxiliary.DC=org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory
-jcs.auxiliary.DC.attributes=org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes
-jcs.auxiliary.DC.attributes.DiskPath=@project_home@/raf/remote
-
+# 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.
+# #############################################################
+# ################# REMOTE SERVER CONFIG  #####################
+# Registry used to register and provide the IRmiCacheService service.
+registry.host=localhost
+registry.port=1101
+jcs.remotecache.serverattributes.servicePort=1301
+jcs.remotecache.serverattributes.localClusterConsistency=true
+jcs.remotecache.customrmisocketfactory=org.apache.commons.jcs.auxiliary.remote.server.MockRMISocketFactory
+jcs.remotecache.cacheeventlogger=org.apache.commons.jcs.engine.logging.CacheEventLoggerDebugLogger
+jcs.remotecache.cacheeventlogger.attributes.logCategoryName=test.RCSEventLogCategory
+
+# #############################################################
+# ################# DEFAULT CACHE REGION  #####################
+# sets the default aux value for any non configured caches
+jcs.default=DC,RCluster
+jcs.default.cacheattributes=org.apache.commons.jcs.engine.CompositeCacheAttributes
+jcs.default.cacheattributes.MaxObjects=200000
+jcs.default.cacheattributes.MemoryCacheName=org.apache.commons.jcs.engine.memory.lru.LRUMemoryCache
+jcs.default.cacheattributes.UseMemoryShrinker=true
+jcs.default.cacheattributes.MaxMemoryIdleTimeSeconds=3600
+jcs.default.cacheattributes.ShrinkerIntervalSeconds=60
+jcs.default.elementattributes=org.apache.commons.jcs.engine.ElementAttributes
+jcs.default.elementattributes.IsEternal=false
+jcs.default.elementattributes.MaxLifeSeconds=7000
+jcs.default.elementattributes.IdleTime=1800
+jcs.default.elementattributes.IsSpool=true
+jcs.default.elementattributes.IsRemote=true
+jcs.default.elementattributes.IsLateral=true
+
+
+# #############################################################
+# ################# CACHE REGIONS AVAILABLE ###################
+jcs.region.testCache1=DC,RCluster
+jcs.region.testCache1.cacheattributes=org.apache.commons.jcs.engine.CompositeCacheAttributes
+jcs.region.testCache1.cacheattributes.MaxObjects=200002
+
+
+# #############################################################
+# ################# AUXILIARY CACHES AVAILABLE ################
+# server to update for clustering -- remote.cache2.ccf(1102)  and remote.cache3.ccf(1103)
+jcs.auxiliary.RCluster=org.apache.commons.jcs.auxiliary.remote.RemoteCacheFactory
+jcs.auxiliary.RCluster.attributes=org.apache.commons.jcs.auxiliary.remote.RemoteCacheAttributes
+jcs.auxiliary.RCluster.attributes.RemoteTypeName=CLUSTER
+jcs.auxiliary.RCluster.attributes.RemoveUponRemotePut=false
+jcs.auxiliary.RCluster.attributes.ClusterServers=localhost:1102
+jcs.auxiliary.RCluster.attributes.GetOnly=false
+jcs.auxiliary.RCluster.attributes.LocalClusterConsistency=true
+
+
+jcs.auxiliary.DC=org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory
+jcs.auxiliary.DC.attributes=org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes
+jcs.auxiliary.DC.attributes.DiskPath=@project_home@/raf/remote
+

Modified: commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/access/PartitionedCacheAccess.java
URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/access/PartitionedCacheAccess.java?rev=1570993&r1=1570992&r2=1570993&view=diff
==============================================================================
--- commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/access/PartitionedCacheAccess.java (original)
+++ commons/proper/jcs/trunk/src/java/org/apache/commons/jcs/access/PartitionedCacheAccess.java Sun Feb 23 10:37:48 2014
@@ -1,826 +1,826 @@
-package org.apache.commons.jcs.access;
-
-/*
- * 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.Serializable;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.commons.jcs.JCS;
-import org.apache.commons.jcs.access.behavior.ICacheAccess;
-import org.apache.commons.jcs.access.exception.CacheException;
-import org.apache.commons.jcs.access.exception.ConfigurationException;
-import org.apache.commons.jcs.engine.behavior.ICacheElement;
-import org.apache.commons.jcs.engine.behavior.ICompositeCacheAttributes;
-import org.apache.commons.jcs.engine.behavior.IElementAttributes;
-import org.apache.commons.jcs.engine.stats.behavior.ICacheStats;
-import org.apache.commons.jcs.utils.props.AbstractPropertyContainer;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * TODO:  Add new methods that will allow you to provide a partition indicator for all major calls.  Add an interface as well.
- * <p>
- * This handles dividing puts and gets.
- * <p>
- * There are two required properties.
- * <p>
- * <ol>
- * <li>.numberOfPartitions</li>
- * <li>.partitionRegionNamePrefix</li>
- * </ol>
- * System properties will override values in the properties file.
- * <p>
- * We use a JCS region name for each partition that looks like this: partitionRegionNamePrefix + "_"
- * + partitionNumber. The number is 0 indexed based.
- * <p>
- * @author Aaron Smuts
- */
-public class PartitionedCacheAccess<K extends Serializable, V extends Serializable>
-    extends AbstractPropertyContainer
-    implements ICacheAccess<K, V>
-{
-    /** the logger. */
-    private static final Log log = LogFactory.getLog( PartitionedCacheAccess.class );
-
-    /** The number of partitions. */
-    private int numberOfPartitions = 1;
-
-    /**
-     * We use a JCS region name for each partition that looks like this: partitionRegionNamePrefix +
-     * "_" + partitionNumber
-     */
-    private String partitionRegionNamePrefix;
-
-    /** An array of partitions built during initialization. */
-    private ICacheAccess<K, V>[] partitions;
-
-    /** Is the class initialized. */
-    private boolean initialized = false;
-
-    /** Sets default properties heading and group. */
-    public PartitionedCacheAccess()
-    {
-        setPropertiesHeading( "PartitionedCacheAccess" );
-        setPropertiesGroup( "cache" );
-    }
-
-    /**
-     * Puts the value into the appropriate cache partition.
-     * <p>
-     * @param key key
-     * @param object object
-     * @throws CacheException on configuration problem
-     */
-    public void put( K key, V object )
-        throws CacheException
-    {
-        if ( key == null || object == null )
-        {
-            log.warn( "Bad input key [" + key + "].  Cannot put null into the cache." );
-            return;
-        }
-
-        if (!ensureInit())
-        {
-            return;
-        }
-
-        int partition = getPartitionNumberForKey( key );
-        try
-        {
-            partitions[partition].put( key, object );
-        }
-        catch ( CacheException e )
-        {
-            log.error( "Problem putting value for key [" + key + "] in cache [" + partitions[partition] + "]" );
-            throw ( e );
-        }
-    }
-
-    /**
-     * Puts in cache if an item does not exist with the name in that region.
-     * <p>
-     * @param key
-     * @param object
-     * @throws CacheException
-     */
-    public void putSafe( K key, V object )
-        throws CacheException
-    {
-        if ( key == null || object == null )
-        {
-            log.warn( "Bad input key [" + key + "].  Cannot putSafe null into the cache." );
-        }
-
-        if (!ensureInit())
-        {
-            return;
-        }
-
-        int partition = getPartitionNumberForKey( key );
-        partitions[partition].putSafe( key, object );
-    }
-
-    /**
-     * Puts the value into the appropriate cache partition.
-     * <p>
-     * @param key key
-     * @param object object
-     * @param attr
-     * @throws CacheException on configuration problem
-     */
-    public void put( K key, V object, IElementAttributes attr )
-        throws CacheException
-    {
-        if ( key == null || object == null )
-        {
-            log.warn( "Bad input key [" + key + "].  Cannot put null into the cache." );
-            return;
-        }
-
-        if (!ensureInit())
-        {
-            return;
-        }
-
-        int partition = getPartitionNumberForKey( key );
-
-        try
-        {
-            partitions[partition].put( key, object, attr );
-        }
-        catch ( CacheException e )
-        {
-            log.error( "Problem putting value for key [" + key + "] in cache [" + partitions[partition] + "]" );
-            throw ( e );
-        }
-    }
-
-    /**
-     * Gets the object for the key from the desired partition.
-     * <p>
-     * @param key key
-     * @return result, null if not found.
-     */
-    public V get( K key )
-    {
-        if ( key == null )
-        {
-            log.warn( "Input key is null." );
-            return null;
-        }
-
-        if (!ensureInit())
-        {
-            return null;
-        }
-
-        int partition = getPartitionNumberForKey( key );
-
-        return partitions[partition].get( key );
-    }
-
-    /**
-     * Gets the ICacheElement<K, V> (the wrapped object) for the key from the desired partition.
-     * <p>
-     * @param key key
-     * @return result, null if not found.
-     */
-    public ICacheElement<K, V> getCacheElement( K key )
-    {
-        if ( key == null )
-        {
-            log.warn( "Input key is null." );
-            return null;
-        }
-
-        if (!ensureInit())
-        {
-            return null;
-        }
-
-        int partition = getPartitionNumberForKey( key );
-
-        return partitions[partition].getCacheElement( key );
-    }
-
-    /**
-     * This is a getMultiple. We try to group the keys so that we make as few calls as needed.
-     * <p>
-     * @param names
-     * @return Map of keys to ICacheElement
-     */
-    public Map<K, ICacheElement<K, V>> getCacheElements( Set<K> names )
-    {
-        if ( names == null )
-        {
-            log.warn( "Bad input names cannot be null." );
-            return Collections.emptyMap();
-        }
-
-        if (!ensureInit())
-        {
-            return Collections.emptyMap();
-        }
-
-        @SuppressWarnings("unchecked") // No generic arrays in java
-        Set<K>[] dividedNames = new Set[this.getNumberOfPartitions()];
-
-        for (K key : names)
-        {
-            int partition = getPartitionNumberForKey( key );
-            if ( dividedNames[partition] == null )
-            {
-                dividedNames[partition] = new HashSet<K>();
-            }
-            dividedNames[partition].add( key );
-        }
-
-        Map<K, ICacheElement<K, V>> result = new HashMap<K, ICacheElement<K, V>>();
-        for ( int i = 0; i < partitions.length; i++ )
-        {
-            if ( dividedNames[i] != null && !dividedNames[i].isEmpty() )
-            {
-                result.putAll( partitions[i].getCacheElements( dividedNames[i] ) );
-            }
-        }
-        return result;
-    }
-
-    /**
-     * This is tricky. Do we need to get from all the partitions?
-     * <p>
-     * If this interface took an object, we could use the hashcode to determine the partition. Then
-     * we could use the toString for the pattern.
-     * <p>
-     * @param pattern
-     * @return HashMap key to value
-     */
-    public Map<K, V> getMatching( String pattern )
-    {
-        if ( pattern == null )
-        {
-            log.warn( "Input pattern is null." );
-            return null;
-        }
-
-        if (!ensureInit())
-        {
-            return null;
-        }
-
-        Map<K, V> result = new HashMap<K, V>();
-        for (ICacheAccess<K, V> partition : partitions)
-        {
-            result.putAll( partition.getMatching( pattern ) );
-        }
-
-        return result;
-    }
-
-    /**
-     * This is tricky. Do we need to get from all the partitions?
-     * <p>
-     * @param pattern
-     * @return HashMap key to ICacheElement
-     */
-    public Map<K, ICacheElement<K, V>> getMatchingCacheElements( String pattern )
-    {
-        if ( pattern == null )
-        {
-            log.warn( "Input pattern is null." );
-            return null;
-        }
-
-        if (!ensureInit())
-        {
-            return null;
-        }
-
-        Map<K, ICacheElement<K, V>> result = new HashMap<K, ICacheElement<K, V>>();
-        for (ICacheAccess<K, V> partition : partitions)
-        {
-            result.putAll( partition.getMatchingCacheElements( pattern ) );
-        }
-        return result;
-    }
-
-    /**
-     * Removes the item from the appropriate partition.
-     * <p>
-     * @param key
-     * @throws CacheException
-     */
-    public void remove( K key )
-        throws CacheException
-    {
-        if ( key == null )
-        {
-            log.warn( "Input key is null. Cannot remove null from the cache." );
-            return;
-        }
-
-        if (!ensureInit())
-        {
-            return;
-        }
-
-        int partition = getPartitionNumberForKey( key );
-        try
-        {
-            partitions[partition].remove( key );
-        }
-        catch ( CacheException e )
-        {
-            log.error( "Problem removing value for key [" + key + "] in cache [" + partitions[partition] + "]" );
-            throw ( e );
-        }
-    }
-
-    /**
-     * Calls free on each partition.
-     * <p>
-     * @param numberToFree
-     * @return number removed
-     * @throws CacheException
-     */
-    public int freeMemoryElements( int numberToFree )
-        throws CacheException
-    {
-        if (!ensureInit())
-        {
-            return 0;
-        }
-
-        int count = 0;
-        for (ICacheAccess<K, V> partition : partitions)
-        {
-            count += partition.freeMemoryElements( numberToFree );
-        }
-        return count;
-    }
-
-    /**
-     * @return ICompositeCacheAttributes from the first partition.
-     */
-    public ICompositeCacheAttributes getCacheAttributes()
-    {
-        if (!ensureInit())
-        {
-            return null;
-        }
-
-        if ( partitions.length == 0 )
-        {
-            return null;
-        }
-
-        return partitions[0].getCacheAttributes();
-    }
-
-    /**
-     * @return IElementAttributes from the first partition.
-     * @throws CacheException
-     */
-    public IElementAttributes getDefaultElementAttributes()
-        throws CacheException
-    {
-        if (!ensureInit())
-        {
-            return null;
-        }
-
-        if ( partitions.length == 0 )
-        {
-            return null;
-        }
-
-        return partitions[0].getDefaultElementAttributes();
-    }
-
-    /**
-     * This is no more efficient than simply getting the cache element.
-     * <p>
-     * @param key
-     * @return IElementAttributes
-     * @throws CacheException
-     */
-    public IElementAttributes getElementAttributes( K key )
-        throws CacheException
-    {
-        if ( key == null )
-        {
-            log.warn( "Input key is null. Cannot getElementAttributes for null from the cache." );
-            return null;
-        }
-
-        if (!ensureInit())
-        {
-            return null;
-        }
-
-        int partition = getPartitionNumberForKey( key );
-
-        return partitions[partition].getElementAttributes( key );
-    }
-
-    /**
-     * Resets the attributes for this item. This has the same effect as an update, in most cases.
-     * None of the auxiliaries are optimized to do this more efficiently than a simply update.
-     * <p>
-     * @param key
-     * @param attributes
-     * @throws CacheException
-     */
-    public void resetElementAttributes( K key, IElementAttributes attributes )
-        throws CacheException
-    {
-        if ( key == null )
-        {
-            log.warn( "Input key is null. Cannot resetElementAttributes for null." );
-            return;
-        }
-
-        if (!ensureInit())
-        {
-            return;
-        }
-
-        int partition = getPartitionNumberForKey( key );
-
-        partitions[partition].resetElementAttributes( key, attributes );
-    }
-
-    /**
-     * Sets the attributes on all the partitions.
-     * <p>
-     * @param cattr
-     */
-    public void setCacheAttributes( ICompositeCacheAttributes cattr )
-    {
-        if (!ensureInit())
-        {
-            return;
-        }
-
-        for (ICacheAccess<K, V> partition : partitions)
-        {
-            partition.setCacheAttributes( cattr );
-        }
-    }
-
-    /**
-     * Removes all of the elements from a region.
-     * <p>
-     * @throws CacheException
-     */
-    public void clear()
-        throws CacheException
-    {
-        if (!ensureInit())
-        {
-            return;
-        }
-
-        for (ICacheAccess<K, V> partition : partitions)
-        {
-            partition.clear();
-        }
-    }
-
-    /**
-     * This method is does not reset the attributes for items already in the cache. It could
-     * potentially do this for items in memory, and maybe on disk (which would be slow) but not
-     * remote items. Rather than have unpredictable behavior, this method just sets the default
-     * attributes. Items subsequently put into the cache will use these defaults if they do not
-     * specify specific attributes.
-     * <p>
-     * @param attr the default attributes.
-     * @throws CacheException if something goes wrong.
-     */
-    public void setDefaultElementAttributes( IElementAttributes attr )
-        throws CacheException
-    {
-        if (!ensureInit())
-        {
-            return;
-        }
-
-        for (ICacheAccess<K, V> partition : partitions)
-        {
-            partition.setDefaultElementAttributes(attr);
-        }
-    }
-
-    /**
-     * This returns the ICacheStats object with information on this region and its auxiliaries.
-     * <p>
-     * This data can be formatted as needed.
-     * <p>
-     * @return ICacheStats
-     */
-    public ICacheStats getStatistics()
-    {
-        if (!ensureInit())
-        {
-            return null;
-        }
-
-        if ( partitions.length == 0 )
-        {
-            return null;
-        }
-
-        return partitions[0].getStatistics();
-    }
-
-    /**
-     * @return A String version of the stats.
-     */
-    public String getStats()
-    {
-        if (!ensureInit())
-        {
-            return "";
-        }
-
-        StringBuilder stats = new StringBuilder();
-        for (ICacheAccess<K, V> partition : partitions)
-        {
-            stats.append(partition.getStats());
-            stats.append("\n");
-        }
-
-        return stats.toString();
-    }
-
-    /**
-     * Dispose this region. Flushes objects to and closes auxiliary caches. This is a shutdown
-     * command!
-     * <p>
-     * To simply remove all elements from the region use clear().
-     */
-    public synchronized void dispose()
-    {
-        if (!ensureInit())
-        {
-            return;
-        }
-
-        for (ICacheAccess<K, V> partition : partitions)
-        {
-            partition.dispose();
-        }
-
-        initialized = false;
-    }
-
-    /**
-     * This expects a numeric key. If the key cannot be converted into a number, we will return 0.
-     * TODO we could md5 it or get the hashcode.
-     * <p>
-     * We determine the partition by taking the mod of the number of partitions.
-     * <p>
-     * @param key key
-     * @return the partition number.
-     */
-    protected int getPartitionNumberForKey( K key )
-    {
-        if ( key == null )
-        {
-            return 0;
-        }
-
-        long keyNum = getNumericValueForKey( key );
-
-        int partition = (int) ( keyNum % getNumberOfPartitions() );
-
-        if ( log.isDebugEnabled() )
-        {
-            log.debug( "Using partition [" + partition + "] for key [" + key + "]" );
-        }
-
-        return partition;
-    }
-
-    /**
-     * This can be overridden for special purposes.
-     * <p>
-     * @param key key
-     * @return long
-     */
-    public long getNumericValueForKey( K key )
-    {
-        String keyString = key.toString();
-        long keyNum = -1;
-        try
-        {
-            keyNum = Long.parseLong( keyString );
-        }
-        catch ( NumberFormatException e )
-        {
-            // THIS IS UGLY, but I can't think of a better failsafe right now.
-            keyNum = key.hashCode();
-            log.warn( "Couldn't convert [" + key + "] into a number.  Will use hashcode [" + keyNum + "]" );
-        }
-        return keyNum;
-    }
-
-    /**
-     * Initialize if we haven't already.
-     * <p>
-     * @throws ConfigurationException on configuration problem
-     */
-    protected synchronized boolean ensureInit()
-    {
-        if ( !initialized )
-        {
-            try
-            {
-                initialize();
-            }
-            catch ( ConfigurationException e )
-            {
-                log.error( "Couldn't configure partioned access.", e );
-                return false;
-            }
-        }
-
-        return true;
-    }
-
-    /**
-     * Use the partition prefix and the number of partitions to get JCS regions.
-     * <p>
-     * @throws ConfigurationException on configuration problem
-     */
-    protected synchronized void initialize()
-        throws ConfigurationException
-    {
-        ensureProperties();
-
-        @SuppressWarnings("unchecked") // No generic arrays in java
-        ICacheAccess<K, V>[] tempPartitions = new ICacheAccess[this.getNumberOfPartitions()];
-        for ( int i = 0; i < this.getNumberOfPartitions(); i++ )
-        {
-            String regionName = this.getPartitionRegionNamePrefix() + "_" + i;
-            try
-            {
-                tempPartitions[i] = JCS.getInstance( regionName );
-            }
-            catch ( CacheException e )
-            {
-                log.error( "Problem getting cache for region [" + regionName + "]" );
-            }
-        }
-
-        partitions = tempPartitions;
-        initialized = true;
-    }
-
-    /**
-     * Loads in the needed configuration settings. System properties are checked first. A system
-     * property will override local property value.
-     * <p>
-     * Loads the following JCS Cache specific properties:
-     * <ul>
-     * <li>heading.numberOfPartitions</li>
-     * <li>heading.partitionRegionNamePrefix</li>
-     * </ul>
-     * @throws ConfigurationException on configuration problem
-     */
-    @Override
-    protected void handleProperties()
-        throws ConfigurationException
-    {
-        // Number of Partitions.
-        String numberOfPartitionsPropertyName = this.getPropertiesHeading() + ".numberOfPartitions";
-        String numberOfPartitionsPropertyValue = getPropertyForName( numberOfPartitionsPropertyName, true );
-        try
-        {
-            this.setNumberOfPartitions( Integer.parseInt( numberOfPartitionsPropertyValue ) );
-        }
-        catch ( NumberFormatException e )
-        {
-            String message = "Could not convert [" + numberOfPartitionsPropertyValue + "] into a number for ["
-                + numberOfPartitionsPropertyName + "]";
-            log.error( message );
-            throw new ConfigurationException( message );
-        }
-
-        // Partition Name Prefix.
-        String prefixPropertyName = this.getPropertiesHeading() + ".partitionRegionNamePrefix";
-        String prefix = getPropertyForName( prefixPropertyName, true );
-        this.setPartitionRegionNamePrefix( prefix );
-    }
-
-    /**
-     * Checks the system properties before the properties.
-     * <p>
-     * @param propertyName name
-     * @param required is it required?
-     * @return the property value if one is found
-     * @throws ConfigurationException thrown if it is required and not found.
-     */
-    protected String getPropertyForName( String propertyName, boolean required )
-        throws ConfigurationException
-    {
-        String propertyValue = null;
-        propertyValue = System.getProperty( propertyName );
-        if ( propertyValue != null )
-        {
-            if ( log.isInfoEnabled() )
-            {
-                log.info( "Found system property override: Name [" + propertyName + "] Value [" + propertyValue + "]" );
-            }
-        }
-        else
-        {
-            propertyValue = this.getProperties().getProperty( propertyName );
-            if ( required && propertyValue == null )
-            {
-                String message = "Could not find required property [" + propertyName + "] in propertiesGroup ["
-                    + this.getPropertiesGroup() + "]";
-                log.error( message );
-                throw new ConfigurationException( message );
-            }
-            else
-            {
-                if ( log.isInfoEnabled() )
-                {
-                    log.info( "Name [" + propertyName + "] Value [" + propertyValue + "]" );
-                }
-            }
-        }
-        return propertyValue;
-    }
-
-    /**
-     * @param numberOfPartitions The numberOfPartitions to set.
-     */
-    protected void setNumberOfPartitions( int numberOfPartitions )
-    {
-        this.numberOfPartitions = numberOfPartitions;
-    }
-
-    /**
-     * @return Returns the numberOfPartitions.
-     */
-    protected int getNumberOfPartitions()
-    {
-        return numberOfPartitions;
-    }
-
-    /**
-     * @param partitionRegionNamePrefix The partitionRegionNamePrefix to set.
-     */
-    protected void setPartitionRegionNamePrefix( String partitionRegionNamePrefix )
-    {
-        this.partitionRegionNamePrefix = partitionRegionNamePrefix;
-    }
-
-    /**
-     * @return Returns the partitionRegionNamePrefix.
-     */
-    protected String getPartitionRegionNamePrefix()
-    {
-        return partitionRegionNamePrefix;
-    }
-
-    /**
-     * @param partitions The partitions to set.
-     */
-    protected void setPartitions( ICacheAccess<K, V>[] partitions )
-    {
-        this.partitions = partitions;
-    }
-
-    /**
-     * @return Returns the partitions.
-     */
-    protected ICacheAccess<K, V>[] getPartitions()
-    {
-        return partitions;
-    }
-}
+package org.apache.commons.jcs.access;
+
+/*
+ * 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.Serializable;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.commons.jcs.JCS;
+import org.apache.commons.jcs.access.behavior.ICacheAccess;
+import org.apache.commons.jcs.access.exception.CacheException;
+import org.apache.commons.jcs.access.exception.ConfigurationException;
+import org.apache.commons.jcs.engine.behavior.ICacheElement;
+import org.apache.commons.jcs.engine.behavior.ICompositeCacheAttributes;
+import org.apache.commons.jcs.engine.behavior.IElementAttributes;
+import org.apache.commons.jcs.engine.stats.behavior.ICacheStats;
+import org.apache.commons.jcs.utils.props.AbstractPropertyContainer;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * TODO:  Add new methods that will allow you to provide a partition indicator for all major calls.  Add an interface as well.
+ * <p>
+ * This handles dividing puts and gets.
+ * <p>
+ * There are two required properties.
+ * <p>
+ * <ol>
+ * <li>.numberOfPartitions</li>
+ * <li>.partitionRegionNamePrefix</li>
+ * </ol>
+ * System properties will override values in the properties file.
+ * <p>
+ * We use a JCS region name for each partition that looks like this: partitionRegionNamePrefix + "_"
+ * + partitionNumber. The number is 0 indexed based.
+ * <p>
+ * @author Aaron Smuts
+ */
+public class PartitionedCacheAccess<K extends Serializable, V extends Serializable>
+    extends AbstractPropertyContainer
+    implements ICacheAccess<K, V>
+{
+    /** the logger. */
+    private static final Log log = LogFactory.getLog( PartitionedCacheAccess.class );
+
+    /** The number of partitions. */
+    private int numberOfPartitions = 1;
+
+    /**
+     * We use a JCS region name for each partition that looks like this: partitionRegionNamePrefix +
+     * "_" + partitionNumber
+     */
+    private String partitionRegionNamePrefix;
+
+    /** An array of partitions built during initialization. */
+    private ICacheAccess<K, V>[] partitions;
+
+    /** Is the class initialized. */
+    private boolean initialized = false;
+
+    /** Sets default properties heading and group. */
+    public PartitionedCacheAccess()
+    {
+        setPropertiesHeading( "PartitionedCacheAccess" );
+        setPropertiesGroup( "cache" );
+    }
+
+    /**
+     * Puts the value into the appropriate cache partition.
+     * <p>
+     * @param key key
+     * @param object object
+     * @throws CacheException on configuration problem
+     */
+    public void put( K key, V object )
+        throws CacheException
+    {
+        if ( key == null || object == null )
+        {
+            log.warn( "Bad input key [" + key + "].  Cannot put null into the cache." );
+            return;
+        }
+
+        if (!ensureInit())
+        {
+            return;
+        }
+
+        int partition = getPartitionNumberForKey( key );
+        try
+        {
+            partitions[partition].put( key, object );
+        }
+        catch ( CacheException e )
+        {
+            log.error( "Problem putting value for key [" + key + "] in cache [" + partitions[partition] + "]" );
+            throw ( e );
+        }
+    }
+
+    /**
+     * Puts in cache if an item does not exist with the name in that region.
+     * <p>
+     * @param key
+     * @param object
+     * @throws CacheException
+     */
+    public void putSafe( K key, V object )
+        throws CacheException
+    {
+        if ( key == null || object == null )
+        {
+            log.warn( "Bad input key [" + key + "].  Cannot putSafe null into the cache." );
+        }
+
+        if (!ensureInit())
+        {
+            return;
+        }
+
+        int partition = getPartitionNumberForKey( key );
+        partitions[partition].putSafe( key, object );
+    }
+
+    /**
+     * Puts the value into the appropriate cache partition.
+     * <p>
+     * @param key key
+     * @param object object
+     * @param attr
+     * @throws CacheException on configuration problem
+     */
+    public void put( K key, V object, IElementAttributes attr )
+        throws CacheException
+    {
+        if ( key == null || object == null )
+        {
+            log.warn( "Bad input key [" + key + "].  Cannot put null into the cache." );
+            return;
+        }
+
+        if (!ensureInit())
+        {
+            return;
+        }
+
+        int partition = getPartitionNumberForKey( key );
+
+        try
+        {
+            partitions[partition].put( key, object, attr );
+        }
+        catch ( CacheException e )
+        {
+            log.error( "Problem putting value for key [" + key + "] in cache [" + partitions[partition] + "]" );
+            throw ( e );
+        }
+    }
+
+    /**
+     * Gets the object for the key from the desired partition.
+     * <p>
+     * @param key key
+     * @return result, null if not found.
+     */
+    public V get( K key )
+    {
+        if ( key == null )
+        {
+            log.warn( "Input key is null." );
+            return null;
+        }
+
+        if (!ensureInit())
+        {
+            return null;
+        }
+
+        int partition = getPartitionNumberForKey( key );
+
+        return partitions[partition].get( key );
+    }
+
+    /**
+     * Gets the ICacheElement<K, V> (the wrapped object) for the key from the desired partition.
+     * <p>
+     * @param key key
+     * @return result, null if not found.
+     */
+    public ICacheElement<K, V> getCacheElement( K key )
+    {
+        if ( key == null )
+        {
+            log.warn( "Input key is null." );
+            return null;
+        }
+
+        if (!ensureInit())
+        {
+            return null;
+        }
+
+        int partition = getPartitionNumberForKey( key );
+
+        return partitions[partition].getCacheElement( key );
+    }
+
+    /**
+     * This is a getMultiple. We try to group the keys so that we make as few calls as needed.
+     * <p>
+     * @param names
+     * @return Map of keys to ICacheElement
+     */
+    public Map<K, ICacheElement<K, V>> getCacheElements( Set<K> names )
+    {
+        if ( names == null )
+        {
+            log.warn( "Bad input names cannot be null." );
+            return Collections.emptyMap();
+        }
+
+        if (!ensureInit())
+        {
+            return Collections.emptyMap();
+        }
+
+        @SuppressWarnings("unchecked") // No generic arrays in java
+        Set<K>[] dividedNames = new Set[this.getNumberOfPartitions()];
+
+        for (K key : names)
+        {
+            int partition = getPartitionNumberForKey( key );
+            if ( dividedNames[partition] == null )
+            {
+                dividedNames[partition] = new HashSet<K>();
+            }
+            dividedNames[partition].add( key );
+        }
+
+        Map<K, ICacheElement<K, V>> result = new HashMap<K, ICacheElement<K, V>>();
+        for ( int i = 0; i < partitions.length; i++ )
+        {
+            if ( dividedNames[i] != null && !dividedNames[i].isEmpty() )
+            {
+                result.putAll( partitions[i].getCacheElements( dividedNames[i] ) );
+            }
+        }
+        return result;
+    }
+
+    /**
+     * This is tricky. Do we need to get from all the partitions?
+     * <p>
+     * If this interface took an object, we could use the hashcode to determine the partition. Then
+     * we could use the toString for the pattern.
+     * <p>
+     * @param pattern
+     * @return HashMap key to value
+     */
+    public Map<K, V> getMatching( String pattern )
+    {
+        if ( pattern == null )
+        {
+            log.warn( "Input pattern is null." );
+            return null;
+        }
+
+        if (!ensureInit())
+        {
+            return null;
+        }
+
+        Map<K, V> result = new HashMap<K, V>();
+        for (ICacheAccess<K, V> partition : partitions)
+        {
+            result.putAll( partition.getMatching( pattern ) );
+        }
+
+        return result;
+    }
+
+    /**
+     * This is tricky. Do we need to get from all the partitions?
+     * <p>
+     * @param pattern
+     * @return HashMap key to ICacheElement
+     */
+    public Map<K, ICacheElement<K, V>> getMatchingCacheElements( String pattern )
+    {
+        if ( pattern == null )
+        {
+            log.warn( "Input pattern is null." );
+            return null;
+        }
+
+        if (!ensureInit())
+        {
+            return null;
+        }
+
+        Map<K, ICacheElement<K, V>> result = new HashMap<K, ICacheElement<K, V>>();
+        for (ICacheAccess<K, V> partition : partitions)
+        {
+            result.putAll( partition.getMatchingCacheElements( pattern ) );
+        }
+        return result;
+    }
+
+    /**
+     * Removes the item from the appropriate partition.
+     * <p>
+     * @param key
+     * @throws CacheException
+     */
+    public void remove( K key )
+        throws CacheException
+    {
+        if ( key == null )
+        {
+            log.warn( "Input key is null. Cannot remove null from the cache." );
+            return;
+        }
+
+        if (!ensureInit())
+        {
+            return;
+        }
+
+        int partition = getPartitionNumberForKey( key );
+        try
+        {
+            partitions[partition].remove( key );
+        }
+        catch ( CacheException e )
+        {
+            log.error( "Problem removing value for key [" + key + "] in cache [" + partitions[partition] + "]" );
+            throw ( e );
+        }
+    }
+
+    /**
+     * Calls free on each partition.
+     * <p>
+     * @param numberToFree
+     * @return number removed
+     * @throws CacheException
+     */
+    public int freeMemoryElements( int numberToFree )
+        throws CacheException
+    {
+        if (!ensureInit())
+        {
+            return 0;
+        }
+
+        int count = 0;
+        for (ICacheAccess<K, V> partition : partitions)
+        {
+            count += partition.freeMemoryElements( numberToFree );
+        }
+        return count;
+    }
+
+    /**
+     * @return ICompositeCacheAttributes from the first partition.
+     */
+    public ICompositeCacheAttributes getCacheAttributes()
+    {
+        if (!ensureInit())
+        {
+            return null;
+        }
+
+        if ( partitions.length == 0 )
+        {
+            return null;
+        }
+
+        return partitions[0].getCacheAttributes();
+    }
+
+    /**
+     * @return IElementAttributes from the first partition.
+     * @throws CacheException
+     */
+    public IElementAttributes getDefaultElementAttributes()
+        throws CacheException
+    {
+        if (!ensureInit())
+        {
+            return null;
+        }
+
+        if ( partitions.length == 0 )
+        {
+            return null;
+        }
+
+        return partitions[0].getDefaultElementAttributes();
+    }
+
+    /**
+     * This is no more efficient than simply getting the cache element.
+     * <p>
+     * @param key
+     * @return IElementAttributes
+     * @throws CacheException
+     */
+    public IElementAttributes getElementAttributes( K key )
+        throws CacheException
+    {
+        if ( key == null )
+        {
+            log.warn( "Input key is null. Cannot getElementAttributes for null from the cache." );
+            return null;
+        }
+
+        if (!ensureInit())
+        {
+            return null;
+        }
+
+        int partition = getPartitionNumberForKey( key );
+
+        return partitions[partition].getElementAttributes( key );
+    }
+
+    /**
+     * Resets the attributes for this item. This has the same effect as an update, in most cases.
+     * None of the auxiliaries are optimized to do this more efficiently than a simply update.
+     * <p>
+     * @param key
+     * @param attributes
+     * @throws CacheException
+     */
+    public void resetElementAttributes( K key, IElementAttributes attributes )
+        throws CacheException
+    {
+        if ( key == null )
+        {
+            log.warn( "Input key is null. Cannot resetElementAttributes for null." );
+            return;
+        }
+
+        if (!ensureInit())
+        {
+            return;
+        }
+
+        int partition = getPartitionNumberForKey( key );
+
+        partitions[partition].resetElementAttributes( key, attributes );
+    }
+
+    /**
+     * Sets the attributes on all the partitions.
+     * <p>
+     * @param cattr
+     */
+    public void setCacheAttributes( ICompositeCacheAttributes cattr )
+    {
+        if (!ensureInit())
+        {
+            return;
+        }
+
+        for (ICacheAccess<K, V> partition : partitions)
+        {
+            partition.setCacheAttributes( cattr );
+        }
+    }
+
+    /**
+     * Removes all of the elements from a region.
+     * <p>
+     * @throws CacheException
+     */
+    public void clear()
+        throws CacheException
+    {
+        if (!ensureInit())
+        {
+            return;
+        }
+
+        for (ICacheAccess<K, V> partition : partitions)
+        {
+            partition.clear();
+        }
+    }
+
+    /**
+     * This method is does not reset the attributes for items already in the cache. It could
+     * potentially do this for items in memory, and maybe on disk (which would be slow) but not
+     * remote items. Rather than have unpredictable behavior, this method just sets the default
+     * attributes. Items subsequently put into the cache will use these defaults if they do not
+     * specify specific attributes.
+     * <p>
+     * @param attr the default attributes.
+     * @throws CacheException if something goes wrong.
+     */
+    public void setDefaultElementAttributes( IElementAttributes attr )
+        throws CacheException
+    {
+        if (!ensureInit())
+        {
+            return;
+        }
+
+        for (ICacheAccess<K, V> partition : partitions)
+        {
+            partition.setDefaultElementAttributes(attr);
+        }
+    }
+
+    /**
+     * This returns the ICacheStats object with information on this region and its auxiliaries.
+     * <p>
+     * This data can be formatted as needed.
+     * <p>
+     * @return ICacheStats
+     */
+    public ICacheStats getStatistics()
+    {
+        if (!ensureInit())
+        {
+            return null;
+        }
+
+        if ( partitions.length == 0 )
+        {
+            return null;
+        }
+
+        return partitions[0].getStatistics();
+    }
+
+    /**
+     * @return A String version of the stats.
+     */
+    public String getStats()
+    {
+        if (!ensureInit())
+        {
+            return "";
+        }
+
+        StringBuilder stats = new StringBuilder();
+        for (ICacheAccess<K, V> partition : partitions)
+        {
+            stats.append(partition.getStats());
+            stats.append("\n");
+        }
+
+        return stats.toString();
+    }
+
+    /**
+     * Dispose this region. Flushes objects to and closes auxiliary caches. This is a shutdown
+     * command!
+     * <p>
+     * To simply remove all elements from the region use clear().
+     */
+    public synchronized void dispose()
+    {
+        if (!ensureInit())
+        {
+            return;
+        }
+
+        for (ICacheAccess<K, V> partition : partitions)
+        {
+            partition.dispose();
+        }
+
+        initialized = false;
+    }
+
+    /**
+     * This expects a numeric key. If the key cannot be converted into a number, we will return 0.
+     * TODO we could md5 it or get the hashcode.
+     * <p>
+     * We determine the partition by taking the mod of the number of partitions.
+     * <p>
+     * @param key key
+     * @return the partition number.
+     */
+    protected int getPartitionNumberForKey( K key )
+    {
+        if ( key == null )
+        {
+            return 0;
+        }
+
+        long keyNum = getNumericValueForKey( key );
+
+        int partition = (int) ( keyNum % getNumberOfPartitions() );
+
+        if ( log.isDebugEnabled() )
+        {
+            log.debug( "Using partition [" + partition + "] for key [" + key + "]" );
+        }
+
+        return partition;
+    }
+
+    /**
+     * This can be overridden for special purposes.
+     * <p>
+     * @param key key
+     * @return long
+     */
+    public long getNumericValueForKey( K key )
+    {
+        String keyString = key.toString();
+        long keyNum = -1;
+        try
+        {
+            keyNum = Long.parseLong( keyString );
+        }
+        catch ( NumberFormatException e )
+        {
+            // THIS IS UGLY, but I can't think of a better failsafe right now.
+            keyNum = key.hashCode();
+            log.warn( "Couldn't convert [" + key + "] into a number.  Will use hashcode [" + keyNum + "]" );
+        }
+        return keyNum;
+    }
+
+    /**
+     * Initialize if we haven't already.
+     * <p>
+     * @throws ConfigurationException on configuration problem
+     */
+    protected synchronized boolean ensureInit()
+    {
+        if ( !initialized )
+        {
+            try
+            {
+                initialize();
+            }
+            catch ( ConfigurationException e )
+            {
+                log.error( "Couldn't configure partioned access.", e );
+                return false;
+            }
+        }
+
+        return true;
+    }
+
+    /**
+     * Use the partition prefix and the number of partitions to get JCS regions.
+     * <p>
+     * @throws ConfigurationException on configuration problem
+     */
+    protected synchronized void initialize()
+        throws ConfigurationException
+    {
+        ensureProperties();
+
+        @SuppressWarnings("unchecked") // No generic arrays in java
+        ICacheAccess<K, V>[] tempPartitions = new ICacheAccess[this.getNumberOfPartitions()];
+        for ( int i = 0; i < this.getNumberOfPartitions(); i++ )
+        {
+            String regionName = this.getPartitionRegionNamePrefix() + "_" + i;
+            try
+            {
+                tempPartitions[i] = JCS.getInstance( regionName );
+            }
+            catch ( CacheException e )
+            {
+                log.error( "Problem getting cache for region [" + regionName + "]" );
+            }
+        }
+
+        partitions = tempPartitions;
+        initialized = true;
+    }
+
+    /**
+     * Loads in the needed configuration settings. System properties are checked first. A system
+     * property will override local property value.
+     * <p>
+     * Loads the following JCS Cache specific properties:
+     * <ul>
+     * <li>heading.numberOfPartitions</li>
+     * <li>heading.partitionRegionNamePrefix</li>
+     * </ul>
+     * @throws ConfigurationException on configuration problem
+     */
+    @Override
+    protected void handleProperties()
+        throws ConfigurationException
+    {
+        // Number of Partitions.
+        String numberOfPartitionsPropertyName = this.getPropertiesHeading() + ".numberOfPartitions";
+        String numberOfPartitionsPropertyValue = getPropertyForName( numberOfPartitionsPropertyName, true );
+        try
+        {
+            this.setNumberOfPartitions( Integer.parseInt( numberOfPartitionsPropertyValue ) );
+        }
+        catch ( NumberFormatException e )
+        {
+            String message = "Could not convert [" + numberOfPartitionsPropertyValue + "] into a number for ["
+                + numberOfPartitionsPropertyName + "]";
+            log.error( message );
+            throw new ConfigurationException( message );
+        }
+
+        // Partition Name Prefix.
+        String prefixPropertyName = this.getPropertiesHeading() + ".partitionRegionNamePrefix";
+        String prefix = getPropertyForName( prefixPropertyName, true );
+        this.setPartitionRegionNamePrefix( prefix );
+    }
+
+    /**
+     * Checks the system properties before the properties.
+     * <p>
+     * @param propertyName name
+     * @param required is it required?
+     * @return the property value if one is found
+     * @throws ConfigurationException thrown if it is required and not found.
+     */
+    protected String getPropertyForName( String propertyName, boolean required )
+        throws ConfigurationException
+    {
+        String propertyValue = null;
+        propertyValue = System.getProperty( propertyName );
+        if ( propertyValue != null )
+        {
+            if ( log.isInfoEnabled() )
+            {
+                log.info( "Found system property override: Name [" + propertyName + "] Value [" + propertyValue + "]" );
+            }
+        }
+        else
+        {
+            propertyValue = this.getProperties().getProperty( propertyName );
+            if ( required && propertyValue == null )
+            {
+                String message = "Could not find required property [" + propertyName + "] in propertiesGroup ["
+                    + this.getPropertiesGroup() + "]";
+                log.error( message );
+                throw new ConfigurationException( message );
+            }
+            else
+            {
+                if ( log.isInfoEnabled() )
+                {
+                    log.info( "Name [" + propertyName + "] Value [" + propertyValue + "]" );
+                }
+            }
+        }
+        return propertyValue;
+    }
+
+    /**
+     * @param numberOfPartitions The numberOfPartitions to set.
+     */
+    protected void setNumberOfPartitions( int numberOfPartitions )
+    {
+        this.numberOfPartitions = numberOfPartitions;
+    }
+
+    /**
+     * @return Returns the numberOfPartitions.
+     */
+    protected int getNumberOfPartitions()
+    {
+        return numberOfPartitions;
+    }
+
+    /**
+     * @param partitionRegionNamePrefix The partitionRegionNamePrefix to set.
+     */
+    protected void setPartitionRegionNamePrefix( String partitionRegionNamePrefix )
+    {
+        this.partitionRegionNamePrefix = partitionRegionNamePrefix;
+    }
+
+    /**
+     * @return Returns the partitionRegionNamePrefix.
+     */
+    protected String getPartitionRegionNamePrefix()
+    {
+        return partitionRegionNamePrefix;
+    }
+
+    /**
+     * @param partitions The partitions to set.
+     */
+    protected void setPartitions( ICacheAccess<K, V>[] partitions )
+    {
+        this.partitions = partitions;
+    }
+
+    /**
+     * @return Returns the partitions.
+     */
+    protected ICacheAccess<K, V>[] getPartitions()
+    {
+        return partitions;
+    }
+}



Mime
View raw message