public static class InterruptSource.Thread extends Thread implements InterruptSource
Thread.State, Thread.UncaughtExceptionHandler
InterruptSource.Thread, InterruptSource.Util
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
InterruptSource.Thread()
See
Thread#Thread( for details. |
InterruptSource.Thread(ThreadGroup tg,
Runnable target)
See
Thread.Thread(ThreadGroup, Runnable) for details. |
InterruptSource.Thread(ThreadGroup tg,
Runnable target,
String name)
See
Thread.Thread(ThreadGroup, Runnable, String) for details. |
Modifier and Type | Method and Description |
---|---|
void |
clearInterruptSource()
Clears source and count of
Thread.interrupt() calls, if any. |
static InterruptSource.Thread |
create(ThreadGroup tg,
Runnable target,
String name)
Depending on whether
name is null, either
#Thread(ThreadGroup, Runnable, String) or
#Thread(ThreadGroup, Runnable) is being utilized. |
int |
getInterruptCounter(boolean clear)
Returns the count of
Thread.interrupt() calls. |
Throwable |
getInterruptSource(boolean clear)
Returns the source of the last
#interrupt() call. |
void |
interrupt() |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public InterruptSource.Thread()
Thread#Thread(
for details.public InterruptSource.Thread(ThreadGroup tg, Runnable target)
Thread.Thread(ThreadGroup, Runnable)
for details.tg
- explicit ThreadGroup
, may be null
target
- explicit Runnable
, may be null
public InterruptSource.Thread(ThreadGroup tg, Runnable target, String name)
Thread.Thread(ThreadGroup, Runnable, String)
for details.tg
- explicit ThreadGroup
, may be null
target
- explicit Runnable
, may be null
name
- explicit name of thread, must not be null
public static InterruptSource.Thread create(ThreadGroup tg, Runnable target, String name)
name
is null, either
#Thread(ThreadGroup, Runnable, String)
or
#Thread(ThreadGroup, Runnable)
is being utilized.tg
- explicit ThreadGroup
, may be null
target
- explicit Runnable
, may be null
name
- explicit name of thread, may be null
public final Throwable getInterruptSource(boolean clear)
InterruptSource
#interrupt()
call.getInterruptSource
in interface InterruptSource
clear
- if true, issues InterruptSource.clearInterruptSource()
public final int getInterruptCounter(boolean clear)
InterruptSource
Thread.interrupt()
calls.getInterruptCounter
in interface InterruptSource
clear
- if true, issues InterruptSource.clearInterruptSource()
public final void clearInterruptSource()
InterruptSource
Thread.interrupt()
calls, if any.clearInterruptSource
in interface InterruptSource