| java.lang.Object com.sleepycat.je.utilint.DaemonThread
All known Subclasses: com.sleepycat.je.incomp.INCompressor, com.sleepycat.je.recovery.Checkpointer, com.sleepycat.je.evictor.Evictor, com.sleepycat.je.cleaner.FileProcessor,
Method Summary | |
public void | addToQueue(Object o) | public void | addToQueueAlreadyLatched(Collection c) | public int | getNWakeupRequests() For unit testing. | public int | getQueueSize() | public Thread | getThread() For testing. | protected boolean | isPaused() Returns whether the daemon is currently paused/disabled. | public boolean | isRunning() Returns whether the onWakeup method is currently executing. | protected boolean | isShutdownRequested() Returns whether shutdown has been requested. | protected int | nDeadlockRetries() Returns the number of retries to perform when Deadlock Exceptions
occur. | abstract protected void | onWakeup() onWakeup is synchronized to ensure that multiple invocations of the
DaemonThread aren't made. | public void | requestShutdown() | public void | run() | public void | runOrPause(boolean run) If run is true, starts the thread if not started or unpauses it
if already started; if run is false, pauses the thread if
started or does nothing if not started. | public void | shutdown() Requests shutdown and calls join() to wait for the thread to stop. | public String | toString() | public void | wakeup() |
nWakeupRequests | protected int nWakeupRequests(Code) | | |
stifleExceptionChatter | protected boolean stifleExceptionChatter(Code) | | |
getNWakeupRequests | public int getNWakeupRequests()(Code) | | For unit testing.
|
isPaused | protected boolean isPaused()(Code) | | Returns whether the daemon is currently paused/disabled. This method
should be used to to terminate daemon loops.
|
isRunning | public boolean isRunning()(Code) | | Returns whether the onWakeup method is currently executing. This is
only an approximation and is used to avoid unnecessary wakeups.
|
isShutdownRequested | protected boolean isShutdownRequested()(Code) | | Returns whether shutdown has been requested. This method should be
used to to terminate daemon loops.
|
nDeadlockRetries | protected int nDeadlockRetries() throws DatabaseException(Code) | | Returns the number of retries to perform when Deadlock Exceptions
occur.
|
onWakeup | abstract protected void onWakeup() throws DatabaseException(Code) | | onWakeup is synchronized to ensure that multiple invocations of the
DaemonThread aren't made. isRunnable must be called from within
onWakeup to avoid having the following sequence:
Thread A: isRunnable() => true,
Thread B: isRunnable() => true,
Thread A: onWakeup() starts
Thread B: waits for monitor on thread to call onWakeup()
Thread A: onWakeup() completes rendering isRunnable() predicate false
Thread B: onWakeup() starts, but isRunnable predicate is now false
|
requestShutdown | public void requestShutdown()(Code) | | |
runOrPause | public void runOrPause(boolean run)(Code) | | If run is true, starts the thread if not started or unpauses it
if already started; if run is false, pauses the thread if
started or does nothing if not started.
|
shutdown | public void shutdown()(Code) | | Requests shutdown and calls join() to wait for the thread to stop.
|
wakeup | public void wakeup()(Code) | | |
|
|