|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.je.utilint.DaemonThread
public abstract class DaemonThread
A daemon thread.
Field Summary | |
---|---|
protected String |
name
|
protected int |
nWakeupRequests
|
protected Set |
workQueue
|
protected Latch |
workQueueLatch
|
Constructor Summary | |
---|---|
DaemonThread(long waitTime,
String name,
EnvironmentImpl env)
|
Method Summary | |
---|---|
void |
addToQueue(Object o)
|
void |
addToQueueAlreadyLatched(Collection c)
|
int |
getNWakeupRequests()
For unit testing. |
int |
getQueueSize()
|
Thread |
getThread()
For testing. |
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. |
protected abstract void |
onWakeup()
onWakeup is synchronized to ensure that multiple invocations of the DaemonThread aren't made. |
void |
requestShutdown()
|
void |
run()
|
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. |
void |
shutdown()
Requests shutdown and calls join() to wait for the thread to stop. |
String |
toString()
|
void |
wakeup()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected String name
protected Set workQueue
protected Latch workQueueLatch
protected int nWakeupRequests
Constructor Detail |
---|
public DaemonThread(long waitTime, String name, EnvironmentImpl env)
Method Detail |
---|
public Thread getThread()
public void runOrPause(boolean run)
public void requestShutdown()
public void shutdown()
public String toString()
toString
in class Object
public void addToQueue(Object o) throws DatabaseException
DatabaseException
public int getQueueSize() throws DatabaseException
DatabaseException
public void addToQueueAlreadyLatched(Collection c) throws DatabaseException
DatabaseException
public void wakeup()
public void run()
run
in interface Runnable
protected int nDeadlockRetries() throws DatabaseException
DatabaseException
protected abstract void onWakeup() throws DatabaseException
DatabaseException
protected boolean isShutdownRequested()
public boolean isRunning()
public int getNWakeupRequests()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |