|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
tuwien.auto.calimero.buffer.cache.CacheSweeper
public final class CacheSweeper
Used to remove expired entries from a cache.
The cache sweeper is running in its own thread, waking up for work every
sweep time interval set by the user. Then Cache.removeExpired()
is invoked on the specified cache.
Cache
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
CacheSweeper(Cache cache,
int sweepInterval)
Creates a CacheSweeper for cache with the given
sweepInterval . |
Method Summary | |
---|---|
int |
getSweepInterval()
Returns the time interval between Cache.removeExpired() calls used by
this cache sweeper. |
void |
run()
|
void |
setSweepInterval(int interval)
Sets a new sweep interval. |
void |
stopSweeper()
Stops the sweeper and quits the thread. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CacheSweeper(Cache cache, int sweepInterval)
CacheSweeper
for cache
with the given
sweepInterval
.
cache
- the cache for which Cache.removeExpired()
should be
invokedsweepInterval
- lapse of time between sweeping in secondsMethod Detail |
---|
public int getSweepInterval()
Cache.removeExpired()
calls used by
this cache sweeper.
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void setSweepInterval(int interval)
If the cache sweeper is in waiting state for next sweep, the new interval is immediately applied and checked against elapsed time.
interval
- new time interval between sweeping in secondspublic void stopSweeper()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |