The following document contains the results of RAT (Release Audit Tool).
*****************************************************
Summary
-------
Notes: 5
Binaries: 0
Archives: 6
Standards: 710
Apache Licensed: 630
Generated Documents: 0
JavaDocs are generated and so license header is optional
Generated files do not required license headers
80 Unknown Licenses
*******************************
Archives (+ indicates readable, $ unreadable):
+ sandbox/yajcache/lib/commons-beanutils-core-1.7.0.jar
+ sandbox/yajcache/lib/commons-collections-3.1.jar
+ sandbox/yajcache/lib/commons-lang-2.0.jar
+ sandbox/yajcache/lib/commons-logging-1.0.4.jar
+ sandbox/yajcache/lib/junit-3.8.1.jar
+ sandbox/yajcache/lib/log4j-1.2.9.jar
*****************************************************
Files with AL headers will be marked L
Binary files (which do not require AL headers) will be marked B
Compressed archives will be marked A
Notices, licenses etc will be marked N
AL ant_eclipse.xml
AL ant_eclipse_jar_install.xml
!????? ant_eclipse_resources.launch
AL auxiliary-builds/javagroups/project.properties
AL auxiliary-builds/javagroups/project.xml
AL auxiliary-builds/javagroups/src/java/org/apache/jcs/auxiliary/javagroups/JavaGroupsCache.java
AL auxiliary-builds/javagroups/src/java/org/apache/jcs/auxiliary/javagroups/JavaGroupsCacheAttributes.java
AL auxiliary-builds/javagroups/src/java/org/apache/jcs/auxiliary/javagroups/JavaGroupsCacheFactory.java
AL auxiliary-builds/javagroups/src/test/org/apache/jcs/auxiliary/javagroups/JavaGroupsCacheTest.ccf
AL auxiliary-builds/javagroups/src/test/org/apache/jcs/auxiliary/javagroups/JavaGroupsCacheTest.java
AL auxiliary-builds/javagroups/src/test/org/apache/jcs/auxiliary/javagroups/JavaGroupsCacheWithGetTest.ccf
AL auxiliary-builds/javagroups/src/test/org/apache/jcs/auxiliary/javagroups/JavaGroupsCacheWithGetTest.java
AL auxiliary-builds/jdk14/project.properties
AL auxiliary-builds/jdk14/project.xml
AL auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/javagroups/JavaGroupsCache.java
AL auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/javagroups/JavaGroupsCacheAttributes.java
AL auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/javagroups/JavaGroupsCacheFactory.java
AL auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/javagroups/behavior/IJGConstants.java
AL auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/javagroups/behavior/ILateralCacheJGListener.java
AL auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/javagroups/JGConnectionHolder.java
AL auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralCacheJGListener.java
AL auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralGroupCacheJGListener.java
AL auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralJGCacheFactory.java
AL auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralJGCacheManager.java
AL auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralJGReceiver.java
AL auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralJGReceiverConnection.java
AL auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralJGSender.java
AL auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralJGService.java
AL auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/javagroups/utils/JGRpcOpener.java
AL auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/javagroups/utils/JGSocketOpener.java
AL auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheFactory.java
AL auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheManager.java
AL auxiliary-builds/jdk14/src/java/org/apache/jcs/engine/memory/lru/LHMLRUMemoryCache.java
AL auxiliary-builds/jdk14/src/test-conf/log4j.properties
AL checkstyle.xml
AL doap_jcs.rdf
N KEYS
N LICENSE.txt
!????? LICENSE.xerox
AL maven-eclipse-codestyle.xml
!????? mvn.log
N NOTICE
AL pom.xml
AL sandbox/yajcache/build-backup.xml
AL sandbox/yajcache/build.xml
A sandbox/yajcache/lib/commons-beanutils-core-1.7.0.jar
A sandbox/yajcache/lib/commons-collections-3.1.jar
A sandbox/yajcache/lib/commons-lang-2.0.jar
A sandbox/yajcache/lib/commons-logging-1.0.4.jar
A sandbox/yajcache/lib/junit-3.8.1.jar
A sandbox/yajcache/lib/log4j-1.2.9.jar
N sandbox/yajcache/LICENSE.txt
AL sandbox/yajcache/nbproject/build-impl.xml
AL sandbox/yajcache/nbproject/genfiles.properties
AL sandbox/yajcache/nbproject/profiler-build-impl.xml
AL sandbox/yajcache/nbproject/project.properties
AL sandbox/yajcache/nbproject/project.xml
N sandbox/yajcache/README.txt
AL sandbox/yajcache/src/org/apache/jcs/yajcache/beans/CacheChangeEvent.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/beans/CacheChangeSupport.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/beans/CacheClearEvent.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/beans/CachePutBeanCloneEvent.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/beans/CachePutBeanCopyEvent.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/beans/CachePutCopyEvent.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/beans/CachePutEvent.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/beans/CacheRemoveEvent.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/beans/ICacheChangeHandler.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/beans/ICacheChangeListener.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/config/PerCacheConfig.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/config/YajCacheConfig.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/core/CacheEntry.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/core/CacheManager.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/core/CacheType.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/core/ICache.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/core/ICacheSafe.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/core/SafeCacheWrapper.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/file/CacheFileContent.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/file/CacheFileContentCorrupted.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/file/CacheFileContentType.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/file/CacheFileDAO.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/file/CacheFileUtils.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/lang/annotation/CopyRightApache.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/lang/annotation/CopyRightType.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/lang/annotation/Immutable.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/lang/annotation/Implements.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/lang/annotation/JavaBean.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/lang/annotation/NonNullable.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/lang/annotation/TestOnly.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/lang/annotation/ThreadSafety.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/lang/annotation/ThreadSafetyType.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/lang/annotation/TODO.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/lang/annotation/UnsupportedOperation.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/lang/ref/IKey.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/lang/ref/KeyedRefCollector.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/lang/ref/KeyedSoftReference.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/lang/ref/KeyedWeakReference.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/soft/SoftRefCache.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/soft/SoftRefFileCache.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/util/BeanUtils.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/util/ClassUtils.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/util/CollectionUtils.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/util/concurrent/locks/IKeyedReadWriteLock.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/util/concurrent/locks/KeyedReadWriteLock.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/util/EqualsUtils.java
AL sandbox/yajcache/src/org/apache/jcs/yajcache/util/SerializeUtils.java
AL sandbox/yajcache/test/log4j.xml
AL sandbox/yajcache/test/org/apache/jcs/yajcache/core/CacheManagerTest.java
AL sandbox/yajcache/test/org/apache/jcs/yajcache/core/SafeCacheManagerTest.java
AL sandbox/yajcache/test/org/apache/jcs/yajcache/file/CacheFileDAOTest.java
AL sandbox/yajcache/test/org/apache/jcs/yajcache/file/FileContentTypeTest.java
AL sandbox/yajcache/test/org/apache/jcs/yajcache/lang/annotation/CopyRightApacheTest.java
AL sandbox/yajcache/test/org/apache/jcs/yajcache/soft/SoftRefCacheTest.java
AL sandbox/yajcache/test/org/apache/jcs/yajcache/soft/SoftRefFileCacheSafeTest.java
AL sandbox/yajcache/test/org/apache/jcs/yajcache/util/SerializeUtilsTest.java
AL sandbox/yajcache/test/org/apache/jcs/yajcache/util/TestSerializable.java
AL src/aspect/GetTiming.aj
AL src/aspect/JCSTrace.aj
AL src/aspect/org/apache/jcs/TraceJCS.aj
AL src/aspect/ShowSlow.aj
!????? src/aspect/Trace.aj
AL src/assembly/bin.xml
AL src/assembly/src.xml
AL src/changes/changes.xml
AL src/conf/cache.ccf
!????? src/conf/cache.policy
AL src/conf/cache2.ccf
AL src/conf/cache3.ccf
AL src/conf/cacheB.ccf
AL src/conf/cacheBDB.ccf
AL src/conf/cacheD10A.ccf
AL src/conf/cacheD10B.ccf
AL src/conf/cacheID.ccf
AL src/conf/cacheJG1.ccf
AL src/conf/cacheJG2.ccf
AL src/conf/cacheJG3.ccf
AL src/conf/cacheLMD1.ccf
AL src/conf/cacheNA.ccf
AL src/conf/cacheNA2.ccf
AL src/conf/cacheNA3.ccf
AL src/conf/cacheNB.ccf
AL src/conf/cacheRC.ccf
AL src/conf/cacheRC1.ccf
AL src/conf/cacheRC2.ccf
AL src/conf/cacheRC_CEL.ccf
AL src/conf/cacheRCN1.ccf
AL src/conf/cacheRCN2.ccf
AL src/conf/cacheRCSimple.ccf
AL src/conf/cacheRHTTP.ccf
AL src/conf/cacheTCP1.ccf
AL src/conf/cacheTCP2.ccf
AL src/conf/cacheTCP3.ccf
AL src/conf/cacheTCP4.ccf
AL src/conf/JCSAdminServlet.velocity.properties
AL src/conf/jcsutils.properties
AL src/conf/je.properties
AL src/conf/LocalStrings.properties
AL src/conf/log4j.properties
AL src/conf/logger.properties
AL src/conf/myjetty.xml
AL src/conf/myjetty2.xml
AL src/conf/remote.cache.ccf
AL src/conf/remote.cache2.ccf
AL src/conf/remote.cache3.ccf
AL src/conf/remote.cacheCEL.ccf
AL src/conf/remote.cacheCEL_CSF.ccf
AL src/conf/remote.cacheRS1.ccf
AL src/conf/remote.cacheRS2.ccf
AL src/conf/remote.tomcat.xml
AL src/conf/tomcat.xml
AL src/experimental/org/apache/jcs/auxiliary/lateral/http/broadcast/LateralCacheMulticaster.java
AL src/experimental/org/apache/jcs/auxiliary/lateral/http/broadcast/LateralCacheThread.java
AL src/experimental/org/apache/jcs/auxiliary/lateral/http/broadcast/LateralCacheUnicaster.java
AL src/experimental/org/apache/jcs/auxiliary/lateral/http/remove/DeleteLateralCacheMulticaster.java
AL src/experimental/org/apache/jcs/auxiliary/lateral/http/remove/DeleteLateralCacheUnicaster.java
AL src/experimental/org/apache/jcs/auxiliary/lateral/http/server/AbstractDeleteCacheServlet.java
AL src/experimental/org/apache/jcs/auxiliary/lateral/http/server/DeleteCacheServlet.java
AL src/experimental/org/apache/jcs/auxiliary/lateral/http/server/LateralCacheServletReciever.java
AL src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralCacheUDPListener.java
AL src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralGroupCacheUDPListener.java
AL src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralUDPReceiver.java
AL src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralUDPSender.java
AL src/experimental/org/apache/jcs/auxiliary/lateral/socket/udp/LateralUDPService.java
AL src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/behavior/ILateralCacheXMLRPCListener.java
AL src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/behavior/IXMLRPCConstants.java
AL src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralCacheXMLRPCListener.java
AL src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralGroupCacheXMLRPCListener.java
AL src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralXMLRPCReceiver.java
AL src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralXMLRPCReceiverConnection.java
AL src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralXMLRPCSender.java
AL src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/LateralXMLRPCService.java
AL src/experimental/org/apache/jcs/auxiliary/lateral/xmlrpc/utils/XMLRPCSocketOpener.java
AL src/experimental/org/apache/jcs/engine/memory/arc/ARCMemoryCache.java
AL src/experimental/org/apache/jcs/engine/memory/arc/ARCMemoryCacheUnitTest.java
AL src/java/org/apache/jcs/access/behavior/ICacheAccess.java
AL src/java/org/apache/jcs/access/behavior/IGroupCacheAccess.java
AL src/java/org/apache/jcs/access/CacheAccess.java
AL src/java/org/apache/jcs/access/exception/CacheException.java
!????? src/java/org/apache/jcs/access/exception/ConfigurationException.java
AL src/java/org/apache/jcs/access/exception/InvalidArgumentException.java
AL src/java/org/apache/jcs/access/exception/InvalidGroupException.java
AL src/java/org/apache/jcs/access/exception/InvalidHandleException.java
AL src/java/org/apache/jcs/access/exception/ObjectExistsException.java
AL src/java/org/apache/jcs/access/exception/ObjectNotFoundException.java
AL src/java/org/apache/jcs/access/GroupCacheAccess.java
AL src/java/org/apache/jcs/access/package.html
AL src/java/org/apache/jcs/access/PartitionedCacheAccess.java
AL src/java/org/apache/jcs/admin/CacheElementInfo.java
AL src/java/org/apache/jcs/admin/CacheRegionInfo.java
AL src/java/org/apache/jcs/admin/CountingOnlyOutputStream.java
AL src/java/org/apache/jcs/admin/JCSAdmin.jsp
AL src/java/org/apache/jcs/admin/JCSAdminBean.java
AL src/java/org/apache/jcs/admin/servlet/JCSAdminServlet.java
AL src/java/org/apache/jcs/admin/servlet/JCSAdminServletDefault.vm
AL src/java/org/apache/jcs/admin/servlet/JCSAdminServletRegionDetail.vm
!????? src/java/org/apache/jcs/auxiliary/AbstractAuxiliaryCache.java
AL src/java/org/apache/jcs/auxiliary/AbstractAuxiliaryCacheAttributes.java
!????? src/java/org/apache/jcs/auxiliary/AbstractAuxiliaryCacheEventLogging.java
AL src/java/org/apache/jcs/auxiliary/AuxiliaryCache.java
AL src/java/org/apache/jcs/auxiliary/AuxiliaryCacheAttributes.java
!????? src/java/org/apache/jcs/auxiliary/AuxiliaryCacheConfigurator.java
AL src/java/org/apache/jcs/auxiliary/AuxiliaryCacheFactory.java
AL src/java/org/apache/jcs/auxiliary/AuxiliaryCacheManager.java
AL src/java/org/apache/jcs/auxiliary/disk/AbstractDiskCache.java
AL src/java/org/apache/jcs/auxiliary/disk/AbstractDiskCacheAttributes.java
!????? src/java/org/apache/jcs/auxiliary/disk/AbstractDiskCacheManager.java
AL src/java/org/apache/jcs/auxiliary/disk/behavior/IDiskCacheAttributes.java
AL src/java/org/apache/jcs/auxiliary/disk/block/BlockDisk.java
AL src/java/org/apache/jcs/auxiliary/disk/block/BlockDiskCache.java
AL src/java/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheAttributes.java
AL src/java/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheFactory.java
AL src/java/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheManager.java
AL src/java/org/apache/jcs/auxiliary/disk/block/BlockDiskElementDescriptor.java
AL src/java/org/apache/jcs/auxiliary/disk/block/BlockDiskKeyStore.java
!????? src/java/org/apache/jcs/auxiliary/disk/file/FileDiskCache.java
!????? src/java/org/apache/jcs/auxiliary/disk/file/FileDiskCacheAttributes.java
!????? src/java/org/apache/jcs/auxiliary/disk/file/FileDiskCacheFactory.java
!????? src/java/org/apache/jcs/auxiliary/disk/file/FileDiskCacheManager.java
AL src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDisk.java
AL src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCache.java
AL src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheAttributes.java
AL src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheFactory.java
AL src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheManager.java
AL src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskDumper.java
AL src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskElementDescriptor.java
AL src/java/org/apache/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheFactory.java
AL src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCache.java
AL src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheAttributes.java
AL src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheFactory.java
AL src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManager.java
AL src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManagerAbstractTemplate.java
AL src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCachePoolAccess.java
!????? src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCachePoolAccessAttributes.java
!????? src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCachePoolAccessFactory.java
!????? src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCachePoolAccessManager.java
AL src/java/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCache.java
AL src/java/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheAttributes.java
AL src/java/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheFactory.java
AL src/java/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheManager.java
AL src/java/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLTableOptimizer.java
AL src/java/org/apache/jcs/auxiliary/disk/jdbc/mysql/util/ScheduleFormatException.java
AL src/java/org/apache/jcs/auxiliary/disk/jdbc/mysql/util/ScheduleParser.java
AL src/java/org/apache/jcs/auxiliary/disk/jdbc/ShrinkerThread.java
AL src/java/org/apache/jcs/auxiliary/disk/jdbc/TableState.java
AL src/java/org/apache/jcs/auxiliary/disk/LRUMapJCS.java
AL src/java/org/apache/jcs/auxiliary/disk/package.html
AL src/java/org/apache/jcs/auxiliary/disk/PurgatoryElement.java
AL src/java/org/apache/jcs/auxiliary/lateral/behavior/ILateralCacheAttributes.java
AL src/java/org/apache/jcs/auxiliary/lateral/behavior/ILateralCacheListener.java
AL src/java/org/apache/jcs/auxiliary/lateral/behavior/ILateralCacheManager.java
AL src/java/org/apache/jcs/auxiliary/lateral/behavior/ILateralCacheObserver.java
AL src/java/org/apache/jcs/auxiliary/lateral/LateralCache.java
AL src/java/org/apache/jcs/auxiliary/lateral/LateralCacheAbstractFactory.java
AL src/java/org/apache/jcs/auxiliary/lateral/LateralCacheAbstractManager.java
AL src/java/org/apache/jcs/auxiliary/lateral/LateralCacheAttributes.java
AL src/java/org/apache/jcs/auxiliary/lateral/LateralCacheInfo.java
AL src/java/org/apache/jcs/auxiliary/lateral/LateralCacheMonitor.java
AL src/java/org/apache/jcs/auxiliary/lateral/LateralCacheNoWait.java
AL src/java/org/apache/jcs/auxiliary/lateral/LateralCacheNoWaitFacade.java
AL src/java/org/apache/jcs/auxiliary/lateral/LateralCacheRestore.java
AL src/java/org/apache/jcs/auxiliary/lateral/LateralCacheWatchRepairable.java
AL src/java/org/apache/jcs/auxiliary/lateral/LateralCommand.java
AL src/java/org/apache/jcs/auxiliary/lateral/LateralElementDescriptor.java
AL src/java/org/apache/jcs/auxiliary/lateral/package.html
AL src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/behavior/ITCPLateralCacheAttributes.java
AL src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPCacheFactory.java
AL src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPCacheManager.java
!????? src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPDiscoveryListener.java
!????? src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPDiscoveryListenerManager.java
AL src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPListener.java
AL src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPSender.java
AL src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPService.java
AL src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/TCPLateralCacheAttributes.java
AL src/java/org/apache/jcs/auxiliary/lateral/ZombieLateralCacheWatch.java
AL src/java/org/apache/jcs/auxiliary/package.html
AL src/java/org/apache/jcs/auxiliary/remote/AbstractRemoteAuxiliaryCache.java
AL src/java/org/apache/jcs/auxiliary/remote/AbstractRemoteCacheListener.java
AL src/java/org/apache/jcs/auxiliary/remote/AbstractRemoteCacheNoWaitFacade.java
AL src/java/org/apache/jcs/auxiliary/remote/behavior/ICommonRemoteCacheAttributes.java
AL src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheAttributes.java
AL src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheClient.java
AL src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheConstants.java
!????? src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheDispatcher.java
AL src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheListener.java
AL src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheObserver.java
AL src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheServiceAdmin.java
AL src/java/org/apache/jcs/auxiliary/remote/CommonRemoteCacheAttributes.java
AL src/java/org/apache/jcs/auxiliary/remote/http/behavior/IRemoteHttpCacheConstants.java
AL src/java/org/apache/jcs/auxiliary/remote/http/client/AbstractHttpClient.java
AL src/java/org/apache/jcs/auxiliary/remote/http/client/behavior/IRemoteHttpCacheClient.java
AL src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCache.java
AL src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheAttributes.java
AL src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheClient.java
AL src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheDispatcher.java
AL src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheFactory.java
AL src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheManager.java
AL src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheMonitor.java
AL src/java/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpClientListener.java
AL src/java/org/apache/jcs/auxiliary/remote/http/server/AbstractRemoteCacheService.java
AL src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteCacheServiceAdaptor.java
AL src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheServerAttributes.java
AL src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheService.java
AL src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheServlet.java
AL src/java/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheSeviceFactory.java
AL src/java/org/apache/jcs/auxiliary/remote/package.html
AL src/java/org/apache/jcs/auxiliary/remote/RemoteCache.java
AL src/java/org/apache/jcs/auxiliary/remote/RemoteCacheAttributes.java
AL src/java/org/apache/jcs/auxiliary/remote/RemoteCacheFactory.java
AL src/java/org/apache/jcs/auxiliary/remote/RemoteCacheFailoverRunner.java
AL src/java/org/apache/jcs/auxiliary/remote/RemoteCacheListener.java
AL src/java/org/apache/jcs/auxiliary/remote/RemoteCacheManager.java
AL src/java/org/apache/jcs/auxiliary/remote/RemoteCacheMonitor.java
AL src/java/org/apache/jcs/auxiliary/remote/RemoteCacheNoWait.java
AL src/java/org/apache/jcs/auxiliary/remote/RemoteCacheNoWaitFacade.java
AL src/java/org/apache/jcs/auxiliary/remote/RemoteCacheRestore.java
AL src/java/org/apache/jcs/auxiliary/remote/RemoteCacheWatchRepairable.java
AL src/java/org/apache/jcs/auxiliary/remote/RemoteUtils.java
AL src/java/org/apache/jcs/auxiliary/remote/server/behavior/IRemoteCacheServerAttributes.java
AL src/java/org/apache/jcs/auxiliary/remote/server/behavior/RemoteType.java
!????? src/java/org/apache/jcs/auxiliary/remote/server/RegistryKeepAliveRunner.java
AL src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServer.java
AL src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerAttributes.java
AL src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerFactory.java
AL src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerInfo.java
AL src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheStartupServlet.java
!????? src/java/org/apache/jcs/auxiliary/remote/server/TimeoutConfigurableRMIScoketFactory.java
!????? src/java/org/apache/jcs/auxiliary/remote/util/RemoteCacheRequestFactory.java
!????? src/java/org/apache/jcs/auxiliary/remote/value/RemoteCacheRequest.java
!????? src/java/org/apache/jcs/auxiliary/remote/value/RemoteCacheResponse.java
!????? src/java/org/apache/jcs/auxiliary/remote/value/RemoteRequestType.java
AL src/java/org/apache/jcs/auxiliary/remote/ZombieRemoteCacheWatch.java
AL src/java/org/apache/jcs/engine/AbstractCacheEventQueue.java
AL src/java/org/apache/jcs/engine/behavior/ICache.java
AL src/java/org/apache/jcs/engine/behavior/ICacheElement.java
AL src/java/org/apache/jcs/engine/behavior/ICacheElementSerialized.java
AL src/java/org/apache/jcs/engine/behavior/ICacheEventQueue.java
AL src/java/org/apache/jcs/engine/behavior/ICacheListener.java
AL src/java/org/apache/jcs/engine/behavior/ICacheManager.java
AL src/java/org/apache/jcs/engine/behavior/ICacheObserver.java
AL src/java/org/apache/jcs/engine/behavior/ICacheRestore.java
AL src/java/org/apache/jcs/engine/behavior/ICacheService.java
AL src/java/org/apache/jcs/engine/behavior/ICacheServiceAdmin.java
AL src/java/org/apache/jcs/engine/behavior/ICacheServiceNonLocal.java
AL src/java/org/apache/jcs/engine/behavior/ICacheType.java
AL src/java/org/apache/jcs/engine/behavior/ICompositeCacheAttributes.java
AL src/java/org/apache/jcs/engine/behavior/ICompositeCacheManager.java
AL src/java/org/apache/jcs/engine/behavior/IElementAttributes.java
AL src/java/org/apache/jcs/engine/behavior/IElementSerializer.java
AL src/java/org/apache/jcs/engine/behavior/IProvideScheduler.java
AL src/java/org/apache/jcs/engine/behavior/IRequireScheduler.java
AL src/java/org/apache/jcs/engine/behavior/IShutdownObservable.java
AL src/java/org/apache/jcs/engine/behavior/IShutdownObserver.java
AL src/java/org/apache/jcs/engine/behavior/IZombie.java
AL src/java/org/apache/jcs/engine/behavior/package.html
AL src/java/org/apache/jcs/engine/CacheAdaptor.java
AL src/java/org/apache/jcs/engine/CacheConstants.java
AL src/java/org/apache/jcs/engine/CacheElement.java
AL src/java/org/apache/jcs/engine/CacheElementSerialized.java
AL src/java/org/apache/jcs/engine/CacheEventQueue.java
AL src/java/org/apache/jcs/engine/CacheEventQueueFactory.java
AL src/java/org/apache/jcs/engine/CacheGroup.java
AL src/java/org/apache/jcs/engine/CacheInfo.java
AL src/java/org/apache/jcs/engine/CacheListeners.java
AL src/java/org/apache/jcs/engine/CacheStatus.java
AL src/java/org/apache/jcs/engine/CacheWatchRepairable.java
AL src/java/org/apache/jcs/engine/CompositeCacheAttributes.java
AL src/java/org/apache/jcs/engine/control/CompositeCache.java
AL src/java/org/apache/jcs/engine/control/CompositeCacheConfigurator.java
AL src/java/org/apache/jcs/engine/control/CompositeCacheManager.java
AL src/java/org/apache/jcs/engine/control/event/behavior/ElementEventType.java
AL src/java/org/apache/jcs/engine/control/event/behavior/IElementEvent.java
AL src/java/org/apache/jcs/engine/control/event/behavior/IElementEventHandler.java
AL src/java/org/apache/jcs/engine/control/event/behavior/IElementEventQueue.java
AL src/java/org/apache/jcs/engine/control/event/ElementEvent.java
AL src/java/org/apache/jcs/engine/control/event/ElementEventQueue.java
AL src/java/org/apache/jcs/engine/control/group/GroupAttrName.java
AL src/java/org/apache/jcs/engine/control/group/GroupId.java
AL src/java/org/apache/jcs/engine/control/package.html
AL src/java/org/apache/jcs/engine/ElementAttributes.java
!????? src/java/org/apache/jcs/engine/logging/behavior/ICacheEvent.java
!????? src/java/org/apache/jcs/engine/logging/behavior/ICacheEventLogger.java
!????? src/java/org/apache/jcs/engine/logging/CacheEvent.java
!????? src/java/org/apache/jcs/engine/logging/CacheEventLoggerDebugLogger.java
!????? src/java/org/apache/jcs/engine/match/behavior/IKeyMatcher.java
!????? src/java/org/apache/jcs/engine/match/KeyMatcherPatternImpl.java
!????? src/java/org/apache/jcs/engine/memory/AbstractDoubleLinkedListMemoryCache.java
AL src/java/org/apache/jcs/engine/memory/AbstractMemoryCache.java
AL src/java/org/apache/jcs/engine/memory/behavior/IMemoryCache.java
AL src/java/org/apache/jcs/engine/memory/fifo/FIFOMemoryCache.java
AL src/java/org/apache/jcs/engine/memory/lru/LHMLRUMemoryCache.java
AL src/java/org/apache/jcs/engine/memory/lru/LRUMemoryCache.java
AL src/java/org/apache/jcs/engine/memory/lru/package.html
!????? src/java/org/apache/jcs/engine/memory/MemoryCache.java
AL src/java/org/apache/jcs/engine/memory/mru/MRUMemoryCache.java
AL src/java/org/apache/jcs/engine/memory/mru/package.html
AL src/java/org/apache/jcs/engine/memory/package.html
AL src/java/org/apache/jcs/engine/memory/shrinking/ShrinkerThread.java
AL src/java/org/apache/jcs/engine/memory/util/MemoryElementDescriptor.java
AL src/java/org/apache/jcs/engine/package.html
AL src/java/org/apache/jcs/engine/PooledCacheEventQueue.java
AL src/java/org/apache/jcs/engine/stats/behavior/ICacheStats.java
AL src/java/org/apache/jcs/engine/stats/behavior/IStatElement.java
AL src/java/org/apache/jcs/engine/stats/behavior/IStats.java
AL src/java/org/apache/jcs/engine/stats/CacheStats.java
AL src/java/org/apache/jcs/engine/stats/StatElement.java
AL src/java/org/apache/jcs/engine/stats/Stats.java
AL src/java/org/apache/jcs/engine/ZombieCacheService.java
AL src/java/org/apache/jcs/engine/ZombieCacheServiceNonLocal.java
AL src/java/org/apache/jcs/engine/ZombieCacheWatch.java
AL src/java/org/apache/jcs/JCS.java
AL src/java/org/apache/jcs/package.html
AL src/java/org/apache/jcs/utils/access/AbstractJCSWorkerHelper.java
AL src/java/org/apache/jcs/utils/access/JCSWorker.java
AL src/java/org/apache/jcs/utils/access/JCSWorkerHelper.java
AL src/java/org/apache/jcs/utils/config/OptionConverter.java
AL src/java/org/apache/jcs/utils/config/package.html
AL src/java/org/apache/jcs/utils/config/PropertySetter.java
AL src/java/org/apache/jcs/utils/config/PropertySetterException.java
!????? src/java/org/apache/jcs/utils/date/DateFormatter.java
!????? src/java/org/apache/jcs/utils/date/ThreadSafeSimpleDateFormat.java
AL src/java/org/apache/jcs/utils/discovery/behavior/IDiscoveryListener.java
AL src/java/org/apache/jcs/utils/discovery/DiscoveredService.java
AL src/java/org/apache/jcs/utils/discovery/UDPCleanupRunner.java
AL src/java/org/apache/jcs/utils/discovery/UDPDiscoveryAttributes.java
AL src/java/org/apache/jcs/utils/discovery/UDPDiscoveryInfo.java
AL src/java/org/apache/jcs/utils/discovery/UDPDiscoveryManager.java
AL src/java/org/apache/jcs/utils/discovery/UDPDiscoveryMessage.java
AL src/java/org/apache/jcs/utils/discovery/UDPDiscoveryReceiver.java
AL src/java/org/apache/jcs/utils/discovery/UDPDiscoverySender.java
AL src/java/org/apache/jcs/utils/discovery/UDPDiscoverySenderThread.java
AL src/java/org/apache/jcs/utils/discovery/UDPDiscoveryService.java
!????? src/java/org/apache/jcs/utils/key/KeyGeneratorUtil.java
!????? src/java/org/apache/jcs/utils/net/AddressUtil.java
AL src/java/org/apache/jcs/utils/net/HostNameUtil.java
AL src/java/org/apache/jcs/utils/props/AbstractPropertyContainer.java
AL src/java/org/apache/jcs/utils/props/PropertiesFactory.java
AL src/java/org/apache/jcs/utils/props/PropertiesFactoryFileImpl.java
AL src/java/org/apache/jcs/utils/props/PropertyLoader.java
AL src/java/org/apache/jcs/utils/serialization/CompressingSerializer.java
AL src/java/org/apache/jcs/utils/serialization/SerializationConversionUtil.java
AL src/java/org/apache/jcs/utils/serialization/StandardSerializer.java
AL src/java/org/apache/jcs/utils/servlet/JCSServletContextListener.java
AL src/java/org/apache/jcs/utils/struct/BoundedQueue.java
AL src/java/org/apache/jcs/utils/struct/DoubleLinkedList.java
AL src/java/org/apache/jcs/utils/struct/DoubleLinkedListNode.java
AL src/java/org/apache/jcs/utils/struct/LRUElementDescriptor.java
AL src/java/org/apache/jcs/utils/struct/LRUMap.java
AL src/java/org/apache/jcs/utils/struct/LRUMapEntry.java
AL src/java/org/apache/jcs/utils/struct/SingleLinkedList.java
AL src/java/org/apache/jcs/utils/struct/SortedPreferentialArray.java
AL src/java/org/apache/jcs/utils/threadpool/PoolConfiguration.java
AL src/java/org/apache/jcs/utils/threadpool/ThreadPoolManager.java
AL src/java/org/apache/jcs/utils/timing/ElapsedTimer.java
AL src/java/org/apache/jcs/utils/timing/SleepUtil.java
AL src/java/org/apache/jcs/utils/zip/CompressionUtil.java
AL src/scripts/cpappend.bat
AL src/scripts/directory.bat
AL src/scripts/jgtest.bat
AL src/scripts/jgtest_send.bat
AL src/scripts/jgtest_send.sh
AL src/scripts/prep.bat
AL src/scripts/remoteCacheStats.bat
AL src/scripts/remoteCacheStats.sh
AL src/scripts/setCURDIR.bat
AL src/scripts/startJetty.bat
AL src/scripts/startRemoteCache.bat
AL src/scripts/startRemoteCache.sh
AL src/scripts/stopRemoteCache.bat
AL src/scripts/tester.bat
AL src/scripts/tester.sh
!????? src/scripts/zipcodes.txt
!????? src/site/resources/download_jcs.cgi
AL src/site/site.xml
AL src/test/org/apache/jcs/access/CacheAccessUnitTest.java
AL src/test/org/apache/jcs/access/SystemPropetyUnitTest.java
AL src/test/org/apache/jcs/access/TestCacheAccess.java
AL src/test/org/apache/jcs/admin/AdminBeanUnitTest.java
AL src/test/org/apache/jcs/admin/CountingStreamUnitTest.java
!????? src/test/org/apache/jcs/auxiliary/AuxiliaryCacheConfiguratorUnitTest.java
!????? src/test/org/apache/jcs/auxiliary/disk/AbstractDiskCacheUnitTest.java
AL src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheConcurrentUnitTest.java
AL src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheKeyStoreUnitTest.java
!????? src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheManagerUnitTest.java
AL src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheRandomConcurrentTestUtil.java
AL src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheSameRegionConcurrentUnitTest.java
AL src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheSteadyLoadTest.java
!????? src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheUnitTest.java
AL src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskElementDescriptorUnitTest.java
AL src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskUnitTest.java
AL src/test/org/apache/jcs/auxiliary/disk/block/HugeQuantityBlockDiskCacheLoadTest.java
AL src/test/org/apache/jcs/auxiliary/disk/DiskTestObject.java
!????? src/test/org/apache/jcs/auxiliary/disk/file/FileDiskCacheFactoryUnitTest.java
!????? src/test/org/apache/jcs/auxiliary/disk/file/FileDiskCacheUnitTest.java
AL src/test/org/apache/jcs/auxiliary/disk/indexed/DiskTestObjectUtil.java
AL src/test/org/apache/jcs/auxiliary/disk/indexed/HugeQuantityIndDiskCacheLoadTest.java
AL src/test/org/apache/jcs/auxiliary/disk/indexed/IndexDiskCacheUnitTest.java
AL src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheConcurrentNoDeadLockUnitTest.java
AL src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheConcurrentUnitTest.java
AL src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheDefragPerformanceTest.java
AL src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheKeyStoreUnitTest.java
!????? src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheManagerUnitTest.java
AL src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheNoMemoryUnitTest.java
AL src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheOptimizationUnitTest.java
AL src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheRandomConcurrentTestUtil.java
AL src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheSameRegionConcurrentUnitTest.java
AL src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheSteadyLoadTest.java
AL src/test/org/apache/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheConcurrentUnitTest.java
AL src/test/org/apache/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheUnitTest.java
!????? src/test/org/apache/jcs/auxiliary/disk/jdbc/HsqlSetupTableUtil.java
!????? src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManagerUnitTest.java
!????? src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCachePoolAccessManagerUnitTest.java
AL src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheRemovalUnitTest.java
AL src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheSharedPoolUnitTest.java
AL src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheShrinkUnitTest.java
AL src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheUnitTest.java
AL src/test/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheHsqlBackedUnitTest.java
!????? src/test/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheManagerUnitTest.java
AL src/test/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheUnitTest.java
AL src/test/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLTableOptimizerManualTester.java
AL src/test/org/apache/jcs/auxiliary/disk/jdbc/mysql/util/ScheduleParserUtilUnitTest.java
!????? src/test/org/apache/jcs/auxiliary/disk/LRUMapJCSUnitTest.java
!????? src/test/org/apache/jcs/auxiliary/disk/PurgatoryElementUnitTest.java
AL src/test/org/apache/jcs/auxiliary/lateral/http/broadcast/LateralCacheTester.java
!????? src/test/org/apache/jcs/auxiliary/lateral/LateralCacheNoWaitFacadeUnitTest.java
AL src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPConcurrentRandomTestUtil.java
!????? src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPDiscoveryListenerUnitTest.java
AL src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPFilterRemoveHashCodeUnitTest.java
AL src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPIssueRemoveOnPutUnitTest.java
AL src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPNoDeadLockConcurrentTest.java
AL src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/MockLateralCache.java
AL src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/TestTCPLateralUnitTest.java
!????? src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/TestTCPLateralUnitTest.java.rej
AL src/test/org/apache/jcs/auxiliary/MockAuxiliaryCache.java
!????? src/test/org/apache/jcs/auxiliary/MockAuxiliaryCacheAttributes.java
!????? src/test/org/apache/jcs/auxiliary/MockAuxiliaryCacheFactory.java
!????? src/test/org/apache/jcs/auxiliary/MockCacheEventLogger.java
AL src/test/org/apache/jcs/auxiliary/remote/http/client/MockRemoteCacheDispatcher.java
AL src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheClientUnitTest.java
!????? src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheDispatcherUniTest.java
AL src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheManagerUnitTest.java
AL src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheManualTester.java
AL src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteCacheServiceAdaptorUnitTest.java
AL src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheServiceUnitTest.java
AL src/test/org/apache/jcs/auxiliary/remote/http/server/RemoteHttpCacheSeviceFactoryUnitTest.java
AL src/test/org/apache/jcs/auxiliary/remote/MockRemoteCacheClient.java
AL src/test/org/apache/jcs/auxiliary/remote/MockRemoteCacheListener.java
AL src/test/org/apache/jcs/auxiliary/remote/MockRemoteCacheService.java
AL src/test/org/apache/jcs/auxiliary/remote/RemoteCacheClientTester.java
AL src/test/org/apache/jcs/auxiliary/remote/RemoteCacheListenerUnitTest.java
AL src/test/org/apache/jcs/auxiliary/remote/RemoteCacheNoWaitUnitTest.java
AL src/test/org/apache/jcs/auxiliary/remote/RemoteCacheUnitTest.java
AL src/test/org/apache/jcs/auxiliary/remote/RemoteUtilsUnitTest.java
AL src/test/org/apache/jcs/auxiliary/remote/server/BasicRemoteCacheClientServerUnitTest.java
!????? src/test/org/apache/jcs/auxiliary/remote/server/MockRMISocketFactory.java
!????? src/test/org/apache/jcs/auxiliary/remote/server/RegistryKeepAliveRunnerUnitTest.java
AL src/test/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerAttributesUnitTest.java
!????? src/test/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerFactoryUnitTest.java
AL src/test/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerStartupUtil.java
AL src/test/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerUnitTest.java
!????? src/test/org/apache/jcs/auxiliary/remote/server/TimeoutConfigurableRMIScoketFactoryUnitTest.java
AL src/test/org/apache/jcs/auxiliary/remote/TestRemoteCache.java
!????? src/test/org/apache/jcs/auxiliary/remote/util/RemoteCacheRequestFactoryUnitTest.java
AL src/test/org/apache/jcs/auxiliary/remote/ZombieRemoteCacheServiceUnitTest.java
AL src/test/org/apache/jcs/ConcurrentRemovalLoadTest.java
!????? src/test/org/apache/jcs/engine/CacheEventQueueFactoryUnitTest.java
AL src/test/org/apache/jcs/engine/control/CacheManagerStatsUnitTest.java
!????? src/test/org/apache/jcs/engine/control/CompositeCacheConfiguratorUnitTest.java
AL src/test/org/apache/jcs/engine/control/CompositeCacheDiskUsageUnitTest.java
AL src/test/org/apache/jcs/engine/control/CompositeCacheUnitTest.java
AL src/test/org/apache/jcs/engine/control/event/ElementEventHandlerMockImpl.java
AL src/test/org/apache/jcs/engine/control/event/SimpleEventHandlingUnitTest.java
AL src/test/org/apache/jcs/engine/control/MockCompositeCacheManager.java
!????? src/test/org/apache/jcs/engine/control/MockElementSerializer.java
AL src/test/org/apache/jcs/engine/EventQueueConcurrentLoadTest.java
!????? src/test/org/apache/jcs/engine/logging/CacheEventLoggerDebugLoggerUnitTest.java
!????? src/test/org/apache/jcs/engine/logging/MockCacheEventLogger.java
!????? src/test/org/apache/jcs/engine/match/KeyMatcherPatternImpllUnitTest.java
!????? src/test/org/apache/jcs/engine/memory/fifo/FIFOMemoryCacheUnitTest.java
AL src/test/org/apache/jcs/engine/memory/lru/LHMLRUMemoryCacheConcurrentUnitTest.java
AL src/test/org/apache/jcs/engine/memory/lru/LHMLRUMemoryCacheUnitTest.java
AL src/test/org/apache/jcs/engine/memory/lru/LRUMemoryCacheConcurrentUnitTest.java
AL src/test/org/apache/jcs/engine/memory/MockMemoryCache.java
AL src/test/org/apache/jcs/engine/memory/mru/LRUvsMRUPerformanceTest.java
AL src/test/org/apache/jcs/engine/memory/mru/MRUMemoryCacheUnitTest.java
AL src/test/org/apache/jcs/engine/memory/shrinking/ShrinkerThreadUnitTest.java
!????? src/test/org/apache/jcs/engine/MockCacheEventQueue.java
AL src/test/org/apache/jcs/engine/MockCacheServiceNonLocal.java
AL src/test/org/apache/jcs/engine/SystemPropertyUsageUnitTest.java
AL src/test/org/apache/jcs/engine/ZombieCacheServiceNonLocalUnitTest.java
AL src/test/org/apache/jcs/JCSCacheElementRetrievalUnitTest.java
AL src/test/org/apache/jcs/JCSLightLoadUnitTest.java
AL src/test/org/apache/jcs/JCSRemovalSimpleConcurrentTest.java
AL src/test/org/apache/jcs/JCSThrashTest.java
AL src/test/org/apache/jcs/JCSUnitTest.java
AL src/test/org/apache/jcs/JCSvsHashtablePerformanceTest.java
AL src/test/org/apache/jcs/RemovalTestUtil.java
!????? src/test/org/apache/jcs/TestLogConfigurationUtil.java
AL src/test/org/apache/jcs/TestTCPLateralCache.java
AL src/test/org/apache/jcs/utils/access/JCSWorkerUnitTest.java
!????? src/test/org/apache/jcs/utils/date/DateFormatterUnitTest.java
!????? src/test/org/apache/jcs/utils/date/ThreadSafeSimpleDateFormatUnitTest.java
AL src/test/org/apache/jcs/utils/discovery/MockDiscoveryListener.java
AL src/test/org/apache/jcs/utils/discovery/UDPDiscoverySenderUnitTest.java
AL src/test/org/apache/jcs/utils/discovery/UDPDiscoveryServiceUnitTest.java
AL src/test/org/apache/jcs/utils/discovery/UDPDiscoveryUnitTest.java
!????? src/test/org/apache/jcs/utils/key/KeyGeneratorUtilUnitTest.java
!????? src/test/org/apache/jcs/utils/net/AddressUtilUnitTest.java
!????? src/test/org/apache/jcs/utils/net/HostNameUtilUnitTest.java
AL src/test/org/apache/jcs/utils/serialization/CompressingSerializerUnitTest.java
AL src/test/org/apache/jcs/utils/serialization/SerializationConversionUtilUnitTest.java
AL src/test/org/apache/jcs/utils/serialization/StandardSerializerUnitTest.java
AL src/test/org/apache/jcs/utils/struct/BoundedQueueUnitTest.java
!????? src/test/org/apache/jcs/utils/struct/DoubleLinkedListUnitTest.java
AL src/test/org/apache/jcs/utils/struct/JCSvsCommonsLRUMapPerformanceTest.java
AL src/test/org/apache/jcs/utils/struct/LRUMapConcurrentTest.java
AL src/test/org/apache/jcs/utils/struct/LRUMapConcurrentUnitTest.java
AL src/test/org/apache/jcs/utils/struct/LRUMapPerformanceTest.java
AL src/test/org/apache/jcs/utils/struct/LRUMapUnitTest.java
AL src/test/org/apache/jcs/utils/struct/SingleLinkedListUnitTest.java
AL src/test/org/apache/jcs/utils/struct/SortedPrefArrayUnitTest.java
AL src/test/org/apache/jcs/utils/threadpool/ThreadPoolManagerUnitTest.java
AL src/test/org/apache/jcs/utils/threadpool/ThreadPoolUnitTest.java
AL src/test/org/apache/jcs/utils/zip/CompressionUtilUnitTest.java
AL src/test/org/apache/jcs/ZeroSizeCacheUnitTest.java
AL src/test-conf/cache.ccf
AL src/test-conf/cache2.ccf
AL src/test-conf/je.properties
AL src/test-conf/log4j.properties
AL src/test-conf/logger.properties
AL src/test-conf/TestARCCache.ccf
AL src/test-conf/TestBDBJEDiskCacheCon.ccf
AL src/test-conf/TestBlockDiskCache.ccf
AL src/test-conf/TestBlockDiskCacheCon.ccf
AL src/test-conf/TestBlockDiskCacheHuge.ccf
AL src/test-conf/TestBlockDiskCacheSteadyLoad.ccf
AL src/test-conf/TestDiskCache.ccf
AL src/test-conf/TestDiskCacheCon.ccf
AL src/test-conf/TestDiskCacheDefragPerformance.ccf
AL src/test-conf/TestDiskCacheHuge.ccf
AL src/test-conf/TestDiskCacheNoMemory.ccf
AL src/test-conf/TestDiskCacheSteadyLoad.ccf
AL src/test-conf/TestDiskCacheUsagePattern.ccf
AL src/test-conf/TestHSQLDiskCache.ccf
AL src/test-conf/TestHSQLDiskCacheConcurrent.ccf
AL src/test-conf/TestJCSvHashtablePerf.ccf
AL src/test-conf/TestJDBCDiskCache.ccf
AL src/test-conf/TestJDBCDiskCacheRemoval.ccf
AL src/test-conf/TestJDBCDiskCacheSharedPool.ccf
AL src/test-conf/TestJDBCDiskCacheShrink.ccf
AL src/test-conf/TestJispDiskCache.ccf
AL src/test-conf/TestLHMLRUCache.ccf
AL src/test-conf/TestMRUCache.ccf
AL src/test-conf/TestMySQLDiskCache.ccf
AL src/test-conf/TestRemoteCacheClientServer.ccf
AL src/test-conf/TestRemoteCacheEventLogging.ccf
AL src/test-conf/TestRemoteCacheServer.ccf
AL src/test-conf/TestRemoteClient.ccf
AL src/test-conf/TestRemoteHttpCache.ccf
AL src/test-conf/TestRemoteServer.ccf
AL src/test-conf/TestRemoval.ccf
AL src/test-conf/TestSimpleEventHandling.ccf
AL src/test-conf/TestSimpleLoad.ccf
AL src/test-conf/TestSystemProperties.ccf
AL src/test-conf/TestSystemPropertyUsage.ccf
AL src/test-conf/TestTCPLateralCache.ccf
AL src/test-conf/TestTCPLateralCacheConcurrent.ccf
AL src/test-conf/TestTCPLateralIssueRemoveCache.ccf
AL src/test-conf/TestTCPLateralRemoveFilter.ccf
AL src/test-conf/TestThrash.ccf
AL src/test-conf/TestUDPDiscovery.ccf
AL src/test-conf/TestZeroSizeCache.ccf
AL src/test-conf/thread_pool.properties
AL xdocs/BasicJCSConfiguration.xml
AL xdocs/BDBJEDiskCache.ccf
AL xdocs/BlockDiskCache.xml
AL xdocs/CacheEventLogging.xml
AL xdocs/DownloadPage.xml
AL xdocs/ElementAttributes.xml
AL xdocs/ElementEventHandling.xml
AL xdocs/faq.fml
AL xdocs/getting_started/intro.xml
AL xdocs/index.xml
AL xdocs/IndexedDiskAuxCache.xml
AL xdocs/IndexedDiskCacheProperties.xml
AL xdocs/JCSandJCACHE.xml
AL xdocs/JCSPlugins.xml
AL xdocs/JCSShortDescription.xml
AL xdocs/JCSvsEHCache.xml
AL xdocs/JDBCDiskCache.xml
AL xdocs/JDBCDiskCacheProperties.xml
AL xdocs/LateralJavaGroupsAuxCache.xml
AL xdocs/LateralTCPAuxCache.xml
AL xdocs/LateralTCPProperties.xml
AL xdocs/LateralUDPDiscovery.xml
AL xdocs/LocalCacheConfig.xml
AL xdocs/MySQLDiskCacheProperties.xml
AL xdocs/RegionProperties.xml
AL xdocs/RemoteAuxCache.xml
AL xdocs/RemoteCacheProperties.xml
AL xdocs/RemoteHttpCacheProperties.xml
AL xdocs/tasks.xml
AL xdocs/UsingJCSBasicWeb.xml
*****************************************************
Printing headers for files without AL header...
=======================================================================
==ant_eclipse_resources.launch
=======================================================================
<?xml version="1.0" encoding="UTF-8"?>
<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="true"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/lmd-small-app/ant_eclipse.xml}"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
</launchConfiguration>
=======================================================================
==LICENSE.xerox
=======================================================================
Copyright (c) Xerox Corporation 1998-2001. All rights reserved.
Use and copying of this software and preparation of derivative works based
upon this software are permitted. Any distribution of this software or
derivative works must comply with all applicable United States export control
laws.
This software is made available AS IS, and Xerox Corporation makes no warranty
about the software, its performance or its conformity to any specification.
=======================================================================
==mvn.log
=======================================================================
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Commons JCS
[INFO] task-segment: [clean, package]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean {execution: default-clean}]
[INFO] Deleting /Users/thomas/Dev/workspace/jcs-TRUNK/target
[WARNING] While downloading xml-apis:xml-apis:2.0.2
This artifact has been relocated to xml-apis:xml-apis:1.0.b2.
[INFO] [antrun:run {execution: javadoc.resources}]
[INFO] Executing tasks
main:
[copy] Copying 1 file to /Users/thomas/Dev/workspace/jcs-TRUNK/target/apidocs/META-INF
[INFO] Executed tasks
[INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on => 'false'.
[INFO] Setting property: resource.loader => 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound => 'false'.
[INFO] [remote-resources:process {execution: default}]
[INFO] [resources:resources {execution: default-resources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource to META-INF
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Compiling 262 source files to /Users/thomas/Dev/workspace/jcs-TRUNK/target/classes
[INFO] [bundle:manifest {execution: bundle-manifest}]
[WARNING] Warning in manifest for org.apache.jcs:jcs:jar:2.0.0-SNAPSHOT : Superfluous export-package instructions: [org.apache.commons.*]
[INFO] [rmic:rmic {execution: rmic}]
[INFO] Compiling 2 remote classes
[INFO] [resources:testResources {execution: default-testResources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 48 resources
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] Compiling 150 source files to /Users/thomas/Dev/workspace/jcs-TRUNK/target/test-classes
[INFO] [surefire:test {execution: default-test}]
[INFO] Surefire report directory: /Users/thomas/Dev/workspace/jcs-TRUNK/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running org.apache.jcs.access.CacheAccessUnitTest
2012-06-02 21:00:34,721 INFO [CompositeCacheManager] - <Creating cache manager from config file: /cache.ccf>
2012-06-02 21:00:34,729 INFO [ThreadPoolManager] - <thread_pool.default PoolConfiguration = useBoundary = [true] boundarySize = [2000] maximumPoolSize = [151] minimumPoolSize = [4] keepAliveTime = [350000] whenBlockedPolicy = [RUN] startUpSize = [4]>
2012-06-02 21:00:34,735 INFO [CompositeCacheConfigurator] - <Setting default auxiliaries to >
=======================================================================
==src/aspect/Trace.aj
=======================================================================
/*
Copyright (c) Xerox Corporation 1998-2001. All rights reserved.
Use and copying of this software and preparation of derivative works based
upon this software are permitted. Any distribution of this software or
derivative works must comply with all applicable United States export control
laws.
This software is made available AS IS, and Xerox Corporation makes no warranty
about the software, its performance or its conformity to any specification.
|<--- this code is formatted to fit into 80 columns --->|
|<--- this code is formatted to fit into 80 columns --->|
|<--- this code is formatted to fit into 80 columns --->|
*/
import java.io.PrintStream;
/**
*
* This class provides some basic functionality for printing trace messages
* into a stream.
*
*/
public class Trace {
/**
* There are 3 trace levels (values of TRACELEVEL):
* 0 - No messages are printed
* 1 - Trace messages are printed, but there is no indentation
* according to the call stack
* 2 - Trace messages are printed, and they are indented
* according to the call stack
*/
public static int TRACELEVEL = 0;
protected static PrintStream stream = null;
protected static int callDepth = 0;
/**
* Initialization.
*/
public static void initStream(PrintStream s) {
stream = s;
}
/**
* Prints an "entering" message. It is intended to be called in the
* beginning of the blocks to be traced.
=======================================================================
==src/conf/cache.policy
=======================================================================
grant {
permission java.security.AllPermission;
};
grant codeBase "file:g:/dev/jakarta-turbine-jcs/target/classes/*" {
permission java.security.AllPermission;
};
grant codeBase "file:g:/dev/jakarta-turbine-jcs/src/conf/*" {
permission java.security.AllPermission;
};
grant codeBase "file:g:/dev/jakarta-turbine-jcs/src/conf/scripts/*" {
permission java.security.AllPermission;
};
grant codeBase "file:g:/dev/jakarta-turbine-jcs/*" {
permission java.security.AllPermission;
};
grant codeBase "file:/G:/*" {
permission java.security.AllPermission;
};
=======================================================================
==src/java/org/apache/jcs/access/exception/ConfigurationException.java
=======================================================================
package org.apache.jcs.access.exception;
/** Thrown if there is some severe configuration problem that makes the cache nonfunctional. */
public class ConfigurationException
extends CacheException
{
/** Don't change. */
private static final long serialVersionUID = 6881044536186097055L;
/** Constructor for the ConfigurationException object */
public ConfigurationException()
{
super();
}
/**
* Constructor for the ConfigurationException object.
* <p>
* @param message
*/
public ConfigurationException( String message )
{
super( message );
}
}
=======================================================================
==src/java/org/apache/jcs/auxiliary/AbstractAuxiliaryCache.java
=======================================================================
package org.apache.jcs.auxiliary;
import java.io.Serializable;
import org.apache.jcs.engine.behavior.ICacheElement;
import org.apache.jcs.engine.behavior.IElementSerializer;
import org.apache.jcs.engine.logging.CacheEvent;
import org.apache.jcs.engine.logging.behavior.ICacheEvent;
import org.apache.jcs.engine.logging.behavior.ICacheEventLogger;
import org.apache.jcs.engine.match.KeyMatcherPatternImpl;
import org.apache.jcs.engine.match.behavior.IKeyMatcher;
import org.apache.jcs.utils.serialization.StandardSerializer;
/** This holds convenience methods used by most auxiliary caches. */
public abstract class AbstractAuxiliaryCache<K extends Serializable, V extends Serializable>
implements AuxiliaryCache<K, V>
{
/** Don't change. */
private static final long serialVersionUID = -1285708398502576617L;
/** An optional event logger */
protected ICacheEventLogger cacheEventLogger;
/** The serializer. Uses a standard serializer by default. */
protected IElementSerializer elementSerializer = new StandardSerializer();
/** Key matcher used by the getMatching API */
protected IKeyMatcher<K> keyMatcher = new KeyMatcherPatternImpl<K>();
/**
* Logs an event if an event logger is configured.
* <p>
* @param item
* @param eventName
* @return ICacheEvent
*/
protected ICacheEvent<K> createICacheEvent( ICacheElement<K, V> item, String eventName )
{
if ( cacheEventLogger == null )
{
return new CacheEvent<K>();
}
String diskLocation = getEventLoggingExtraInfo();
String regionName = null;
K key = null;
if ( item != null )
{
regionName = item.getCacheName();
key = item.getKey();
}
=======================================================================
==src/java/org/apache/jcs/auxiliary/AbstractAuxiliaryCacheEventLogging.java
=======================================================================
package org.apache.jcs.auxiliary;
import java.io.IOException;
import java.io.Serializable;
import java.util.Map;
import java.util.Set;
import org.apache.jcs.engine.behavior.ICacheElement;
import org.apache.jcs.engine.logging.behavior.ICacheEvent;
import org.apache.jcs.engine.logging.behavior.ICacheEventLogger;
/**
* All ICacheEvents are defined as final. Children must implement process events. These are wrapped
* in event log parent calls.
* <p>
* You can override the public method, but if you don't, the default will call getWithTiming.
*/
public abstract class AbstractAuxiliaryCacheEventLogging<K extends Serializable, V extends Serializable>
extends AbstractAuxiliaryCache<K, V>
{
/** Don't change. */
private static final long serialVersionUID = -3921738303365238919L;
/**
* Puts an item into the cache.
* <p>
* @param cacheElement
* @throws IOException
*/
public void update( ICacheElement<K, V> cacheElement )
throws IOException
{
updateWithEventLogging( cacheElement );
}
/**
* Puts an item into the cache. Wrapped in logging.
* <p>
* @param cacheElement
* @throws IOException
*/
protected final void updateWithEventLogging( ICacheElement<K, V> cacheElement )
throws IOException
{
ICacheEvent<K> cacheEvent = createICacheEvent( cacheElement, ICacheEventLogger.UPDATE_EVENT );
try
{
processUpdate( cacheElement );
}
finally
=======================================================================
==src/java/org/apache/jcs/auxiliary/AuxiliaryCacheConfigurator.java
=======================================================================
package org.apache.jcs.auxiliary;
import java.util.Properties;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.jcs.engine.behavior.IElementSerializer;
import org.apache.jcs.engine.logging.behavior.ICacheEventLogger;
import org.apache.jcs.utils.config.OptionConverter;
import org.apache.jcs.utils.config.PropertySetter;
import org.apache.jcs.utils.serialization.StandardSerializer;
/**
* Configuration util for auxiliary caches. I plan to move the auxiliary configuration from the
* composite cache configurator here.
*/
public class AuxiliaryCacheConfigurator
{
/** The logger. */
private final static Log log = LogFactory.getLog( AuxiliaryCacheConfigurator.class );
/** .attributes */
public final static String ATTRIBUTE_PREFIX = ".attributes";
/**
* jcs.auxiliary.NAME.cacheeventlogger=CLASSNAME
* <p>
* jcs.auxiliary.NAME.cacheeventlogger.attributes.CUSTOMPROPERTY=VALUE
*/
public final static String CACHE_EVENT_LOGGER_PREFIX = ".cacheeventlogger";
/**
* jcs.auxiliary.NAME.serializer=CLASSNAME
* <p>
* jcs.auxiliary.NAME.serializer.attributes.CUSTOMPROPERTY=VALUE
*/
public final static String SERIALIZER_PREFIX = ".serializer";
/**
* Parses the event logger config, if there is any for the auxiliary.
* <p>
* @param props
* @param auxPrefix - ex. AUXILIARY_PREFIX + auxName
* @return cacheEventLogger
*/
public static ICacheEventLogger parseCacheEventLogger( Properties props, String auxPrefix )
{
ICacheEventLogger cacheEventLogger = null;
// auxFactory was not previously initialized.
=======================================================================
==src/java/org/apache/jcs/auxiliary/disk/AbstractDiskCacheManager.java
=======================================================================
package org.apache.jcs.auxiliary.disk;
import org.apache.jcs.auxiliary.AuxiliaryCacheManager;
import org.apache.jcs.engine.behavior.IElementSerializer;
import org.apache.jcs.engine.logging.behavior.ICacheEventLogger;
/** Common disk cache methods and properties. */
public abstract class AbstractDiskCacheManager
implements AuxiliaryCacheManager
{
/** Don't change. */
private static final long serialVersionUID = 7562753543611662136L;
/** The event logger. */
private ICacheEventLogger cacheEventLogger;
/** The serializer. */
private IElementSerializer elementSerializer;
/**
* @param cacheEventLogger the cacheEventLogger to set
*/
public void setCacheEventLogger( ICacheEventLogger cacheEventLogger )
{
this.cacheEventLogger = cacheEventLogger;
}
/**
* @return the cacheEventLogger
*/
public ICacheEventLogger getCacheEventLogger()
{
return cacheEventLogger;
}
/**
* @param elementSerializer the elementSerializer to set
*/
public void setElementSerializer( IElementSerializer elementSerializer )
{
this.elementSerializer = elementSerializer;
}
/**
* @return the elementSerializer
*/
public IElementSerializer getElementSerializer()
{
return elementSerializer;
}
=======================================================================
==src/java/org/apache/jcs/auxiliary/disk/file/FileDiskCache.java
=======================================================================
package org.apache.jcs.auxiliary.disk.file;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
import java.util.Map;
import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.jcs.auxiliary.AuxiliaryCacheAttributes;
import org.apache.jcs.auxiliary.disk.AbstractDiskCache;
import org.apache.jcs.engine.behavior.ICacheElement;
import org.apache.jcs.engine.behavior.IElementSerializer;
import org.apache.jcs.engine.logging.behavior.ICacheEvent;
import org.apache.jcs.engine.logging.behavior.ICacheEventLogger;
import org.apache.jcs.utils.timing.SleepUtil;
/**
* This disk cache writes each item to a separate file. This is for regions with very few items,
* perhaps big ones.
* <p>
* This is a fairly simple implementation. All the disk writing is handled right here. It's not
* clear that anything more complicated is needed.
*/
public class FileDiskCache<K extends Serializable, V extends Serializable>
extends AbstractDiskCache<K, V>
{
/** Don't change */
private static final long serialVersionUID = 1L;
/** The logger. */
private static final Log log = LogFactory.getLog( FileDiskCache.class );
/** The name to prefix all log messages with. */
private final String logCacheName;
/** The config values. */
private final FileDiskCacheAttributes diskFileCacheAttributes;
/** The directory where the files are stored */
private File directory;
/**
* Constructor for the DiskCache object.
=======================================================================
==src/java/org/apache/jcs/auxiliary/disk/file/FileDiskCacheAttributes.java
=======================================================================
package org.apache.jcs.auxiliary.disk.file;
import org.apache.jcs.auxiliary.AuxiliaryCacheAttributes;
import org.apache.jcs.auxiliary.disk.AbstractDiskCacheAttributes;
/**
* Configuration values for the file disk cache.
*/
public class FileDiskCacheAttributes
extends AbstractDiskCacheAttributes
{
/** Don't change. */
private static final long serialVersionUID = -7371586172678836062L;
/** Default file count limit: -1 means no limit */
public static final int DEFAULT_MAX_NUMBER_OF_FILES = -1;
/** Max number of files */
private int maxNumberOfFiles = DEFAULT_MAX_NUMBER_OF_FILES;
/** Default limit on the number of times we will retry a delete. */
public static final int DEFAULT_MAX_RETRIES_ON_DELETE = 10;
/** Max number of retries on delete */
private int maxRetriesOnDelete = DEFAULT_MAX_RETRIES_ON_DELETE;
/** Default touch rule. */
public static final boolean DEFAULT_TOUCH_ON_GET = false;
/** Default limit on the number of times we will retry a delete. */
public static final int DEFAULT_MAX_RETRIES_ON_TOUCH = 10;
/** Max number of retries on touch */
private int maxRetriesOnTouch = DEFAULT_MAX_RETRIES_ON_TOUCH;
/**
* Should we touch on get. If so, we will reset the last modified time. If you have a max file
* size set, this will make the removal strategy LRU. If this is false, then the oldest will be
* removed.
*/
private boolean touchOnGet = DEFAULT_TOUCH_ON_GET;
/**
* Returns a copy of the attributes.
* <p>
* @return AuxiliaryCacheAttributes
*/
@Override
public AuxiliaryCacheAttributes copy()
{
=======================================================================
==src/java/org/apache/jcs/auxiliary/disk/file/FileDiskCacheFactory.java
=======================================================================
package org.apache.jcs.auxiliary.disk.file;
import java.io.Serializable;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.jcs.auxiliary.AuxiliaryCacheAttributes;
import org.apache.jcs.auxiliary.AuxiliaryCacheFactory;
import org.apache.jcs.engine.behavior.ICompositeCacheManager;
import org.apache.jcs.engine.behavior.IElementSerializer;
import org.apache.jcs.engine.logging.behavior.ICacheEventLogger;
/** Create Disk File Caches */
public class FileDiskCacheFactory
implements AuxiliaryCacheFactory
{
/** The logger. */
private final static Log log = LogFactory.getLog( FileDiskCacheFactory.class );
/** The auxiliary name. */
private String name;
/** The manager used by this factory instance */
private FileDiskCacheManager diskFileCacheManager;
/**
* Creates a manager if we don't have one, and then uses the manager to create the cache. The
* same factory will be called multiple times by the composite cache to create a cache for each
* region.
* <p>
* @param attr config
* @param cacheMgr the manager to use if needed
* @param cacheEventLogger the event logger
* @param elementSerializer the serializer
* @return AuxiliaryCache
*/
public <K extends Serializable, V extends Serializable> FileDiskCache<K, V> createCache(
AuxiliaryCacheAttributes attr, ICompositeCacheManager cacheMgr,
ICacheEventLogger cacheEventLogger, IElementSerializer elementSerializer )
{
FileDiskCacheAttributes idfca = (FileDiskCacheAttributes) attr;
if ( log.isDebugEnabled() )
{
log.debug( "Creating DiskFileCache for attributes = " + idfca );
}
synchronized( this )
{
if ( diskFileCacheManager == null )
{
if ( log.isDebugEnabled() )
=======================================================================
==src/java/org/apache/jcs/auxiliary/disk/file/FileDiskCacheManager.java
=======================================================================
package org.apache.jcs.auxiliary.disk.file;
import java.io.Serializable;
import java.util.Hashtable;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.jcs.auxiliary.disk.AbstractDiskCacheManager;
import org.apache.jcs.engine.behavior.IElementSerializer;
import org.apache.jcs.engine.logging.behavior.ICacheEventLogger;
/**
* This is a non singleton. It creates caches on a per region basis.
*/
public class FileDiskCacheManager
extends AbstractDiskCacheManager
{
/** Don't change */
private static final long serialVersionUID = -4153287154512264626L;
/** The logger */
private final static Log log = LogFactory.getLog( FileDiskCacheManager.class );
/** Each region has an entry here. */
private final Hashtable<String, FileDiskCache<? extends Serializable, ? extends Serializable>> caches =
new Hashtable<String, FileDiskCache<? extends Serializable, ? extends Serializable>>();
/** User configurable attributes */
private final FileDiskCacheAttributes defaultCacheAttributes;
/**
* Constructor for the DiskFileCacheManager object
* <p>
* @param defaultCacheAttributes Default attributes for caches managed by the instance.
* @param cacheEventLogger
* @param elementSerializer
*/
protected FileDiskCacheManager( FileDiskCacheAttributes defaultCacheAttributes, ICacheEventLogger cacheEventLogger,
IElementSerializer elementSerializer )
{
this.defaultCacheAttributes = defaultCacheAttributes;
setElementSerializer( elementSerializer );
setCacheEventLogger( cacheEventLogger );
}
/**
* Gets an DiskFileCache for the supplied name using the default attributes.
* <p>
* @param cacheName Name that will be used when creating attributes.
* @return A cache.
=======================================================================
==src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCachePoolAccessAttributes.java
=======================================================================
package org.apache.jcs.auxiliary.disk.jdbc;
/** These are used to configure the JDBCDiskCachePoolAccess class. */
public class JDBCDiskCachePoolAccessAttributes
{
/** The name of the pool. */
private String poolName;
/** URI to the db. */
private String url;
/** username for the db */
private String userName;
/** password for the database */
private String password;
/** This is the default limit on the maximum number of active connections. */
public static final int DEFAULT_MAX_ACTIVE = 10;
/** Max connections allowed */
private int maxActive = DEFAULT_MAX_ACTIVE;
/** The name of the database. */
private String database = "";
/** The driver */
private String driverClassName;
/**
* @param poolName the poolName to set
*/
public void setPoolName( String poolName )
{
this.poolName = poolName;
}
/**
* @return the poolName
*/
public String getPoolName()
{
return poolName;
}
/**
* @param connectURI the connectURI to set
*/
public void setUrl( String connectURI )
{
=======================================================================
==src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCachePoolAccessFactory.java
=======================================================================
package org.apache.jcs.auxiliary.disk.jdbc;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/** This is just a helper util. */
public class JDBCDiskCachePoolAccessFactory
{
/** The local logger. */
private final static Log log = LogFactory.getLog( JDBCDiskCachePoolAccessFactory.class );
/**
* Creates a JDBCDiskCachePoolAccess object from the JDBCDiskCachePoolAccessAttributes. This is
* used by the connection pool manager.
* <p>
* @param poolAttributes
* @return JDBCDiskCachePoolAccess
* @throws Exception
*/
public static JDBCDiskCachePoolAccess createPoolAccess( JDBCDiskCachePoolAccessAttributes poolAttributes )
throws Exception
{
return createPoolAccess( poolAttributes.getDriverClassName(), poolAttributes.getPoolName(), poolAttributes
.getUrl()
+ poolAttributes.getDatabase(), poolAttributes.getUserName(), poolAttributes.getPassword(), poolAttributes
.getMaxActive() );
}
/**
* Creates a JDBCDiskCachePoolAccess object from the JDBCDiskCacheAttributes. Use this when not
* using the connection pool manager.
* <p>
* @param cattr
* @return JDBCDiskCachePoolAccess
* @throws Exception
*/
public static JDBCDiskCachePoolAccess createPoolAccess( JDBCDiskCacheAttributes cattr )
throws Exception
{
return createPoolAccess( cattr.getDriverClassName(), cattr.getName(), cattr.getUrl() + cattr.getDatabase(),
cattr.getUserName(), cattr.getPassword(), cattr.getMaxActive() );
}
/**
* Creates a pool access object and registers the driver.
* <p>
* @param driverClassName
* @param poolName
* @param fullURL = (url + database)
* @param userName
=======================================================================
==src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCachePoolAccessManager.java
=======================================================================
package org.apache.jcs.auxiliary.disk.jdbc;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.jcs.utils.config.PropertySetter;
/**
* Manages JDBCDiskCachePoolAccess instances. If a connectionPoolName value is supplied, the JDBC
* disk cache will try to use this manager to create a pool. Assuming the name is "MyPool":
*
* <pre>
* jcs.jdbcconnectionpool.MyPool.attributes.userName=MyUserName
* jcs.jdbcconnectionpool.MyPool.attributes.password=MyPassword
* jcs.jdbcconnectionpool.MyPool.attributes.url=MyUrl
* jcs.jdbcconnectionpool.MyPool.attributes.maxActive=MyMaxActive
* jcs.jdbcconnectionpool.MyPool.attributes.driverClassName=MyDriverClassName
* </pre>
*/
public class JDBCDiskCachePoolAccessManager
{
/** Singleton instance */
private static JDBCDiskCachePoolAccessManager instance;
/** Pool name to JDBCDiskCachePoolAccess */
private final Map<String, JDBCDiskCachePoolAccess> pools = new HashMap<String, JDBCDiskCachePoolAccess>();
/** props prefix */
public static final String POOL_CONFIGURATION_PREFIX = "jcs.jdbcconnectionpool.";
/** .attributes */
public final static String ATTRIBUTE_PREFIX = ".attributes";
/** The logger. */
private static final Log log = LogFactory.getLog( JDBCDiskCachePoolAccessManager.class );
/**
* You can specify the properties to be used to configure the thread pool. Setting this post
* initialization will have no effect.
*/
private Properties props = null;
/**
* Singleton, private
* <p>
* @param props
*/
=======================================================================
==src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPDiscoveryListener.java
=======================================================================
package org.apache.jcs.auxiliary.lateral.socket.tcp;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.jcs.auxiliary.lateral.LateralCacheAttributes;
import org.apache.jcs.auxiliary.lateral.LateralCacheNoWait;
import org.apache.jcs.auxiliary.lateral.LateralCacheNoWaitFacade;
import org.apache.jcs.auxiliary.lateral.socket.tcp.behavior.ITCPLateralCacheAttributes;
import org.apache.jcs.engine.behavior.ICache;
import org.apache.jcs.engine.behavior.ICompositeCacheManager;
import org.apache.jcs.engine.behavior.IElementSerializer;
import org.apache.jcs.engine.logging.behavior.ICacheEventLogger;
import org.apache.jcs.utils.discovery.DiscoveredService;
import org.apache.jcs.utils.discovery.behavior.IDiscoveryListener;
/**
* This knows how to add and remove discovered services. It observes UDP discovery events.
* <p>
* We can have one listener per region, or one shared by all regions.
*/
public class LateralTCPDiscoveryListener
implements IDiscoveryListener
{
/** The log factory */
private final static Log log = LogFactory.getLog( LateralTCPDiscoveryListener.class );
/**
* Map of no wait facades. these are used to determine which regions are locally configured to
* use laterals.
*/
private final Map<String, LateralCacheNoWaitFacade<? extends Serializable, ? extends Serializable>> facades =
Collections.synchronizedMap( new HashMap<String, LateralCacheNoWaitFacade<? extends Serializable, ? extends Serializable>>() );
/**
* List of regions that are configured differently here than on another server. We keep track of
* this to limit the amount of info logging.
*/
private final Set<String> knownDifferentlyConfiguredRegions =
Collections.synchronizedSet( new HashSet<String>() );
/** The cache manager. */
private final ICompositeCacheManager cacheMgr;
=======================================================================
==src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPDiscoveryListenerManager.java
=======================================================================
package org.apache.jcs.auxiliary.lateral.socket.tcp;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.jcs.auxiliary.lateral.socket.tcp.behavior.ITCPLateralCacheAttributes;
import org.apache.jcs.engine.behavior.ICompositeCacheManager;
import org.apache.jcs.engine.behavior.IElementSerializer;
import org.apache.jcs.engine.logging.behavior.ICacheEventLogger;
/**
* The factory holds an instance of this manager. This manager has a map of listeners, keyed to the
* discovery configuration. I'm not using a static map, because I'm trying to make JCS
* multi-instance.
* <p>
* During configuration, the factory is only created once per auxiliary definition. Two different
* laterals cannot use the same discovery service. We will likely want to change this.
*/
public class LateralTCPDiscoveryListenerManager
{
/** Map of available instances, keyed by port. Note, this is not static. */
protected Map<String, LateralTCPDiscoveryListener> instances =
Collections.synchronizedMap( new HashMap<String, LateralTCPDiscoveryListener>() );
/** The logger */
private final static Log log = LogFactory.getLog( LateralTCPDiscoveryListenerManager.class );
/** Does nothing. */
public LateralTCPDiscoveryListenerManager()
{
if ( log.isInfoEnabled() )
{
log.info( "Creating new LateralTCPDiscoveryListenerManager" );
}
}
/**
* Gets the instance attribute of the LateralCacheTCPListener class.
* <p>
* @param ilca ITCPLateralCacheAttributes
* @param cacheMgr
* @param cacheEventLogger
* @param elementSerializer
* @return The instance value
*/
public synchronized LateralTCPDiscoveryListener getDiscoveryListener( ITCPLateralCacheAttributes ilca,
ICompositeCacheManager cacheMgr,
=======================================================================
==src/java/org/apache/jcs/auxiliary/remote/behavior/IRemoteCacheDispatcher.java
=======================================================================
package org.apache.jcs.auxiliary.remote.behavior;
import java.io.IOException;
import java.io.Serializable;
import org.apache.jcs.auxiliary.remote.value.RemoteCacheRequest;
import org.apache.jcs.auxiliary.remote.value.RemoteCacheResponse;
/**
* In the future, this can be used as a generic dispatcher abstraction.
* <p>
* At the time of creation, only the http remote cache uses it. The RMI remote could be converted to
* use it as well.
*/
public interface IRemoteCacheDispatcher
{
/**
* All requests will go through this method. The dispatcher implementation will send the request
* remotely.
* <p>
* @param remoteCacheRequest
* @return RemoteCacheResponse
* @throws IOException
*/
<K extends Serializable, V extends Serializable, T>
RemoteCacheResponse<T> dispatchRequest( RemoteCacheRequest<K, V> remoteCacheRequest )
throws IOException;
}
=======================================================================
==src/java/org/apache/jcs/auxiliary/remote/server/RegistryKeepAliveRunner.java
=======================================================================
package org.apache.jcs.auxiliary.remote.server;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.jcs.engine.logging.behavior.ICacheEventLogger;
/**
* This class tries to keep the resitry alive. If if is able to create a registry, it will also
* rebind the remote cache server.
*/
public class RegistryKeepAliveRunner
implements Runnable
{
/** The logger */
private final static Log log = LogFactory.getLog( RegistryKeepAliveRunner.class );
/** Hostname of the registry */
private String registryHost;
/** the port on which to start the registry */
private int registryPort;
/** The name of the service to look for. */
private String serviceName;
/** An optional event logger */
private ICacheEventLogger cacheEventLogger;
/**
* @param registryHost - Hostname of the registry
* @param registryPort - the port on which to start the registry
* @param serviceName
*/
public RegistryKeepAliveRunner( String registryHost, int registryPort, String serviceName )
{
this.registryHost = registryHost;
this.registryPort = registryPort;
this.serviceName = serviceName;
}
/**
* Tries to lookup the server. If unsuccessful it will rebind the server using the factory
* rebind method.
* <p>
*/
public void run()
=======================================================================
==src/java/org/apache/jcs/auxiliary/remote/server/TimeoutConfigurableRMIScoketFactory.java
=======================================================================
package org.apache.jcs.auxiliary.remote.server;
import java.io.IOException;
import java.io.Serializable;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.rmi.server.RMISocketFactory;
/**
* This can be injected into the the remote cache server as follows:
*
* <pre>
* jcs.remotecache.customrmisocketfactory=org.apache.jcs.auxiliary.remote.server.TimeoutConfigurableRMIScoketFactory
* jcs.remotecache.customrmisocketfactory.readTimeout=5000
* jcs.remotecache.customrmisocketfactory.openTimeout=5000
* </pre>
*/
public class TimeoutConfigurableRMIScoketFactory
extends RMISocketFactory
implements Serializable
{
/** Don't change. */
private static final long serialVersionUID = 1489909775271203334L;
/** The socket read timeout */
private int readTimeout = 5000;
/** The socket open timeout */
private int openTimeout = 5000;
/**
* @param port
* @return ServerSocket
* @throws IOException
*/
@Override
public ServerSocket createServerSocket( int port )
throws IOException
{
return new ServerSocket( port );
}
/**
* @param host
* @param port
* @return Socket
* @throws IOException
*/
@Override
=======================================================================
==src/java/org/apache/jcs/auxiliary/remote/util/RemoteCacheRequestFactory.java
=======================================================================
package org.apache.jcs.auxiliary.remote.util;
import java.io.Serializable;
import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.jcs.auxiliary.remote.value.RemoteCacheRequest;
import org.apache.jcs.auxiliary.remote.value.RemoteRequestType;
import org.apache.jcs.engine.behavior.ICacheElement;
/**
* This creates request objects. You could write your own client and use the objects from this
* factory.
*/
public class RemoteCacheRequestFactory
{
/** The Logger. */
private final static Log log = LogFactory.getLog( RemoteCacheRequestFactory.class );
/**
* Creates a get Request.
* <p>
* @param cacheName
* @param key
* @param requesterId
* @return RemoteHttpCacheRequest
*/
public static <K extends Serializable, V extends Serializable> RemoteCacheRequest<K, V> createGetRequest( String cacheName, K key, long requesterId )
{
RemoteCacheRequest<K, V> request = new RemoteCacheRequest<K, V>();
request.setCacheName( cacheName );
request.setKey( key );
request.setRequesterId( requesterId );
request.setRequestType( RemoteRequestType.GET );
if ( log.isDebugEnabled() )
{
log.debug( "Created: " + request );
}
return request;
}
/**
* Creates a getMatching Request.
* <p>
* @param cacheName
* @param pattern
* @param requesterId
=======================================================================
==src/java/org/apache/jcs/auxiliary/remote/value/RemoteCacheRequest.java
=======================================================================
package org.apache.jcs.auxiliary.remote.value;
import java.io.Serializable;
import java.util.Set;
import org.apache.jcs.engine.behavior.ICacheElement;
/**
* The basic request wrapper. The different types of requests are differentiated by their types.
* <p>
* Rather than creating sub object types, I created on object that has values for all types of
* requests.
*/
public class RemoteCacheRequest<K extends Serializable, V extends Serializable>
implements Serializable
{
/** Don't change. */
private static final long serialVersionUID = -8858447417390442569L;
/** The request type specifies the type of request: get, put, remove, . . */
private RemoteRequestType requestType = null;
/** Used to identify the source. Same as listener id on the client side. */
private long requesterId = 0;
/** The name of the region */
private String cacheName;
/** The key, if this request has a key. */
private K key;
/** The keySet, if this request has a keySet. Only getMultiple requests. */
private Set<K> keySet;
/** The pattern, if this request uses a pattern. Only getMatching requests. */
private String pattern;
/** The ICacheEleemnt, if this request contains a value. Only update requests will have this. */
private ICacheElement<K, V> cacheElement;
/**
* @param requestType the requestType to set
*/
public void setRequestType( RemoteRequestType requestType )
{
this.requestType = requestType;
}
/**
* @return the requestType
=======================================================================
==src/java/org/apache/jcs/auxiliary/remote/value/RemoteCacheResponse.java
=======================================================================
package org.apache.jcs.auxiliary.remote.value;
import java.io.Serializable;
/**
* This is the response wrapper. The servlet wraps all different type of responses in one of these
* objects.
*/
public class RemoteCacheResponse<T>
implements Serializable
{
/** Don't change. */
private static final long serialVersionUID = -8858447417390442568L;
/** Was the event processed without error */
private boolean success = true;
/** Simple error messaging */
private String errorMessage;
/**
* The payload. Typically a key / ICacheElement<K, V> map. A normal get will return a map with one
* record.
*/
private T payload;
/**
* @param success the success to set
*/
public void setSuccess( boolean success )
{
this.success = success;
}
/**
* @return the success
*/
public boolean isSuccess()
{
return success;
}
/**
* @param errorMessage the errorMessage to set
*/
public void setErrorMessage( String errorMessage )
{
this.errorMessage = errorMessage;
}
=======================================================================
==src/java/org/apache/jcs/auxiliary/remote/value/RemoteRequestType.java
=======================================================================
package org.apache.jcs.auxiliary.remote.value;
/**
* The different types of requests
*/
public enum RemoteRequestType
{
/** Alive check request type. */
ALIVE_CHECK,
/** Get request type. */
GET,
/** Get Multiple request type. */
GET_MULTIPLE,
/** Get Matching request type. */
GET_MATCHING,
/** Update request type. */
UPDATE,
/** Remove request type. */
REMOVE,
/** Remove All request type. */
REMOVE_ALL,
/** Get group keys request type. */
GET_GROUP_KEYS,
/** Dispose request type. */
DISPOSE,
/** Get group keys request type. */
GET_GROUP_NAMES
}
=======================================================================
==src/java/org/apache/jcs/engine/logging/behavior/ICacheEvent.java
=======================================================================
package org.apache.jcs.engine.logging.behavior;
import java.io.Serializable;
/** Defines the common fields required by a cache event. */
public interface ICacheEvent<K extends Serializable>
extends Serializable
{
/**
* @param source the source to set
*/
public void setSource( String source );
/**
* @return the source
*/
public String getSource();
/**
* @param region the region to set
*/
public void setRegion( String region );
/**
* @return the region
*/
public String getRegion();
/**
* @param eventName the eventName to set
*/
public void setEventName( String eventName );
/**
* @return the eventName
*/
public String getEventName();
/**
* @param optionalDetails the optionalDetails to set
*/
public void setOptionalDetails( String optionalDetails );
/**
* @return the optionalDetails
*/
public String getOptionalDetails();
/**
* @param key the key to set
=======================================================================
==src/java/org/apache/jcs/engine/logging/behavior/ICacheEventLogger.java
=======================================================================
package org.apache.jcs.engine.logging.behavior;
import java.io.Serializable;
/**
* This defines the behavior for event logging. Auxiliaries will send events to injected event
* loggers.
* <p>
* In general all ICache interface methods should call the logger if one is configured. This will be
* done on an ad hoc basis for now. Various auxiliaries may have additional events.
*/
public interface ICacheEventLogger
{
/** ICache update */
static final String UPDATE_EVENT = "update";
/** ICache get */
static final String GET_EVENT = "get";
/** ICache getMultiple */
static final String GETMULTIPLE_EVENT = "getMultiple";
/** ICache getMatching */
static final String GETMATCHING_EVENT = "getMatching";
/** ICache remove */
static final String REMOVE_EVENT = "remove";
/** ICache removeAll */
static final String REMOVEALL_EVENT = "removeAll";
/** ICache dispose */
static final String DISPOSE_EVENT = "dispose";
/** ICache enqueue. The time in the queue. */
//static final String ENQUEUE_EVENT = "enqueue";
/**
* Creates an event.
* <p>
* @param source - e.g. RemoteCacheServer
* @param region - the name of the region
* @param eventName - e.g. update, get, put, remove
* @param optionalDetails - any extra message
* @param key - the cache key
* @return ICacheEvent
*/
<T extends Serializable> ICacheEvent<T> createICacheEvent( String source, String region,
String eventName, String optionalDetails, T key );
/**
=======================================================================
==src/java/org/apache/jcs/engine/logging/CacheEvent.java
=======================================================================
package org.apache.jcs.engine.logging;
import java.io.Serializable;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.jcs.engine.logging.behavior.ICacheEvent;
/** It's returned from create and passed into log. */
public class CacheEvent<K extends Serializable>
implements ICacheEvent<K>
{
/** Don't change. */
private static final long serialVersionUID = -5913139566421714330L;
/** The time at which this object was created. */
private final long createTime = System.currentTimeMillis();
/** The auxiliary or other source of the event. */
private String source;
/** The cache region */
private String region;
/** The event name: update, get, remove, etc. */
private String eventName;
/** disk location, ip, etc. */
private String optionalDetails;
/** The key that was put or retrieved. */
private K key;
/**
* @param source the source to set
*/
public void setSource( String source )
{
this.source = source;
}
/**
* @return the source
*/
public String getSource()
{
return source;
}
/**
* @param region the region to set
=======================================================================
==src/java/org/apache/jcs/engine/logging/CacheEventLoggerDebugLogger.java
=======================================================================
package org.apache.jcs.engine.logging;
import java.io.Serializable;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.jcs.engine.logging.behavior.ICacheEvent;
import org.apache.jcs.engine.logging.behavior.ICacheEventLogger;
/**
* This implementation simple logs to a commons logger at debug level, for all events. It's mainly
* for testing. It isn't very useful otherwise.
*/
public class CacheEventLoggerDebugLogger
implements ICacheEventLogger
{
/** This is the name of the category. */
private String logCategoryName = CacheEventLoggerDebugLogger.class.getName();
/** The logger. This is recreated on set logCategoryName */
private Log log = LogFactory.getLog( logCategoryName );
/**
* @param source
* @param region
* @param eventName
* @param optionalDetails
* @param key
* @return ICacheEvent
*/
public <T extends Serializable> ICacheEvent<T> createICacheEvent( String source, String region, String eventName,
String optionalDetails, T key )
{
ICacheEvent<T> event = new CacheEvent<T>();
event.setSource( source );
event.setRegion( region );
event.setEventName( eventName );
event.setOptionalDetails( optionalDetails );
event.setKey( key );
return event;
}
/**
* @param source
* @param eventName
* @param optionalDetails
*/
public void logApplicationEvent( String source, String eventName, String optionalDetails )
{
=======================================================================
==src/java/org/apache/jcs/engine/match/behavior/IKeyMatcher.java
=======================================================================
package org.apache.jcs.engine.match.behavior;
import java.io.Serializable;
import java.util.Set;
/** Key matchers need to implement this interface. */
public interface IKeyMatcher<K extends Serializable> extends Serializable
{
/**
* Creates a pattern and find matches on the array.
* <p>
* @param pattern
* @param keyArray
* @return Set of the matching keys
*/
Set<K> getMatchingKeysFromArray( String pattern, Set<K> keyArray );
}
=======================================================================
==src/java/org/apache/jcs/engine/match/KeyMatcherPatternImpl.java
=======================================================================
package org.apache.jcs.engine.match;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.jcs.engine.match.behavior.IKeyMatcher;
/** This implementation of the KeyMatcher uses standard Java Pattern matching. */
public class KeyMatcherPatternImpl<K extends Serializable>
implements IKeyMatcher<K>
{
/** TODO serialVersionUID */
private static final long serialVersionUID = 6667352064144381264L;
/**
* Creates a pattern and find matches on the array.
* <p>
* @param pattern
* @param keyArray
* @return Set of the matching keys
*/
public Set<K> getMatchingKeysFromArray( String pattern, Set<K> keyArray )
{
Pattern compiledPattern = Pattern.compile( pattern );
Set<K> matchingKeys = new HashSet<K>();
// Look for matches
for (K key : keyArray)
{
// TODO we might want to match on the toString.
if ( key instanceof String )
{
Matcher matcher = compiledPattern.matcher( (String) key );
if ( matcher.matches() )
{
matchingKeys.add( key );
}
}
}
return matchingKeys;
}
}
=======================================================================
==src/java/org/apache/jcs/engine/memory/AbstractDoubleLinkedListMemoryCache.java
=======================================================================
package org.apache.jcs.engine.memory;
import java.io.IOException;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.jcs.engine.CacheConstants;
import org.apache.jcs.engine.behavior.ICacheElement;
import org.apache.jcs.engine.control.CompositeCache;
import org.apache.jcs.engine.control.group.GroupAttrName;
import org.apache.jcs.engine.memory.util.MemoryElementDescriptor;
import org.apache.jcs.engine.stats.StatElement;
import org.apache.jcs.engine.stats.Stats;
import org.apache.jcs.engine.stats.behavior.IStatElement;
import org.apache.jcs.engine.stats.behavior.IStats;
import org.apache.jcs.utils.struct.DoubleLinkedList;
/**
* This class contains methods that are common to memory caches using the double linked list, such
* as the LRU, MRU, FIFO, and LIFO caches.
* <p>
* Children can control the expiration algorithm by controlling the update and get. The last item in
* the list will be the one removed when the list fills. For instance LRU should more items to the
* front as they are used. FIFO should simply add new items to the front of the list.
*/
public abstract class AbstractDoubleLinkedListMemoryCache<K extends Serializable, V extends Serializable>
extends AbstractMemoryCache<K, V>
{
/** Don't change. */
private static final long serialVersionUID = 1422569420563967389L;
/** The logger. */
private final static Log log = LogFactory.getLog( AbstractDoubleLinkedListMemoryCache.class );
/** thread-safe double linked list for lru */
protected DoubleLinkedList<MemoryElementDescriptor<K, V>> list;
/** number of hits */
protected int hitCnt = 0;
/** number of misses */
protected int missCnt = 0;
=======================================================================
==src/java/org/apache/jcs/engine/memory/MemoryCache.java
=======================================================================
=======================================================================
==src/java/org/apache/jcs/utils/date/DateFormatter.java
=======================================================================
package org.apache.jcs.utils.date;
import java.text.ParseException;
import java.util.Date;
/**
* This makes standard formatted dates.
* <p>
* This is used by the KeyGenerationUtil.
*/
public final class DateFormatter
{
/** static methods */
private DateFormatter()
{
// no instances
}
/** DDDHHmm */
private static final String dddHHmmFormat = "DDDHHmm";
/** DDDHHmmss */
private static final String dddHHmmssFormat = "DDDHHmmss";
/** dddHHmmFormatter */
private static final ThreadSafeSimpleDateFormat dddHHmmFormatter = new ThreadSafeSimpleDateFormat( dddHHmmFormat );
/** dddHHmmssFormatter */
private static final ThreadSafeSimpleDateFormat dddHHmmssFormatter = new ThreadSafeSimpleDateFormat( dddHHmmssFormat );
/**
* Takes string that look like 20051017
* <p>
* @param in in
* @return Date for the string, if the input is null, null is returned.
* @throws ParseException ParseException
*/
public static Date parseFormattedStringDddHHmm( String in )
throws ParseException
{
Date retval = null;
if ( in != null )
{
retval = dddHHmmFormatter.parse( in );
}
return retval;
}
/**
=======================================================================
==src/java/org/apache/jcs/utils/date/ThreadSafeSimpleDateFormat.java
=======================================================================
package org.apache.jcs.utils.date;
import java.text.DateFormatSymbols;
import java.text.FieldPosition;
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
/**
* Thread Safe version of SimpleDateFormat
* <p>
* This class simply synchronizes format and parse for SimpleDateFormat.
*/
public class ThreadSafeSimpleDateFormat
extends SimpleDateFormat
{
/**
* Generated Serial Version ID
*/
private static final long serialVersionUID = -6394173605134585999L;
/**
* Empty Constructor
*/
public ThreadSafeSimpleDateFormat()
{
super();
}
/**
* @param pattern the pattern describing the date and time format
*/
public ThreadSafeSimpleDateFormat( String pattern )
{
super( pattern );
}
/**
* @param pattern the pattern describing the date and time format
* @param lenient leniency option - if false, strictly valid dates are enforced
*/
public ThreadSafeSimpleDateFormat( String pattern, boolean lenient )
{
super( pattern );
this.setLenient( lenient );
}
/**
* @param pattern the pattern describing the date and time format
=======================================================================
==src/java/org/apache/jcs/utils/key/KeyGeneratorUtil.java
=======================================================================
package org.apache.jcs.utils.key;
import java.text.ParseException;
import java.util.Calendar;
import java.util.Date;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.jcs.utils.date.DateFormatter;
/**
* This can create and parse request ids. You can use it to generate keys that contain a create time stamp.
* <p>
* You can set a system property called "KEY_LEAD_NUMBER" to override the lead number. The value
* must be a simple int from 1 to 9.
*/
public final class KeyGeneratorUtil
{
/** The logger. */
private static final Log log = LogFactory.getLog( KeyGeneratorUtil.class );
/** a temporary counter for generating request ids. */
private static int requestCounter = 0;
/** last reset time. */
private static long lastCounterResetTime = System.currentTimeMillis();
/** defaults to 2 hours. */
private static final long DEFAULT_COUNTER_RESET_INTERVAL_MILLIS = 2 * 60 * 60 * 1000;
/** How often should we reset the counter. */
protected static long counterResetIntervalMillis = DEFAULT_COUNTER_RESET_INTERVAL_MILLIS;
/** The size of the data portion. */
private static final int LENGTH_OF_DATE_STRING = 8;
/**
* The name of the system property that can be used to override the default. This allows us to
* run multiple instance on a machine.
*/
public static final String KEY_LEAD_NUMBER_PROPERTY_NAME = "KEY_LEAD_NUMBER";
/** The default lead number. */
public static final int DEFAULT_LEAD_NUMBER = 3;
/** We lead with a number so it can be converted to a number. This is the prefix to all ids. */
protected static int leadNumber = DEFAULT_LEAD_NUMBER;
static
{
=======================================================================
==src/java/org/apache/jcs/utils/net/AddressUtil.java
=======================================================================
package org.apache.jcs.utils.net;
import java.net.UnknownHostException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/** Utility for getting info on the local ip address. */
public final class AddressUtil
{
/** log instance */
private static final Log log = LogFactory.getLog( AddressUtil.class );
/** the default returned string value for the last octet */
public static final String DEFAULT_INTERNET_ADDRESS_OCTET_AS_STRING = "000";
/** the default returned string value for the whole ip */
public static final String DEFAULT_INTERNET_ADDRESS_AS_STRING = "0.0.0.0";
/** current address octet as string */
private static String currentAddressOctetAsString = null;
/**
* private constructor.
*/
private AddressUtil()
{
if ( log.isDebugEnabled() )
{
log.debug( "private constructor" );
}
}
/**
* This method looks up the host machines internet address, parses out the last octet and
* formats that number as a 3 character string.
* @return a string containing the digits of the ip address
*/
public static synchronized String obtainFinalThreeDigitsOfAddressAsString()
{
if ( currentAddressOctetAsString == null )
{
currentAddressOctetAsString = obtainFinalThreeDigitsOfAddressAsStringLookup();
}
return currentAddressOctetAsString;
}
/**
* This method looks up the host machines internet address, parses out the last octet and
=======================================================================
==src/scripts/zipcodes.txt
=======================================================================
82001,Cheyenne
82002,Cheyenne
82003,Cheyenne
82005,FE Warren AFB
82006,Cheyenne
82007,Cheyenne
82008,Cheyenne
82009,Cheyenne
82010,Cheyenne
82050,Albin
82051,Bosler
82052,Buford
82053,Burns
82054,Carpenter
82055,Centennial
82058,Garrett
82059,Granite Canon
82060,Hillsdale
82061,Horse Creek
82063,Jelm
82070,Laramie
82071,Laramie
82072,Laramie
82073,Laramie
82081,Meriden
82082,Pine Bluffs
82083,Rock River
82084,Tie Siding
82190,Yellowstone National Park
82201,Wheatland
82210,Chugwater
82212,Fort Laramie
82213,Glendo
82214,Guernsey
82215,Hartville
82217,Hawk Springs
82218,Huntley
82219,Jay Em
82221,Lagrange
82222,Lance Creek
82223,Lingle
82224,Lost Springs
82225,Lusk
82227,Manville
82229,Shawnee
82240,Torrington
82242,Van Tassell
82243,Veteran
82244,Yoder
82301,Rawlins
=======================================================================
==src/site/resources/download_jcs.cgi
=======================================================================
#!/bin/sh
# Just call the standard mirrors.cgi script. It will use download.html
# as the input template.
exec /www/www.apache.org/dyn/mirrors/mirrors.cgi $*
=======================================================================
==src/test/org/apache/jcs/auxiliary/AuxiliaryCacheConfiguratorUnitTest.java
=======================================================================
package org.apache.jcs.auxiliary;
import java.util.Properties;
import junit.framework.TestCase;
import org.apache.jcs.engine.behavior.IElementSerializer;
import org.apache.jcs.engine.control.MockElementSerializer;
import org.apache.jcs.engine.logging.MockCacheEventLogger;
import org.apache.jcs.utils.serialization.StandardSerializer;
/** Unit tests for the auxiliary cache configurator. */
public class AuxiliaryCacheConfiguratorUnitTest
extends TestCase
{
/**
* Verify that we don't get an error.
*/
public void testParseCacheEventLogger_Null()
{
// SETUP
Properties props = new Properties();
// DO WORK
MockCacheEventLogger result = (MockCacheEventLogger) AuxiliaryCacheConfigurator.parseCacheEventLogger( props,
"junk" );
// VERIFY
assertNull( "Should not have a logger.", result );
}
/**
* Verify that we don't get an error.
*/
public void testParseCacheEventLogger_NullName()
{
// SETUP
Properties props = new Properties();
// DO WORK
MockCacheEventLogger result = (MockCacheEventLogger) AuxiliaryCacheConfigurator.parseCacheEventLogger( props,
null );
// VERIFY
assertNull( "Should not have a logger.", result );
}
/**
* Verify that we can parse the event logger.
*/
=======================================================================
==src/test/org/apache/jcs/auxiliary/disk/AbstractDiskCacheUnitTest.java
=======================================================================
package org.apache.jcs.auxiliary.disk;
import java.io.IOException;
import java.io.Serializable;
import java.io.StringWriter;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import junit.framework.TestCase;
import org.apache.jcs.TestLogConfigurationUtil;
import org.apache.jcs.auxiliary.AuxiliaryCacheAttributes;
import org.apache.jcs.auxiliary.disk.behavior.IDiskCacheAttributes;
import org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes;
import org.apache.jcs.engine.CacheElement;
import org.apache.jcs.engine.CacheStatus;
import org.apache.jcs.engine.ElementAttributes;
import org.apache.jcs.engine.behavior.ICacheElement;
import org.apache.jcs.engine.behavior.IElementAttributes;
/** Tests for the abstract disk cache. It's largely tested by actual instances. */
public class AbstractDiskCacheUnitTest
extends TestCase
{
/**
* Verify that update and get work.
* <p>
* @throws IOException
*/
public void testUpdateGet_allowed()
throws IOException
{
// SETUP
String cacheName = "testUpdateGet_allowed";
IDiskCacheAttributes diskCacheAttributes = new IndexedDiskCacheAttributes();
diskCacheAttributes.setCacheName( cacheName );
AbstractDiskCacheTestInstance<String, String> diskCache = new AbstractDiskCacheTestInstance<String, String>( diskCacheAttributes );
String key = "myKey";
String value = "myValue";
IElementAttributes elementAttributes = new ElementAttributes();
ICacheElement<String, String> cacheElement = new CacheElement<String, String>( cacheName, key, value, elementAttributes );
diskCache.update( cacheElement );
// DO WORK
ICacheElement<String, String> result = diskCache.get( key );
=======================================================================
==src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheManagerUnitTest.java
=======================================================================
package org.apache.jcs.auxiliary.disk.block;
import junit.framework.TestCase;
import org.apache.jcs.auxiliary.AuxiliaryCache;
import org.apache.jcs.auxiliary.MockCacheEventLogger;
import org.apache.jcs.engine.behavior.IElementSerializer;
import org.apache.jcs.engine.control.MockElementSerializer;
import org.apache.jcs.engine.logging.behavior.ICacheEventLogger;
/** Unit tests for the manager */
public class BlockDiskCacheManagerUnitTest
extends TestCase
{
/** Verify that the disk cache has the event logger */
public void testGetCache_normal()
{
// SETUP
String cacheName = "testGetCache_normal";
BlockDiskCacheAttributes defaultCacheAttributes = new BlockDiskCacheAttributes();
defaultCacheAttributes.setDiskPath( "target/BlockDiskCacheManagerUnitTest" );
ICacheEventLogger cacheEventLogger = new MockCacheEventLogger();
IElementSerializer elementSerializer = new MockElementSerializer();
BlockDiskCacheManager manager = BlockDiskCacheManager.getInstance( defaultCacheAttributes, cacheEventLogger,
elementSerializer );
// DO WORK
AuxiliaryCache<String, String> auxcache = manager.getCache(cacheName);
BlockDiskCache<String, String> cache = (BlockDiskCache<String, String>) auxcache;
// VERIFY
assertEquals( "wrong cacheEventLogger", cacheEventLogger, cache.getCacheEventLogger() );
assertEquals( "wrong elementSerializer", elementSerializer, cache.getElementSerializer() );
}
}
=======================================================================
==src/test/org/apache/jcs/auxiliary/disk/block/BlockDiskCacheUnitTest.java
=======================================================================
package org.apache.jcs.auxiliary.disk.block;
import java.io.File;
import java.io.Serializable;
import java.util.Map;
import junit.framework.TestCase;
import org.apache.jcs.engine.CacheElement;
import org.apache.jcs.engine.behavior.ICacheElement;
import org.apache.jcs.utils.serialization.StandardSerializer;
/** Unit tests for the Block Disk Cache */
public class BlockDiskCacheUnitTest
extends TestCase
{
/**
* Test the basic get matching.
* <p>
* @throws Exception
*/
public void testPutGetMatching_SmallWait()
throws Exception
{
// SETUP
int items = 200;
String cacheName = "testPutGetMatching_SmallWait";
BlockDiskCacheAttributes cattr = new BlockDiskCacheAttributes();
cattr.setCacheName( cacheName );
cattr.setMaxKeySize( 100 );
cattr.setDiskPath( "target/test-sandbox/BlockDiskCacheUnitTest" );
BlockDiskCache<String, String> diskCache = new BlockDiskCache<String, String>( cattr );
// DO WORK
for ( int i = 0; i <= items; i++ )
{
diskCache.update( new CacheElement<String, String>( cacheName, i + ":key", cacheName + " data " + i ) );
}
Thread.sleep( 500 );
Map<String, ICacheElement<String, String>> matchingResults = diskCache.getMatching( "1.8.+" );
// VERIFY
assertEquals( "Wrong number returned", 10, matchingResults.size() );
//System.out.println( "matchingResults.keySet() " + matchingResults.keySet() );
//System.out.println( "\nAFTER TEST \n" + diskCache.getStats() );
}
/**
=======================================================================
==src/test/org/apache/jcs/auxiliary/disk/file/FileDiskCacheFactoryUnitTest.java
=======================================================================
package org.apache.jcs.auxiliary.disk.file;
import junit.framework.TestCase;
import org.apache.jcs.auxiliary.MockCacheEventLogger;
import org.apache.jcs.engine.behavior.ICompositeCacheManager;
import org.apache.jcs.engine.behavior.IElementSerializer;
import org.apache.jcs.engine.control.MockCompositeCacheManager;
import org.apache.jcs.engine.control.MockElementSerializer;
import org.apache.jcs.engine.logging.behavior.ICacheEventLogger;
/** Verify that the factory works */
public class FileDiskCacheFactoryUnitTest
extends TestCase
{
/** Verify that we can get a cache from the manager via the factory */
public void testCreateCache_Normal()
{
// SETUP
String cacheName = "testCreateCache_Normal";
FileDiskCacheAttributes cattr = new FileDiskCacheAttributes();
cattr.setCacheName( cacheName );
cattr.setDiskPath( "target/test-sandbox/FileDiskCacheFactoryUnitTest" );
ICompositeCacheManager cacheMgr = new MockCompositeCacheManager();
ICacheEventLogger cacheEventLogger = new MockCacheEventLogger();
IElementSerializer elementSerializer = new MockElementSerializer();
FileDiskCacheFactory factory = new FileDiskCacheFactory();
// DO WORK
FileDiskCache<String, String> result = factory.createCache( cattr, cacheMgr, cacheEventLogger,
elementSerializer );
// VERIFY
assertNotNull( "Should have a disk cache", result );
assertEquals( "Should have a disk cache with a serializer", elementSerializer, result.getElementSerializer() );
}
}
=======================================================================
==src/test/org/apache/jcs/auxiliary/disk/file/FileDiskCacheUnitTest.java
=======================================================================
package org.apache.jcs.auxiliary.disk.file;
import java.io.File;
import junit.framework.TestCase;
import org.apache.jcs.engine.CacheElement;
import org.apache.jcs.engine.CacheStatus;
import org.apache.jcs.engine.behavior.ICacheElement;
import org.apache.jcs.utils.timing.SleepUtil;
/** Unit tests for the disk file cache. */
public class FileDiskCacheUnitTest
extends TestCase
{
/**
* Verify initialization.
* <p>
* @throws Exception
*/
public void testInitialization_Normal()
throws Exception
{
// SETUP
String cacheName = "testInitialization_Normal";
FileDiskCacheAttributes cattr = new FileDiskCacheAttributes();
cattr.setCacheName( cacheName );
cattr.setDiskPath( "target/test-sandbox/DiskFileCacheUnitTest" );
// DO WORK
FileDiskCache<String, String> diskCache = new FileDiskCache<String, String>( cattr );
File directory = diskCache.getDirectory();
// VERIFY
assertNotNull( "Should have a directory", directory );
assertTrue( "Should have an existing directory", directory.exists() );
assertTrue( "Directory should include the cache name. " + directory.getAbsolutePath(), directory
.getAbsolutePath().indexOf( cacheName ) != -1 );
assertTrue( "Directory should include the disk path. " + directory.getAbsolutePath(), directory
.getAbsolutePath().indexOf( "DiskFileCacheUnitTest" ) != -1 );
assertTrue( "Should be alive", diskCache.getStatus() == CacheStatus.ALIVE );
}
/**
* Verify dispose.
* <p>
* @throws Exception
*/
public void testDispose_Normal()
throws Exception
=======================================================================
==src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheManagerUnitTest.java
=======================================================================
package org.apache.jcs.auxiliary.disk.indexed;
import java.io.IOException;
import junit.framework.TestCase;
import org.apache.jcs.auxiliary.MockCacheEventLogger;
import org.apache.jcs.engine.CacheElement;
import org.apache.jcs.engine.behavior.ICacheElement;
import org.apache.jcs.engine.control.MockElementSerializer;
import org.apache.jcs.engine.logging.behavior.ICacheEventLogger;
import org.apache.jcs.utils.timing.SleepUtil;
/** Unit tests for the manager */
public class IndexedDiskCacheManagerUnitTest
extends TestCase
{
/**
* Verify that the disk cache has the event logger
* @throws IOException
*/
public void testGetCache_normal()
throws IOException
{
// SETUP
String cacheName = "testGetCache_normal";
IndexedDiskCacheAttributes defaultCacheAttributes = new IndexedDiskCacheAttributes();
defaultCacheAttributes.setDiskPath( "target/IndexedDiskCacheManagerUnitTest" );
ICacheEventLogger cacheEventLogger = new MockCacheEventLogger();
MockElementSerializer elementSerializer = new MockElementSerializer();
String key = "myKey";
ICacheElement<String, String> cacheElement = new CacheElement<String, String>( "test", key, "MyValue" );
IndexedDiskCacheManager manager = IndexedDiskCacheManager.getInstance( defaultCacheAttributes,
cacheEventLogger, elementSerializer );
// DO WORK
IndexedDiskCache<String, String> cache = manager.getCache( cacheName );
cache.update( cacheElement );
SleepUtil.sleepAtLeast( 100 );
cache.get( key );
// VERIFY
assertEquals( "wrong cacheEventLogger", cacheEventLogger, cache.getCacheEventLogger() );
assertEquals( "wrong elementSerializer", elementSerializer, cache.getElementSerializer() );
assertEquals( "Wrong serialize count", elementSerializer.serializeCount, 1 );
assertEquals( "Wrong deSerialize count", elementSerializer.deSerializeCount, 1 );
=======================================================================
==src/test/org/apache/jcs/auxiliary/disk/jdbc/HsqlSetupTableUtil.java
=======================================================================
package org.apache.jcs.auxiliary.disk.jdbc;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
/** Can use this to setup a table. */
public class HsqlSetupTableUtil
{
/**
* SETUP a TABLE FOR CACHE testing
* <p>
* @param cConn
* @param tableName
*
* @throws SQLException if database problems occur
*/
public static void setupTABLE( Connection cConn, String tableName ) throws SQLException
{
boolean newT = true;
StringBuffer createSql = new StringBuffer();
createSql.append( "CREATE CACHED TABLE " + tableName + " " );
createSql.append( "( " );
createSql.append( "CACHE_KEY VARCHAR(250) NOT NULL, " );
createSql.append( "REGION VARCHAR(250) NOT NULL, " );
createSql.append( "ELEMENT BINARY, " );
createSql.append( "CREATE_TIME TIMESTAMP, " );
createSql.append( "UPDATE_TIME_SECONDS BIGINT, " );
createSql.append( "MAX_LIFE_SECONDS BIGINT, " );
createSql.append( "SYSTEM_EXPIRE_TIME_SECONDS BIGINT, " );
createSql.append( "IS_ETERNAL CHAR(1), " );
createSql.append( "PRIMARY KEY (CACHE_KEY, REGION) " );
createSql.append( ");" );
Statement sStatement = cConn.createStatement();
try
{
sStatement.executeQuery( createSql.toString() );
}
catch ( SQLException e )
{
if ( e.toString().indexOf( "already exists" ) != -1 )
{
newT = false;
}
else
{
throw e;
=======================================================================
==src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManagerUnitTest.java
=======================================================================
package org.apache.jcs.auxiliary.disk.jdbc;
import junit.framework.TestCase;
import org.apache.jcs.auxiliary.MockCacheEventLogger;
import org.apache.jcs.engine.behavior.IElementSerializer;
import org.apache.jcs.engine.control.CompositeCacheManager;
import org.apache.jcs.engine.control.MockElementSerializer;
import org.apache.jcs.engine.logging.behavior.ICacheEventLogger;
/** Unit tests for the manager */
public class JDBCDiskCacheManagerUnitTest
extends TestCase
{
/** Verify that the disk cache has the event logger */
public void testGetCache_normal()
{
// SETUP
String cacheName = "testGetCache_normal";
JDBCDiskCacheAttributes defaultCacheAttributes = new JDBCDiskCacheAttributes();
defaultCacheAttributes.setDiskPath( "target/JDBCDiskCacheManagerUnitTest" );
ICacheEventLogger cacheEventLogger = new MockCacheEventLogger();
IElementSerializer elementSerializer = new MockElementSerializer();
JDBCDiskCacheManager manager = JDBCDiskCacheManager.getInstance( defaultCacheAttributes, CompositeCacheManager
.getUnconfiguredInstance(), cacheEventLogger, elementSerializer );
// DO WORK
JDBCDiskCache<String, String> cache = manager.getCache( cacheName );
// VERIFY
assertEquals( "wrong cacheEventLogger", cacheEventLogger, cache.getCacheEventLogger() );
assertEquals( "wrong elementSerializer", elementSerializer, cache.getElementSerializer() );
}
}
=======================================================================
==src/test/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCachePoolAccessManagerUnitTest.java
=======================================================================
package org.apache.jcs.auxiliary.disk.jdbc;
import java.sql.Connection;
import java.sql.DriverManager;
import java.util.Properties;
import junit.framework.TestCase;
/** Unit tests for the pool manager */
public class JDBCDiskCachePoolAccessManagerUnitTest
extends TestCase
{
/** Verify that we can configure the object based on the props. */
public void testConfigurePoolAccessAttributes_Simple()
{
// SETUP
String poolName = "testConfigurePoolAccessAttributes_Simple";
String url = "adfads";
String userName = "zvzvz";
String password = "qewrrewq";
int maxActive = 10;
String driverClassName = "org.hsqldb.jdbcDriver";
Properties props = new Properties();
String prefix = JDBCDiskCachePoolAccessManager.POOL_CONFIGURATION_PREFIX + poolName
+ JDBCDiskCachePoolAccessManager.ATTRIBUTE_PREFIX;
props.put( prefix + ".url", url );
props.put( prefix + ".userName", userName );
props.put( prefix + ".password", password );
props.put( prefix + ".maxActive", String.valueOf( maxActive ) );
props.put( prefix + ".driverClassName", driverClassName );
JDBCDiskCachePoolAccessManager manager = JDBCDiskCachePoolAccessManager.getInstance( props );
// DO WORK
JDBCDiskCachePoolAccessAttributes result = manager.configurePoolAccessAttributes( poolName );
// VERIFY
assertEquals( "Wrong url value", url, result.getUrl() );
assertEquals( "Wrong userName value", userName, result.getUserName() );
assertEquals( "Wrong password value", password, result.getPassword() );
assertEquals( "Wrong maxActive value", maxActive, result.getMaxActive() );
assertEquals( "Wrong driverClassName value", driverClassName, result.getDriverClassName() );
}
/**
* Verify that we can get access.
* <p>
* @throws Exception
=======================================================================
==src/test/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheManagerUnitTest.java
=======================================================================
package org.apache.jcs.auxiliary.disk.jdbc.mysql;
import junit.framework.TestCase;
import org.apache.jcs.auxiliary.MockCacheEventLogger;
import org.apache.jcs.engine.behavior.IElementSerializer;
import org.apache.jcs.engine.control.CompositeCacheManager;
import org.apache.jcs.engine.control.MockElementSerializer;
import org.apache.jcs.engine.logging.behavior.ICacheEventLogger;
/** Unit tests for the manager */
public class MySQLDiskCacheManagerUnitTest
extends TestCase
{
/** Verify that the disk cache has the event logger */
public void testGetCache_normal()
{
// SETUP
String cacheName = "testGetCache_normal";
MySQLDiskCacheAttributes defaultCacheAttributes = new MySQLDiskCacheAttributes();
defaultCacheAttributes.setDiskPath( "target/JDBCDiskCacheManagerUnitTest" );
ICacheEventLogger cacheEventLogger = new MockCacheEventLogger();
IElementSerializer elementSerializer = new MockElementSerializer();
MySQLDiskCacheManager manager = MySQLDiskCacheManager.getInstance( defaultCacheAttributes, CompositeCacheManager.getUnconfiguredInstance(), cacheEventLogger,
elementSerializer );
// DO WORK
MySQLDiskCache<String, String> cache = manager.getCache( cacheName );
// VERIFY
assertEquals( "wrong cacheEventLogger", cacheEventLogger, cache.getCacheEventLogger() );
assertEquals( "wrong elementSerializer", elementSerializer, cache.getElementSerializer() );
}
}
=======================================================================
==src/test/org/apache/jcs/auxiliary/disk/LRUMapJCSUnitTest.java
=======================================================================
package org.apache.jcs.auxiliary.disk;
import java.io.StringWriter;
import junit.framework.TestCase;
import org.apache.jcs.TestLogConfigurationUtil;
/** Unit tests for the LRUMapJCS implementation. */
public class LRUMapJCSUnitTest
extends TestCase
{
/** Verify that we default to unlimited */
public void testDefault()
{
// SETUP
// DO WORK
LRUMapJCS<String, String> map = new LRUMapJCS<String, String>();
// VERIFY
assertEquals( "Should be unlimted", -1, map.getMaxObjects() );
}
/** Verify that we default to unlimited */
public void testLimited()
{
// SETUP
int expected = 100;
// DO WORK
LRUMapJCS<String, String> map = new LRUMapJCS<String, String>( expected );
// VERIFY
assertEquals( "Should be expected", expected, map.getMaxObjects() );
}
/** Verify that the log message. */
public void testProcessRemovedLRU()
{
// SETUP
StringWriter stringWriter = new StringWriter();
TestLogConfigurationUtil.configureLogger( stringWriter, LRUMapJCS.class.getName() );
LRUMapJCS<String, String> map = new LRUMapJCS<String, String>();
String key = "myKey";
String value = "myValue";
// DO WORK
=======================================================================
==src/test/org/apache/jcs/auxiliary/disk/PurgatoryElementUnitTest.java
=======================================================================
package org.apache.jcs.auxiliary.disk;
import junit.framework.TestCase;
import org.apache.jcs.engine.CacheElement;
import org.apache.jcs.engine.ElementAttributes;
import org.apache.jcs.engine.behavior.ICacheElement;
import org.apache.jcs.engine.behavior.IElementAttributes;
/** Simple unit tests for the Purgatory Element. */
public class PurgatoryElementUnitTest
extends TestCase
{
/** Verify basic data */
public void testSpoolable_normal()
{
// SETUP
String cacheName = "myCacheName";
String key = "myKey";
String value = "myValue";
IElementAttributes elementAttributes = new ElementAttributes();
ICacheElement<String, String> cacheElement = new CacheElement<String, String>( cacheName, key, value, elementAttributes );
PurgatoryElement<String, String> purgatoryElement = new PurgatoryElement<String, String>( cacheElement );
purgatoryElement.setSpoolable( false );
// DO WORK
boolean result = purgatoryElement.isSpoolable();
// VERIFY
assertFalse( "Should not be spoolable.", result );
}
/** Verify basic data */
public void testElementAttributes_normal()
{
// SETUP
String cacheName = "myCacheName";
String key = "myKey";
String value = "myValue";
IElementAttributes elementAttributes = new ElementAttributes();
ICacheElement<String, String> cacheElement = new CacheElement<String, String>( cacheName, key, value );
PurgatoryElement<String, String> purgatoryElement = new PurgatoryElement<String, String>( cacheElement );
purgatoryElement.setElementAttributes( elementAttributes );
// DO WORK
IElementAttributes result = cacheElement.getElementAttributes();
// VERIFY
assertEquals( "Should have set the attributes on the element", elementAttributes, result );
=======================================================================
==src/test/org/apache/jcs/auxiliary/lateral/LateralCacheNoWaitFacadeUnitTest.java
=======================================================================
package org.apache.jcs.auxiliary.lateral;
import junit.framework.TestCase;
import org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheAttributes;
/**
* Tests for LateralCacheNoWaitFacade.
*/
public class LateralCacheNoWaitFacadeUnitTest
extends TestCase
{
/**
* Verify that we can remove an item.
*/
public void testAddThenRemoveNoWait_InList()
{
// SETUP
@SuppressWarnings("unchecked")
LateralCacheNoWait<String, String>[] noWaits = new LateralCacheNoWait[0];
ILateralCacheAttributes cattr = new LateralCacheAttributes();
cattr.setCacheName( "testCache1" );
LateralCacheNoWaitFacade<String, String> facade = new LateralCacheNoWaitFacade<String, String>( null, noWaits, cattr );
LateralCache<String, String> cache = new LateralCache<String, String>( cattr );
LateralCacheNoWait<String, String> noWait = new LateralCacheNoWait<String, String>( cache );
// DO WORK
facade.addNoWait( noWait );
// VERIFY
assertTrue( "Should be in the list.", facade.containsNoWait( noWait ) );
// DO WORK
facade.removeNoWait( noWait );
// VERIFY
assertEquals( "Should have 0", 0, facade.noWaits.length );
assertFalse( "Should not be in the list. ", facade.containsNoWait( noWait ) );
}
/**
* Verify that we can remove an item.
*/
public void testAddThenRemoveNoWait_InListSize2()
{
// SETUP
@SuppressWarnings("unchecked")
LateralCacheNoWait<String, String>[] noWaits = new LateralCacheNoWait[0];
=======================================================================
==src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPDiscoveryListenerUnitTest.java
=======================================================================
package org.apache.jcs.auxiliary.lateral.socket.tcp;
import java.util.ArrayList;
import junit.framework.TestCase;
import org.apache.jcs.auxiliary.lateral.LateralCache;
import org.apache.jcs.auxiliary.lateral.LateralCacheAttributes;
import org.apache.jcs.auxiliary.lateral.LateralCacheNoWait;
import org.apache.jcs.auxiliary.lateral.LateralCacheNoWaitFacade;
import org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheAttributes;
import org.apache.jcs.auxiliary.lateral.socket.tcp.behavior.ITCPLateralCacheAttributes;
import org.apache.jcs.engine.behavior.ICompositeCacheManager;
import org.apache.jcs.engine.behavior.IElementSerializer;
import org.apache.jcs.engine.control.CompositeCacheManager;
import org.apache.jcs.engine.logging.MockCacheEventLogger;
import org.apache.jcs.utils.discovery.DiscoveredService;
import org.apache.jcs.utils.serialization.StandardSerializer;
/** Test for the listener that observers UDP discovery events. */
public class LateralTCPDiscoveryListenerUnitTest
extends TestCase
{
/** the listener */
private LateralTCPDiscoveryListener listener;
/** The cache manager. */
private ICompositeCacheManager cacheMgr;
/** The event logger. */
protected MockCacheEventLogger cacheEventLogger;
/** The serializer. */
protected IElementSerializer elementSerializer;
/** Create the listener for testing */
@Override
protected void setUp() throws Exception
{
cacheMgr = CompositeCacheManager.getInstance();
cacheEventLogger = new MockCacheEventLogger();
elementSerializer = new StandardSerializer();
listener = new LateralTCPDiscoveryListener( cacheMgr, cacheEventLogger, elementSerializer );
}
/**
* Add a no wait facade.
*/
public void testAddNoWaitFacade_NotInList()
=======================================================================
==src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/TestTCPLateralUnitTest.java.rej
=======================================================================
@@ -30,6 +32,8 @@
import org.apache.jcs.engine.behavior.ICompositeCacheManager;
import org.apache.jcs.engine.control.CompositeCacheManager;
import org.apache.jcs.engine.control.MockCompositeCacheManager;
+import org.apache.jcs.engine.control.group.GroupAttrName;
+import org.apache.jcs.engine.control.group.GroupId;
import org.apache.jcs.utils.timing.SleepUtil;
/**
=======================================================================
==src/test/org/apache/jcs/auxiliary/MockAuxiliaryCacheAttributes.java
=======================================================================
package org.apache.jcs.auxiliary;
/** For testing. */
public class MockAuxiliaryCacheAttributes
extends AbstractAuxiliaryCacheAttributes
{
/** Don't change. */
private static final long serialVersionUID = 1091238902450504108L;
/**
* Doesn't really copy
* <p>
* @return this
*/
public AuxiliaryCacheAttributes copy()
{
return this;
}
}
=======================================================================
==src/test/org/apache/jcs/auxiliary/MockAuxiliaryCacheFactory.java
=======================================================================
package org.apache.jcs.auxiliary;
import java.io.Serializable;
import org.apache.jcs.engine.behavior.ICompositeCacheManager;
import org.apache.jcs.engine.behavior.IElementSerializer;
import org.apache.jcs.engine.logging.behavior.ICacheEventLogger;
/** For testing */
public class MockAuxiliaryCacheFactory
implements AuxiliaryCacheFactory
{
/** the name of the aux */
public String name = "MockAuxiliaryCacheFactory";
/**
* Creates a mock aux.
* <p>
* @param attr
* @param cacheMgr
* @param cacheEventLogger
* @param elementSerializer
* @return AuxiliaryCache
*/
public <K extends Serializable, V extends Serializable> AuxiliaryCache<K, V>
createCache( AuxiliaryCacheAttributes attr, ICompositeCacheManager cacheMgr,
ICacheEventLogger cacheEventLogger, IElementSerializer elementSerializer )
{
MockAuxiliaryCache<K, V> auxCache = new MockAuxiliaryCache<K, V>();
auxCache.setCacheEventLogger( cacheEventLogger );
auxCache.setElementSerializer( elementSerializer );
return auxCache;
}
/**
* @return String
*/
public String getName()
{
return name;
}
/**
* @param s
*/
public void setName( String s )
{
this.name = s;
}
}
=======================================================================
==src/test/org/apache/jcs/auxiliary/MockCacheEventLogger.java
=======================================================================
package org.apache.jcs.auxiliary;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import org.apache.jcs.engine.logging.CacheEvent;
import org.apache.jcs.engine.logging.behavior.ICacheEvent;
import org.apache.jcs.engine.logging.behavior.ICacheEventLogger;
/**
* For testing auxiliary event logging. Improve later so we can test the details. This is very
* crude.
*/
public class MockCacheEventLogger
implements ICacheEventLogger
{
/** times called */
public int applicationEventCalls = 0;
/** times called */
public int startICacheEventCalls = 0;
/** times called */
public int endICacheEventCalls = 0;
/** times called */
public int errorEventCalls = 0;
/** list of messages */
public List<String> errorMessages = new ArrayList<String>();
/**
* @param source
* @param eventName
* @param optionalDetails
*/
public void logApplicationEvent( String source, String eventName, String optionalDetails )
{
applicationEventCalls++;
}
/**
* @param cacheEvent
*/
public <T extends Serializable> void logICacheEvent( ICacheEvent<T> event )
{
endICacheEventCalls++;
}
=======================================================================
==src/test/org/apache/jcs/auxiliary/remote/http/client/RemoteHttpCacheDispatcherUniTest.java
=======================================================================
package org.apache.jcs.auxiliary.remote.http.client;
import junit.framework.TestCase;
import org.apache.jcs.auxiliary.remote.value.RemoteCacheRequest;
import org.apache.jcs.auxiliary.remote.value.RemoteRequestType;
/** Unit tests for the dispatcher. */
public class RemoteHttpCacheDispatcherUniTest
extends TestCase
{
/**
* Verify that we don't get two ?'s
*/
public void testAddParameters_withQueryString()
{
// SETUP
RemoteHttpCacheAttributes remoteHttpCacheAttributes = new RemoteHttpCacheAttributes();
RemoteHttpCacheDispatcher dispatcher = new RemoteHttpCacheDispatcher( remoteHttpCacheAttributes );
RemoteCacheRequest<String, String> remoteCacheRequest = new RemoteCacheRequest<String, String>();
remoteCacheRequest.setRequestType( RemoteRequestType.REMOVE_ALL );
String cacheName = "myCache";
remoteCacheRequest.setCacheName( cacheName );
String baseUrl = "http://localhost?thishasaquestionmark";
// DO WORK
String result = dispatcher.addParameters( remoteCacheRequest, baseUrl );
// VERIFY
assertEquals( "Wrong url", baseUrl + "&CacheName=" + cacheName + "&Key=&RequestType=REMOVE_ALL", result );
}
}
=======================================================================
==src/test/org/apache/jcs/auxiliary/remote/server/MockRMISocketFactory.java
=======================================================================
package org.apache.jcs.auxiliary.remote.server;
import java.io.IOException;
import java.io.Serializable;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.rmi.server.RMISocketFactory;
/** For testing the custom socket factory configuration */
public class MockRMISocketFactory
extends RMISocketFactory
implements Serializable
{
/** Don't change */
private static final long serialVersionUID = 1056199478581218676L;
/** for testing automatic property configuration. */
private String testStringProperty;
/**
* @param host
* @param port
* @return Socket
* @throws IOException
*/
@Override
public Socket createSocket( String host, int port )
throws IOException
{
System.out.println( "Creating socket" );
Socket socket = new Socket();
socket.setSoTimeout( 1000 );
socket.setSoLinger( false, 0 );
socket.connect( new InetSocketAddress( host, port ), 1000 );
return socket;
}
/**
* @param port
* @return ServerSocket
* @throws IOException
*/
@Override
public ServerSocket createServerSocket( int port )
throws IOException
{
System.out.println( "Creating server socket" );
=======================================================================
==src/test/org/apache/jcs/auxiliary/remote/server/RegistryKeepAliveRunnerUnitTest.java
=======================================================================
package org.apache.jcs.auxiliary.remote.server;
import junit.framework.TestCase;
import org.apache.jcs.auxiliary.MockCacheEventLogger;
/** Unit tests for the registry keep alive runner. */
public class RegistryKeepAliveRunnerUnitTest
extends TestCase
{
/** Verify that we get the appropriate event log */
public void testCheckAndRestoreIfNeeded_failure()
{
// SETUP
String host = "localhost";
int port = 1234;
String service = "doesn'texist";
MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();
RegistryKeepAliveRunner runner = new RegistryKeepAliveRunner( host, port, service );
runner.setCacheEventLogger( cacheEventLogger );
// DO WORK
runner.checkAndRestoreIfNeeded();
// VERIFY
// 1 for the lookup, one for the rebind since the server isn't created yet
assertEquals( "error tally", 2, cacheEventLogger.errorEventCalls );
//System.out.println( cacheEventLogger.errorMessages );
}
}
=======================================================================
==src/test/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerFactoryUnitTest.java
=======================================================================
package org.apache.jcs.auxiliary.remote.server;
import java.rmi.server.RMISocketFactory;
import java.util.Properties;
import junit.framework.TestCase;
import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheConstants;
/** Unit tests for the factory */
public class RemoteCacheServerFactoryUnitTest
extends TestCase
{
/** verify that we get the timeout value */
public void testConfigureRemoteCacheServerAttributes_eventQueueType()
{
// SETUP
String eventQueueType = "my.special.type";
Properties props = new Properties();
props.put( IRemoteCacheConstants.CACHE_SERVER_ATTRIBUTES_PROPERTY_PREFIX + ".EventQueueType", eventQueueType );
// DO WORK
RemoteCacheServerAttributes result = RemoteCacheServerFactory.configureRemoteCacheServerAttributes( props );
// VERIFY
assertEquals( "Wrong EventQueueType", eventQueueType, result.getEventQueueType() );
}
/** verify that we get the timeout value */
public void testConfigureRemoteCacheServerAttributes_eventQueuePoolName()
{
// SETUP
String eventQueuePoolName = "specialName";
Properties props = new Properties();
props.put( IRemoteCacheConstants.CACHE_SERVER_ATTRIBUTES_PROPERTY_PREFIX + ".EventQueuePoolName", eventQueuePoolName );
// DO WORK
RemoteCacheServerAttributes result = RemoteCacheServerFactory.configureRemoteCacheServerAttributes( props );
// VERIFY
assertEquals( "Wrong eventQueuePoolName", eventQueuePoolName, result.getEventQueuePoolName() );
}
/** verify that we get the timeout value */
public void testConfigureRemoteCacheServerAttributes_timeoutPresent()
{
// SETUP
int timeout = 123245;
Properties props = new Properties();
props.put( IRemoteCacheConstants.SOCKET_TIMEOUT_MILLIS, String.valueOf( timeout ) );
=======================================================================
==src/test/org/apache/jcs/auxiliary/remote/server/TimeoutConfigurableRMIScoketFactoryUnitTest.java
=======================================================================
package org.apache.jcs.auxiliary.remote.server;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import junit.framework.TestCase;
/** Unit tests for the custom factory */
public class TimeoutConfigurableRMIScoketFactoryUnitTest
extends TestCase
{
/**
* Simple test to see that we can create a server socket and connect.
* <p>
* @throws IOException
*/
public void testCreateAndConnect() throws IOException
{
// SETUP
int port = 3455;
String host = "localhost";
TimeoutConfigurableRMIScoketFactory factory = new TimeoutConfigurableRMIScoketFactory();
// DO WORK
ServerSocket serverSocket = factory.createServerSocket( port );
Socket socket = factory.createSocket( host, port );
socket.close();
serverSocket.close();
// VERIFY
// passive, no errors
}
}
=======================================================================
==src/test/org/apache/jcs/auxiliary/remote/util/RemoteCacheRequestFactoryUnitTest.java
=======================================================================
package org.apache.jcs.auxiliary.remote.util;
import java.io.Serializable;
import java.util.Collections;
import java.util.Set;
import junit.framework.TestCase;
import org.apache.jcs.auxiliary.remote.value.RemoteCacheRequest;
import org.apache.jcs.auxiliary.remote.value.RemoteRequestType;
import org.apache.jcs.engine.CacheElement;
/** Unit tests for the request creator. */
public class RemoteCacheRequestFactoryUnitTest
extends TestCase
{
/** Simple test */
public void testCreateGetRequest_Normal()
{
// SETUP
String cacheName = "test";
Serializable key = "key";
long requesterId = 2;
// DO WORK
RemoteCacheRequest<Serializable, Serializable> result =
RemoteCacheRequestFactory.createGetRequest( cacheName, key, requesterId );
// VERIFY
assertNotNull( "Should have a result", result );
assertEquals( "Wrong cacheName", cacheName, result.getCacheName() );
assertEquals( "Wrong type", RemoteRequestType.GET, result.getRequestType() );
}
/** Simple test */
public void testCreateGetMatchingRequest_Normal()
{
// SETUP
String cacheName = "test";
String pattern = "pattern";
long requesterId = 2;
// DO WORK
RemoteCacheRequest<Serializable, Serializable> result =
RemoteCacheRequestFactory.createGetMatchingRequest( cacheName, pattern, requesterId );
// VERIFY
assertNotNull( "Should have a result", result );
assertEquals( "Wrong cacheName", cacheName, result.getCacheName() );
assertEquals( "Wrong type", RemoteRequestType.GET_MATCHING, result.getRequestType() );
=======================================================================
==src/test/org/apache/jcs/engine/CacheEventQueueFactoryUnitTest.java
=======================================================================
package org.apache.jcs.engine;
import junit.framework.TestCase;
import org.apache.jcs.auxiliary.remote.MockRemoteCacheListener;
import org.apache.jcs.engine.behavior.ICacheEventQueue;
import org.apache.jcs.engine.behavior.ICacheListener;
/** Unit tests for the CacheEventQueueFactory */
public class CacheEventQueueFactoryUnitTest
extends TestCase
{
/** Test create */
public void testCreateCacheEventQueue_Single()
{
// SETUP
String eventQueueType = ICacheEventQueue.SINGLE_QUEUE_TYPE;
ICacheListener<String, String> listener = new MockRemoteCacheListener<String, String>();
long listenerId = 1;
CacheEventQueueFactory<String, String> factory = new CacheEventQueueFactory<String, String>();
// DO WORK
ICacheEventQueue<String, String> result = factory.createCacheEventQueue( listener, listenerId, "cacheName", "threadPoolName", eventQueueType );
// VERIFY
assertNotNull( "Should have a result", result );
assertTrue( "Wrong type", result instanceof CacheEventQueue );
}
/** Test create */
public void testCreateCacheEventQueue_Pooled()
{
// SETUP
String eventQueueType = ICacheEventQueue.POOLED_QUEUE_TYPE;
ICacheListener<String, String> listener = new MockRemoteCacheListener<String, String>();
long listenerId = 1;
CacheEventQueueFactory<String, String> factory = new CacheEventQueueFactory<String, String>();
// DO WORK
ICacheEventQueue<String, String> result = factory.createCacheEventQueue( listener, listenerId, "cacheName", "threadPoolName", eventQueueType );
// VERIFY
assertNotNull( "Should have a result", result );
assertTrue( "Wrong type", result instanceof PooledCacheEventQueue );
}
/** Test create */
public void testCreateCacheEventQueue_Custom()
=======================================================================
==src/test/org/apache/jcs/engine/control/CompositeCacheConfiguratorUnitTest.java
=======================================================================
package org.apache.jcs.engine.control;
import java.util.Properties;
import junit.framework.TestCase;
import org.apache.jcs.auxiliary.AuxiliaryCache;
import org.apache.jcs.auxiliary.AuxiliaryCacheConfigurator;
import org.apache.jcs.auxiliary.MockAuxiliaryCache;
import org.apache.jcs.auxiliary.MockAuxiliaryCacheAttributes;
import org.apache.jcs.auxiliary.MockAuxiliaryCacheFactory;
import org.apache.jcs.engine.logging.MockCacheEventLogger;
/** Unit tests for the configurator. */
public class CompositeCacheConfiguratorUnitTest
extends TestCase
{
/**
* Verify that we can parse the event logger correctly
*/
public void testParseAuxiliary_CacheEventLogger_Normal()
{
// SETUP
String regionName = "MyRegion";
String auxName = "MockAux";
String auxPrefix = "jcs.auxiliary." + auxName;
String auxiliaryClassName = MockAuxiliaryCacheFactory.class.getName();
String eventLoggerClassName = MockCacheEventLogger.class.getName();
String auxiliaryAttributeClassName = MockAuxiliaryCacheAttributes.class.getName();
Properties props = new Properties();
props.put( auxPrefix, auxiliaryClassName );
props.put( auxPrefix + CompositeCacheConfigurator.ATTRIBUTE_PREFIX, auxiliaryAttributeClassName );
props.put( auxPrefix + AuxiliaryCacheConfigurator.CACHE_EVENT_LOGGER_PREFIX, eventLoggerClassName );
System.out.print( props );
CompositeCacheManager manager = CompositeCacheManager.getUnconfiguredInstance();
CompositeCacheConfigurator configurator = new CompositeCacheConfigurator( manager );
// DO WORK
AuxiliaryCache<String, String> aux = configurator.parseAuxiliary( props, auxName, regionName );
MockAuxiliaryCache<String, String> result = (MockAuxiliaryCache<String, String>)aux;
// VERIFY
assertNotNull( "Should have an auxcache.", result );
assertNotNull( "Should have an event logger.", result.getCacheEventLogger() );
}
=======================================================================
==src/test/org/apache/jcs/engine/control/MockElementSerializer.java
=======================================================================
package org.apache.jcs.engine.control;
import java.io.IOException;
import java.io.Serializable;
import org.apache.jcs.engine.behavior.IElementSerializer;
import org.apache.jcs.utils.serialization.StandardSerializer;
/** For mocking. */
public class MockElementSerializer
implements IElementSerializer
{
/** test property */
private String testProperty;
/** What's used in the background */
private final StandardSerializer serializer = new StandardSerializer();
/** times out was called */
public int deSerializeCount = 0;
/** times in was called */
public int serializeCount = 0;
/**
* @param bytes
* @return Object
* @throws IOException
* @throws ClassNotFoundException
*
*/
public <T extends Serializable> T deSerialize( byte[] bytes )
throws IOException, ClassNotFoundException
{
deSerializeCount++;
return serializer.deSerialize( bytes );
}
/**
* @param obj
* @return byte[]
* @throws IOException
*
*/
public <T extends Serializable> byte[] serialize( T obj )
throws IOException
{
serializeCount++;
return serializer.serialize( obj );
}
=======================================================================
==src/test/org/apache/jcs/engine/logging/CacheEventLoggerDebugLoggerUnitTest.java
=======================================================================
package org.apache.jcs.engine.logging;
import java.io.StringWriter;
import junit.framework.TestCase;
import org.apache.jcs.engine.logging.behavior.ICacheEvent;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.log4j.PatternLayout;
import org.apache.log4j.WriterAppender;
/** Unit tests for the debug implementation */
public class CacheEventLoggerDebugLoggerUnitTest
extends TestCase
{
/** verify that we can log */
public void testLogICacheEvent_normal()
{
// SETUP
String logCategoryName = "testLogEvent_normal";
String source = "mySource";
String region = "my region";
String eventName = "MyEventName";
String optionalDetails = "SomeExtraData";
String key = "my key";
StringWriter stringWriter = new StringWriter();
configureLogger( stringWriter, logCategoryName );
CacheEventLoggerDebugLogger logger = new CacheEventLoggerDebugLogger();
logger.setLogCategoryName( logCategoryName );
ICacheEvent<String> event = logger.createICacheEvent( source, region, eventName, optionalDetails, key );
// DO WORK
logger.logICacheEvent( event );
// VERIFY
String result = stringWriter.toString();
assertTrue( "An event with the source should have been logged:" + result, result.indexOf( source ) != -1 );
assertTrue( "An event with the region should have been logged:" + result, result.indexOf( region ) != -1 );
assertTrue( "An event with the event name should have been logged:" + result, result.indexOf( eventName ) != -1 );
assertTrue( "An event with the optionalDetails should have been logged:" + result, result.indexOf( optionalDetails ) != -1 );
assertTrue( "An event with the key should have been logged:" + result, result.indexOf( key ) != -1 );
}
/** verify that we can log */
=======================================================================
==src/test/org/apache/jcs/engine/logging/MockCacheEventLogger.java
=======================================================================
package org.apache.jcs.engine.logging;
import java.io.Serializable;
import org.apache.jcs.engine.logging.behavior.ICacheEvent;
import org.apache.jcs.engine.logging.behavior.ICacheEventLogger;
/**
* For testing the configurator.
*/
public class MockCacheEventLogger
implements ICacheEventLogger
{
/** test property */
private String testProperty;
/**
* @param source
* @param eventName
* @param optionalDetails
*/
public void logApplicationEvent( String source, String eventName, String optionalDetails )
{
// TODO Auto-generated method stub
}
/**
* @param source
* @param eventName
* @param errorMessage
*/
public void logError( String source, String eventName, String errorMessage )
{
// TODO Auto-generated method stub
}
/**
* @param source
* @param region
* @param eventName
* @param optionalDetails
* @param key
* @return ICacheEvent
*/
public <T extends Serializable> ICacheEvent<T> createICacheEvent( String source, String region, String eventName, String optionalDetails,
T key )
{
return new CacheEvent<T>();
}
=======================================================================
==src/test/org/apache/jcs/engine/match/KeyMatcherPatternImpllUnitTest.java
=======================================================================
package org.apache.jcs.engine.match;
import java.util.HashSet;
import java.util.Set;
import junit.framework.TestCase;
/** Unit tests for the key matcher. */
public class KeyMatcherPatternImpllUnitTest
extends TestCase
{
/**
* Verify that the matching method works.
*/
public void testGetMatchingKeysFromArray_AllMatch()
{
// SETUP
int numToInsertPrefix1 = 10;
Set<String> keyArray = new HashSet<String>();
String keyprefix1 = "MyPrefixC";
// insert with prefix1
for ( int i = 0; i < numToInsertPrefix1; i++ )
{
keyArray.add(keyprefix1 + String.valueOf( i ));
}
KeyMatcherPatternImpl<String> keyMatcher = new KeyMatcherPatternImpl<String>();
// DO WORK
Set<String> result1 = keyMatcher.getMatchingKeysFromArray( keyprefix1 + ".", keyArray );
// VERIFY
assertEquals( "Wrong number returned 1: " + result1, numToInsertPrefix1, result1.size() );
}
/**
* Verify that the matching method works.
*/
public void testGetMatchingKeysFromArray_AllMatchFirstNull()
{
// SETUP
int numToInsertPrefix1 = 10;
Set<String> keyArray = new HashSet<String>();
String keyprefix1 = "MyPrefixC";
// insert with prefix1
for ( int i = 1; i < numToInsertPrefix1 + 1; i++ )
=======================================================================
==src/test/org/apache/jcs/engine/memory/fifo/FIFOMemoryCacheUnitTest.java
=======================================================================
package org.apache.jcs.engine.memory.fifo;
import java.io.IOException;
import junit.framework.TestCase;
import org.apache.jcs.engine.CacheElement;
import org.apache.jcs.engine.CompositeCacheAttributes;
import org.apache.jcs.engine.ElementAttributes;
import org.apache.jcs.engine.behavior.ICompositeCacheAttributes;
import org.apache.jcs.engine.control.CompositeCache;
/** Unit tests for the fifo implementation. */
public class FIFOMemoryCacheUnitTest
extends TestCase
{
/**
* Verify that the oldest inserted item is removed
* <p>
* @throws IOException
*/
public void testExpirationPolicy_oneExtra()
throws IOException
{
// SETUP
int maxObjects = 10;
String cacheName = "testExpirationPolicy_oneExtra";
ICompositeCacheAttributes attributes = new CompositeCacheAttributes();
attributes.setMaxObjects( maxObjects );
attributes.setSpoolChunkSize( 1 );
FIFOMemoryCache<String, String> cache = new FIFOMemoryCache<String, String>();
cache.initialize( new CompositeCache<String, String>( cacheName, attributes,
new ElementAttributes() ) );
for ( int i = 0; i <= maxObjects; i++ )
{
CacheElement<String, String> element = new CacheElement<String, String>( cacheName, "key" + i, "value" + i );
cache.update( element );
}
CacheElement<String, String> oneMoreElement = new CacheElement<String, String>( cacheName, "onemore", "onemore" );
// DO WORK
cache.update( oneMoreElement );
// VERIFY
assertEquals( "Should have max elements", maxObjects, cache.getSize() );
for ( int i = maxObjects; i > maxObjects; i-- )
=======================================================================
==src/test/org/apache/jcs/engine/MockCacheEventQueue.java
=======================================================================
package org.apache.jcs.engine;
import java.io.Serializable;
import org.apache.jcs.auxiliary.remote.MockRemoteCacheListener;
/** For testing the factory */
public class MockCacheEventQueue<K extends Serializable, V extends Serializable>
extends CacheEventQueue<K, V>
{
/** junk */
public MockCacheEventQueue()
{
super( new MockRemoteCacheListener<K, V>(), 1, null, 1, 1 );
}
}
=======================================================================
==src/test/org/apache/jcs/TestLogConfigurationUtil.java
=======================================================================
package org.apache.jcs;
import java.io.StringWriter;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.log4j.PatternLayout;
import org.apache.log4j.WriterAppender;
/** Utility for testing log messages. */
public class TestLogConfigurationUtil
{
/**
* Configures a logger for the given name. This allows us to check the log output.
* <p>
* @param stringWriter string writer
* @param loggerName logger name
*/
public static void configureLogger( StringWriter stringWriter, String loggerName )
{
Logger logger = Logger.getLogger( loggerName );
WriterAppender appender = new WriterAppender( new PatternLayout(), stringWriter );
logger.addAppender( appender );
logger.setLevel( Level.DEBUG );
}
}
=======================================================================
==src/test/org/apache/jcs/utils/date/DateFormatterUnitTest.java
=======================================================================
package org.apache.jcs.utils.date;
import java.util.Calendar;
import java.util.Date;
import junit.framework.TestCase;
/** Simple tests for the date formatter utility. */
public class DateFormatterUnitTest
extends TestCase
{
/**
* Output a date into a String like 3591010.
*/
public void testGetDddHHmm()
{
// SETUP
Calendar c = Calendar.getInstance();
c.set( Calendar.DATE, 25 );
c.set( Calendar.MONTH, Calendar.DECEMBER );
c.set( Calendar.YEAR, 2005 );
c.set( Calendar.HOUR_OF_DAY, 10 );
c.set( Calendar.MINUTE, 10 );
// DO WORK
String formatted = DateFormatter.getDddHHmm( c.getTime() );
// VERIFY
assertNotNull( "Missing formatted date", formatted );
assertEquals( "Incorrectly formatted date", "3591010", formatted.toUpperCase() );
}
/**
* Verify that we can get a date from a string
* @throws Exception on error
*/
public void testParseFormattedStringDddHHmm()
throws Exception
{
// SETUP
String formatted = "3591017";
// DO WORK
Date date = DateFormatter.parseFormattedStringDddHHmm( formatted );
// VERIFY
Calendar calendar = Calendar.getInstance();
calendar.setTime( date );
assertEquals( "Month is wrong", 12, calendar.get( Calendar.MONTH ) + 1 );
assertEquals( "Date is wrong", 25, calendar.get( Calendar.DATE ) );
=======================================================================
==src/test/org/apache/jcs/utils/date/ThreadSafeSimpleDateFormatUnitTest.java
=======================================================================
package org.apache.jcs.utils.date;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;
import junit.framework.TestCase;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.jcs.utils.timing.SleepUtil;
/**
* Multi-threaded tests for SimpleDateFormat.
*/
public class ThreadSafeSimpleDateFormatUnitTest
extends TestCase
{
/** log instance */
private static final Log log = LogFactory.getLog( ThreadSafeSimpleDateFormatUnitTest.class );
/** date format string */
private static final String DATE_FORMAT_STRING = "yyyy-MM-dd kk:mm:ss:SSS";
/** test run length */
private static final int TEST_RUN_LENGTH = 100;
/** number of threads */
private static final int NUM_THREADS = 50;
/** random number generator */
protected static final Random random = new Random();
/** number wrong */
protected int numWrong = 0;
/** number of loops? */
protected int numLoops = 0;
/** run? */
protected boolean run = false;
/** a simpledateformat instance */
private SimpleDateFormat simpleDateFormat = new SimpleDateFormat( DATE_FORMAT_STRING );
/** a threadsafe simpledateformat instance */
private ThreadSafeSimpleDateFormat threadSafeSimpleDateFormat = new ThreadSafeSimpleDateFormat( DATE_FORMAT_STRING );
=======================================================================
==src/test/org/apache/jcs/utils/key/KeyGeneratorUtilUnitTest.java
=======================================================================
package org.apache.jcs.utils.key;
import java.text.ParseException;
import java.util.Calendar;
import java.util.Date;
import junit.framework.TestCase;
import org.apache.jcs.utils.date.DateFormatter;
import org.apache.jcs.utils.timing.SleepUtil;
/**
* Tests for the Key Generator Util.
*/
public class KeyGeneratorUtilUnitTest
extends TestCase
{
/**
* Creates a query id. Verify that we lead with the system lead.
*/
public void testGetQueryId_SytemLeadNumber_Good()
{
// SETUP
String lead = "9";
System.setProperty( KeyGeneratorUtil.KEY_LEAD_NUMBER_PROPERTY_NAME, lead );
// have to force this since it might have already been loaded.
KeyGeneratorUtil.setLeadFromSystemProperty();
String expectedDate = DateFormatter.getDddHHmm( new Date() );
// DO WORK
String result = KeyGeneratorUtil.generateRequestId();
// VERIFY
assertNotNull( "We should have a query id.", result );
assertTrue( "Should have the input.", result.indexOf( String.valueOf( expectedDate ) ) != -1 );
assertEquals( "Wrong lead", lead, result.substring( 0, 1 ) );
}
/**
* Creates a query id. Verify that we lead with the default if the system lead is junk.
*/
public void testGetQueryId_SytemLeadNumber_Nan()
{
// SETUP
KeyGeneratorUtil.leadNumber = KeyGeneratorUtil.DEFAULT_LEAD_NUMBER;
String lead = "afdsafsadf";
System.setProperty( KeyGeneratorUtil.KEY_LEAD_NUMBER_PROPERTY_NAME, lead );
// have to force this since it might have already been loaded.
KeyGeneratorUtil.setLeadFromSystemProperty();
String expectedDate = DateFormatter.getDddHHmm( new Date() );
=======================================================================
==src/test/org/apache/jcs/utils/net/AddressUtilUnitTest.java
=======================================================================
package org.apache.jcs.utils.net;
import junit.framework.TestCase;
/**
* Basic AddressUtil Test class.
*/
public class AddressUtilUnitTest
extends TestCase
{
/**
* test the basics
*/
public void testOctetBasicAddressParsing()
{
String tempStr = AddressUtil.obtainFinalThreeDigitsOfAddressAsString();
assertNotNull( "some result shoudl come back", tempStr );
assertTrue( "shoudl not be default", !tempStr.equals( "000" ) );
}
}
=======================================================================
==src/test/org/apache/jcs/utils/net/HostNameUtilUnitTest.java
=======================================================================
package org.apache.jcs.utils.net;
import java.net.UnknownHostException;
import junit.framework.TestCase;
/** Tests for the host name util. */
public class HostNameUtilUnitTest
extends TestCase
{
/**
* It's nearly impossible to unit test the getLocalHostLANAddress method.
* <p>
* @throws UnknownHostException
*/
public void testGetLocalHostAddress_Simple() throws UnknownHostException
{
// DO WORK
String result = HostNameUtil.getLocalHostAddress();
// VERIFY
//System.out.print( result );
assertNotNull( "Should have a host address.", result );
}
}
=======================================================================
==src/test/org/apache/jcs/utils/struct/DoubleLinkedListUnitTest.java
=======================================================================
package org.apache.jcs.utils.struct;
import java.io.StringWriter;
import junit.framework.TestCase;
import org.apache.jcs.TestLogConfigurationUtil;
/** Unit tests for the double linked list. */
public class DoubleLinkedListUnitTest
extends TestCase
{
/** verify that the last is added when the list is empty. */
public void testAddLast_Empty()
{
// SETUP
DoubleLinkedList<DoubleLinkedListNode<String>> list = new DoubleLinkedList<DoubleLinkedListNode<String>>();
String payload1 = "payload1";
DoubleLinkedListNode<String> node1 = new DoubleLinkedListNode<String>( payload1 );
// WO WORK
list.addLast( node1 );
// VERIFY
assertEquals( "Wrong last", node1, list.getLast() );
}
/** verify that the last is added when the list is empty. */
public void testAddLast_NotEmpty()
{
// SETUP
DoubleLinkedList<DoubleLinkedListNode<String>> list = new DoubleLinkedList<DoubleLinkedListNode<String>>();
String payload1 = "payload1";
DoubleLinkedListNode<String> node1 = new DoubleLinkedListNode<String>( payload1 );
String payload2 = "payload2";
DoubleLinkedListNode<String> node2 = new DoubleLinkedListNode<String>( payload2 );
// WO WORK
list.addLast( node1 );
list.addLast( node2 );
// VERIFY
assertEquals( "Wrong last", node2, list.getLast() );
}
/** verify that it's added last. */
public void testMakeLast_wasFirst()