|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
com.mchange.v1.lang.GentleThread
public abstract class GentleThread
an abstract Thread class that provides utilities for easily defining Threads with safe versions of the deprecated thread methods stop(), resume(), and start()
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
GentleThread()
|
|
GentleThread(String name)
|
Method Summary | |
---|---|
protected void |
allowSuspend()
tests whether the thread should suspend, and causes to the thread to pause if appropriate. |
void |
gentleResume()
a safe method for resuming properly implemented GentleThreads |
void |
gentleStop()
a safe method for stopping properly implemented GentleThreads |
void |
gentleSuspend()
a safe method for suspending properly implemented GentleThreads |
abstract void |
run()
|
protected boolean |
shouldStop()
tests whether the thread should stop. |
protected boolean |
shouldSuspend()
tests whether the thread should suspend. |
Methods inherited from class java.lang.Thread |
---|
activeCount, 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, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GentleThread()
public GentleThread(String name)
Method Detail |
---|
public abstract void run()
run
in interface Runnable
run
in class Thread
public void gentleStop()
public void gentleSuspend()
public void gentleResume()
protected boolean shouldStop()
protected boolean shouldSuspend()
allowSuspend()
protected void allowSuspend() throws InterruptedException
InterruptedException
gentleResume()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |