ca.uhn.cache.internal.impl
Class DefaultStaleChunkRule

java.lang.Object
  extended byca.uhn.cache.internal.impl.DefaultStaleChunkRule
All Implemented Interfaces:
IStaleChunkRule

public class DefaultStaleChunkRule
extends java.lang.Object
implements IStaleChunkRule

Default implementation of IStaleChunkRule.

Version:
$Revision: 1.1 $ updated on $Date: 2005/01/24 22:54:05 $ by $Author: bryan_tripp $
Author:
Bryan Tripp

Constructor Summary
DefaultStaleChunkRule(java.util.Map theVolatilityMap, java.util.Map theUpdateAgeMap, long theDefaultMaxAgeMillis)
           
 
Method Summary
 long getMaxAge(IChunk theChunk)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultStaleChunkRule

public DefaultStaleChunkRule(java.util.Map theVolatilityMap,
                             java.util.Map theUpdateAgeMap,
                             long theDefaultMaxAgeMillis)
Parameters:
theVolatilityMap - keys are VolatilityEnum, values are corresponding max ages since cache time (type Long)
theUpdateAgeMap - keys are Long representing age since last update time, values are corresponding max ages since cache time (type Long)
theDefaultMaxAgeMillis - age at which chunk becomes stale by default, that is if it doesn't before stale sooner because of high volatility or recent last update
Method Detail

getMaxAge

public long getMaxAge(IChunk theChunk)
Specified by:
getMaxAge in interface IStaleChunkRule
Parameters:
theChunk - a chunk to be cached
Returns:
the age of the chunk (i.e. time since cache, in ms) after which the chunk must be evicted, because it is likely to be out of synch with the original data source. This is normally a function of last update time and volatility.
See Also:
IStaleChunkRule.getMaxAge(ca.uhn.cache.internal.IChunk)


Copyright © 2004-2005 University Health Network. All Rights Reserved.