public abstract class TimingHandler<K,V> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
TimingHandler.Tunable |
Constructor and Description |
---|
TimingHandler() |
Modifier and Type | Method and Description |
---|---|
abstract long |
cacheExceptionUntil(Entry<K,V> e,
ExceptionInformation inf)
Delegated to the resilience policy
|
abstract long |
calculateNextRefreshTime(Entry<K,V> e,
V v,
long _loadTime)
Calculates the expiry time for a value that was just loaded or inserted into the cache.
|
void |
cancelExpiryTimer(Entry<K,V> e)
Cancel the timer on the entry, if a timer was set.
|
void |
close() |
void |
init(InternalCache<K,V> c)
Initialize timer, if needed.
|
static <K,V> TimingHandler<K,V> |
of(InternalClock _clock,
Cache2kConfiguration<K,V> cfg) |
void |
reset()
Cancel all timer events, and re-initialize timer
|
void |
scheduleFinalTimerForSharpExpiry(Entry<K,V> e)
Schedule second timer event for the expiry tie if sharp expiry is switched on.
|
void |
shutdown()
Cancels all pending timer events.
|
boolean |
startRefreshProbationTimer(Entry<K,V> e,
long _nextRefreshTime)
Start timer for expiring an entry on the separate refresh hash.
|
long |
stopStartTimer(long _expiryTime,
Entry<K,V> e)
Convert expiry value to the entry field value, essentially maps 0 to
Entry.EXPIRED
since 0 is a virgin entry. |
abstract long |
suppressExceptionUntil(Entry<K,V> e,
ExceptionInformation inf)
Delegated to the resilience policy
|
public static <K,V> TimingHandler<K,V> of(InternalClock _clock, Cache2kConfiguration<K,V> cfg)
public void init(InternalCache<K,V> c)
public void reset()
public void shutdown()
public void close()
public abstract long calculateNextRefreshTime(Entry<K,V> e, V v, long _loadTime)
e
- The entry, filled with the previous value if there is a value present alreay.v
- The new value or an exception wrapped in ExceptionWrapper
_loadTime
- the time immediately before the load startedExpiryPolicy.calculateExpiryTime(Object, Object, long, CacheEntry)
public abstract long suppressExceptionUntil(Entry<K,V> e, ExceptionInformation inf)
public abstract long cacheExceptionUntil(Entry<K,V> e, ExceptionInformation inf)
public long stopStartTimer(long _expiryTime, Entry<K,V> e)
Entry.EXPIRED
since 0 is a virgin entry. Restart the timer if needed._expiryTime
- calculated expiry timepublic boolean startRefreshProbationTimer(Entry<K,V> e, long _nextRefreshTime)
public void cancelExpiryTimer(Entry<K,V> e)
cache2k API documentation. Copyright © 2000–2018 headissue GmbH, Munich.