public class CacheDispatcher extends Thread
ResponseDelivery
. Cache misses and responses that require
refresh are enqueued on the specified network queue for processing
by a NetworkDispatcher
.Thread.State, Thread.UncaughtExceptionHandler
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
CacheDispatcher(BlockingQueue<Request<?>> cacheQueue,
BlockingQueue<Request<?>> networkQueue,
Cache cache,
ResponseDelivery delivery)
Creates a new cache triage dispatcher thread.
|
Modifier and Type | Method and Description |
---|---|
void |
quit()
Forces this dispatcher to quit immediately.
|
void |
run()
If this thread was constructed using a separate
Runnable run object, then that
Runnable object's run method is called;
otherwise, this method does nothing and returns. |
activeCount, blockedOn, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, parkFor$, parkUntil$, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, unpark$, yield
public CacheDispatcher(BlockingQueue<Request<?>> cacheQueue, BlockingQueue<Request<?>> networkQueue, Cache cache, ResponseDelivery delivery)
Thread.start()
in order to begin processing.cacheQueue
- Queue of incoming requests for triagenetworkQueue
- Queue to post requests that require network tocache
- Cache interface to use for resolutiondelivery
- Delivery interface to use for posting responsespublic void quit()
public void run()
Thread
Runnable
run object, then that
Runnable
object's run
method is called;
otherwise, this method does nothing and returns.
Subclasses of Thread
should override this method.
run
in interface Runnable
run
in class Thread
Thread.start()
,
Thread.stop()
,
Thread.Thread(ThreadGroup, Runnable, String)