org.jwarp.service.cache
Class CacheUpdateThread

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--org.jwarp.service.cache.CacheUpdateThread
All Implemented Interfaces:
java.lang.Runnable

public class CacheUpdateThread
extends java.lang.Thread

This is the updating thread for the cache utility class. For each cache instance one such thread is intitialised and started. Its task is to call the caches update method from time to time. The updating interval is defined by long representing ms.


Field Summary
(package private)  boolean running
          The running variable.
 
Fields inherited from class java.lang.Thread
inheritableThreadLocals, MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY, threadLocals
 
Constructor Summary
CacheUpdateThread(ICache cache, long updateInterval)
          Constructs a new update thread for the given cachen using the update interval passed.
 
Method Summary
 long getUpdateIntervall()
          Returns the update interval in ms
 void run()
          Overwritten thread method who does actually the work.
 void setUpdateIntervall(long millis)
          Sets the update interval
 void stopRunning()
          Stop this thread.
 
Methods inherited from class java.lang.Thread
, activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, 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
 

Field Detail

running

boolean running
The running variable. If this is set to false then the update thread will stop working.
Constructor Detail

CacheUpdateThread

public CacheUpdateThread(ICache cache,
                         long updateInterval)
Constructs a new update thread for the given cachen using the update interval passed.
Parameters:
cache - The cache to be updated.
updateInterval - The update interval in ms
Method Detail

getUpdateIntervall

public long getUpdateIntervall()
Returns the update interval in ms
Returns:
The update interval

setUpdateIntervall

public void setUpdateIntervall(long millis)
Sets the update interval
Parameters:
millis - The update interval in ms

run

public void run()
Overwritten thread method who does actually the work. Most of the time this method is just sleeping. If woken up the caches update method is called.
Overrides:
run in class java.lang.Thread

stopRunning

public void stopRunning()
Stop this thread.

©   O R C A   S y s t e m s