A FileCache is used to cache files until a maximum capacity is reached. Once reached, files having the oldest access time are removed.
@author Paul J. Lucas [paul@lightcrafts.com]
Everything below here is the singleton that maintains the cache proper Classes that do similar things to this one (such as the servlets and sessions manager) are singleton instances, but in this case, the file manager should serve the entire vm, and not even possibly be duplicated across multiple web servers BTW -- a HashMap is used for the cache object as a reminder that every operation on the cache is synchronized against it anyway, so having a synchronized container like hashtable would be even more overhead.
FileCache keeps a cache of files up-to-date with a most simple eviction policy. The eviction policy will keep n items in the cache, and then start evicting the items ordered-by least used first. The cache runs a thread to check for both evictions and refreshes.
@author David S. Taylor David Sean Taylor
@version $Id: FileCache.java,v 1.5 2004/03/25 16:27:41 jford Exp $
FileCache keeps a cache of files up-to-date with a most simple eviction policy. The eviction policy will keep n items in the cache, and then start evicting the items ordered-by least used first. The cache runs a thread to check for both evictions and refreshes.
@author David S. Taylor David Sean Taylor
@version $Id: FileCache.java 828270 2009-10-22 01:23:05Z rwatler $
This class is responsible for managing Sonar batch file cache. You can put file into cache and later try to retrieve them. MD5 is used to differentiate files (name is not secure as files may come from different Sonar servers and have same name but be actually different, and same for SNAPSHOTs).
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.