| java.lang.Object org.w3c.www.protocol.http.cache.CacheStore
All known Subclasses: org.w3c.www.protocol.http.cache.push.PushCacheStore,
CACHE_DIRECTORY_P | final public static String CACHE_DIRECTORY_P(Code) | | Name of the property giving the cache's directory.
This property defaults to the current directory.
|
FILE_SIZE_RATIO_P | final public static String FILE_SIZE_RATIO_P(Code) | | Name of the property indicating the max size for files to be cached.
This property gives the ratio (relative to the cache size) of
the number of bytes a single entry is able to occupy.
The ratio should be given as a floating point value between
0 and 1. If set to 0.1
and the cache size is 5000000, files larger
then 500000 will not be cached (except if garbage
collection is disbabled).
This property defaults to 0.1.
Note that the generation size will be taken from this threshold
|
GARBAGE_COLLECTION_ENABLED_P | final public static String GARBAGE_COLLECTION_ENABLED_P(Code) | | Name of the property enabling garbage collection of the cache.
This property defaults to true.
|
GARBAGE_COLLECTION_THRESHOLD_P | final public static String GARBAGE_COLLECTION_THRESHOLD_P(Code) | | Name of the property used to knkow the percentage of bytes to be
kept after a garbage collection
It defaults to 0.80 (80% of the cache size)
|
GENERATION_COMPACT_DELAY_P | final public static String GENERATION_COMPACT_DELAY_P(Code) | | Name of the property indicating the amount of time in second between
two attempts to compact generations. In milliseconds
|
GENERATION_FILENAME | final public static String GENERATION_FILENAME(Code) | | |
MAX_CACHED_RESOURCES_P | final public static String MAX_CACHED_RESOURCES_P(Code) | | Name of the property indicating the maximal number of resources
the cache can load in memory (not the content of the resources)
|
MAX_GENERATIONS_P | final public static String MAX_GENERATIONS_P(Code) | | Name of the property indicating the maximal number of generations
in this cache store
|
STORE_SIZE_P | final public static String STORE_SIZE_P(Code) | | The name of the properties indicating the storesize of the cache
(in bytes).
This property will give the value of the disk-based cache size. This
value only takes into account the size of the entities saved, not
the size of the associated headers, and not the physical size on the
disc.
This property defaults to 20 Mbytes.
|
SYNCHRONIZATION_DELAY_P | final public static String SYNCHRONIZATION_DELAY_P(Code) | | Name of the property indicating the amount of time in second between
two synchronization of the database (aka dump on disk)
Milliseconds
|
addNewGeneration | protected CacheGeneration addNewGeneration() throws InvalidCacheException(Code) | | Create and add a new Generation. WARNING, this method is not
synchronized.
the newly created generation or null if the max numberof generations is reached or it the current size of the cache(in memory) is too big to accept a new generation. exception: InvalidCacheException - if the cache is corrupted |
checkDirs | protected void checkDirs()(Code) | | Check the subdirectories. Create them if necessary.
|
checkState | protected synchronized void checkState()(Code) | | used for debugging, display some internal information about the state
of the cache
|
cleanCacheDir | protected int cleanCacheDir()(Code) | | Clean the Cache directory, remove unused files.
the number of files deleted. |
compactGenerations | protected void compactGenerations()(Code) | | Compact our generations
The algorithm is the following,
If the number of generation is the maximum number allowed,
then a check is done from the the generation after the MRU one
and if the sum of two generation can fit into one, it is done, and
the generation is removed from the list
|
getCachedByteCount | public synchronized long getCachedByteCount()(Code) | | get the cached size of this cache
a long, the number of bytes cached |
getCachedByteFree | public synchronized long getCachedByteFree()(Code) | | get the number of bytes available for the cache memory
a long, the number of bytes free |
getCompactGenerationDelay | public long getCompactGenerationDelay()(Code) | | Get the delay between two attempts to compact the generations.
a long, the number of milliseconds |
getLRUGeneration | public CacheGeneration getLRUGeneration()(Code) | | Get the LRU generation, ie the Least recently used generation
a CacheGeneration, the least recently used one |
getLRULoadedGeneration | public CacheGeneration getLRULoadedGeneration()(Code) | | Get the oldest loaded generation
a generation |
getMRUGeneration | public CacheGeneration getMRUGeneration()(Code) | | Get the last generation, ie the Most recently used generation
a CacheGeneration, the most recently used one |
getMRUGenerationRatio | public float getMRUGenerationRatio()(Code) | | Get the fill ratio of the last generation (the most recently used)
|
getNewEntryFile | protected File getNewEntryFile()(Code) | | allocate a new name for the next cached resource. This method
create some directories if needed.
a File, used to dump the entry |
getPrevGeneration | public CacheGeneration getPrevGeneration(CacheGeneration gen)(Code) | | Get the previous generation (in LRU order).
Parameters: gen - the current generation a generation |
getRequiredByteNumber | public long getRequiredByteNumber()(Code) | | get the number of bytes the garbage collector needs to collect
to keep the cache in good state, it will only move the resource
to the delete list, another check has to be done to save physical space
a long, the number of bytes to save |
getSerializer | public CacheSerializer getSerializer()(Code) | | return the serializer used by the cache
an instance of Serializer |
getStoredByteCount | public synchronized long getStoredByteCount()(Code) | | get the number of bytes used phisycally by this cache
a long, the number of bytes cached |
getSweeper | public CacheSweeper getSweeper()(Code) | | return the cache sweeper used by the cache
an instance of CacheSweeper |
getSyncDelay | public long getSyncDelay()(Code) | | Get the synchronization delay between to sync, in milliseconds
a long, the number of milliseconds |
getValidator | public CacheValidator getValidator()(Code) | | return the cache validator used by the cache
an instance of CacheValidator |
loadGenerations | protected synchronized void loadGenerations() throws InvalidCacheException(Code) | | Load the generations. Only a subset of the generations will
actually be loaded, some generations will only have a description
(URLs, size) in memory.
This method load some generations (until cr_limit is reached) and the
remaining generations (if any) will only be a set of
CachedResourceDescription.
|
loadState | protected void loadState()(Code) | | Load the store state
|
propertyChanged | public boolean propertyChanged(String name)(Code) | | Property monitoring for the CacheStore.
The CacheStore allows you to dynamically (typically through the property
setter) change the class of the sweeper, the validator, the size...
Parameters: name - The name of the property that has changed. A boolean, true if the change was made, false otherwise. |
resizeGeneration | protected synchronized void resizeGeneration(CacheGeneration cg, CachedResource cr)(Code) | | Resize the generation in order to be able to store the given
Resource.
Parameters: cg - the generation to resize Parameters: cr - the CachedResource to store. |
saveState | protected void saveState()(Code) | | Save the current state
|
storeCachedResource | public boolean storeCachedResource(CachedResource cr, long oldsize) throws InvalidCacheException(Code) | | Store a newly created (or updated) CachedResource.
Parameters: cr - the CachedResource to store true if the resource has been cached exception: InvalidCacheException - if the cache is corrupted |
sync | public synchronized void sync()(Code) | | synchronize the internal database with the storage
|
updateSweeperPriority | protected void updateSweeperPriority()(Code) | | update the mode of the sweeper according to the state of the
cache store,
|
|
|