Thread.State, Thread.UncaughtExceptionHandlerMAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
JBossThread(Runnable target)
Construct a new instance.
|
JBossThread(Runnable target,
String name)
Construct a new instance.
|
JBossThread(ThreadGroup group,
Runnable target)
Construct a new instance.
|
JBossThread(ThreadGroup group,
Runnable target,
String name)
Construct a new instance.
|
JBossThread(ThreadGroup group,
Runnable target,
String name,
long stackSize)
Construct a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
static <T,U,E extends Exception> |
acceptInterruptDeferredEx(org.wildfly.common.function.ExceptionBiConsumer<T,U,E> consumer,
T param1,
U param2) |
static <T,E extends Exception> |
acceptInterruptDeferredEx(org.wildfly.common.function.ExceptionConsumer<T,E> consumer,
T param) |
static <T,E extends Exception> |
acceptInterruptDeferredEx(org.wildfly.common.function.ExceptionObjIntConsumer<T,E> consumer,
T param1,
int param2) |
static <T,E extends Exception> |
acceptInterruptDeferredEx(org.wildfly.common.function.ExceptionObjLongConsumer<T,E> consumer,
T param1,
long param2) |
static <T,U,E extends Exception> |
acceptInterruptResumedEx(org.wildfly.common.function.ExceptionBiConsumer<T,U,E> consumer,
T param1,
U param2) |
static <T,E extends Exception> |
acceptInterruptResumedEx(org.wildfly.common.function.ExceptionConsumer<T,E> consumer,
T param) |
static <T,E extends Exception> |
acceptInterruptResumedEx(org.wildfly.common.function.ExceptionObjIntConsumer<T,E> consumer,
T param1,
int param2) |
static <T,E extends Exception> |
acceptInterruptResumedEx(org.wildfly.common.function.ExceptionObjLongConsumer<T,E> consumer,
T param1,
long param2) |
static <T,U,E extends Exception> |
acceptWithInterruptHandler(InterruptHandler interruptHandler,
org.wildfly.common.function.ExceptionBiConsumer<T,U,E> function,
T param1,
U param2) |
static <T,E extends Exception> |
acceptWithInterruptHandler(InterruptHandler interruptHandler,
org.wildfly.common.function.ExceptionConsumer<T,E> function,
T param1) |
static <T,E extends Exception> |
acceptWithInterruptHandler(InterruptHandler interruptHandler,
org.wildfly.common.function.ExceptionObjIntConsumer<T,E> function,
T param1,
int param2) |
static <T,E extends Exception> |
acceptWithInterruptHandler(InterruptHandler interruptHandler,
org.wildfly.common.function.ExceptionObjLongConsumer<T,E> function,
T param1,
long param2) |
static <T,U,R,E extends Exception> |
applyInterruptDeferredEx(org.wildfly.common.function.ExceptionBiFunction<T,U,R,E> function,
T param1,
U param2) |
static <T,R,E extends Exception> |
applyInterruptDeferredEx(org.wildfly.common.function.ExceptionFunction<T,R,E> function,
T param) |
static <T,U,R,E extends Exception> |
applyInterruptResumedEx(org.wildfly.common.function.ExceptionBiFunction<T,U,R,E> function,
T param1,
U param2) |
static <T,R,E extends Exception> |
applyInterruptResumedEx(org.wildfly.common.function.ExceptionFunction<T,R,E> function,
T param) |
static <T,U,R,E extends Exception> |
applyWithInterruptHandler(InterruptHandler interruptHandler,
org.wildfly.common.function.ExceptionBiFunction<T,U,R,E> function,
T param1,
U param2) |
static <T,R,E extends Exception> |
applyWithInterruptHandler(InterruptHandler interruptHandler,
org.wildfly.common.function.ExceptionFunction<T,R,E> function,
T param1) |
static JBossThread |
currentThread()
Get the current
JBossThread, or null if the current thread is not a JBossThread. |
static <T> T |
executeWithInterruptDeferred(Callable<T> action)
Defer interrupts for the duration of some task.
|
static void |
executeWithInterruptDeferred(DirectExecutor directExecutor,
Runnable task)
Defer interrupts for the duration of some task.
|
static <T> T |
executeWithInterruptDeferred(PrivilegedAction<T> action)
Defer interrupts for the duration of some task.
|
static <T> T |
executeWithInterruptDeferred(PrivilegedExceptionAction<T> action)
Defer interrupts for the duration of some task.
|
static void |
executeWithInterruptDeferred(Runnable task)
Defer interrupts for the duration of some task.
|
static InterruptHandler |
getAndSetInterruptHandler(InterruptHandler newInterruptHandler)
Swap the current thread's active interrupt handler.
|
static <T,E extends Exception> |
getInterruptDeferredEx(org.wildfly.common.function.ExceptionSupplier<T,E> supplier) |
static <T,E extends Exception> |
getInterruptResumedEx(org.wildfly.common.function.ExceptionSupplier<T,E> supplier) |
static <R,E extends Exception> |
getWithInterruptHandler(InterruptHandler interruptHandler,
org.wildfly.common.function.ExceptionSupplier<R,E> function) |
void |
interrupt()
Interrupt this thread.
|
boolean |
isInterrupted() |
void |
run()
Execute the thread's
Runnable. |
static <E extends Exception> |
runInterruptDeferredEx(org.wildfly.common.function.ExceptionRunnable<E> runnable) |
static <E extends Exception> |
runInterruptResumedEx(org.wildfly.common.function.ExceptionRunnable<E> runnable) |
static <E extends Exception> |
runWithInterruptHandler(InterruptHandler interruptHandler,
org.wildfly.common.function.ExceptionRunnable<E> function) |
void |
setUncaughtExceptionHandler(Thread.UncaughtExceptionHandler eh)
Change the uncaught exception handler for this thread.
|
void |
start()
Start the thread.
|
activeCount, checkAccess, clone, countStackFrames, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupted, isAlive, isDaemon, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, sleep, sleep, stop, stop, suspend, toString, yieldpublic JBossThread(Runnable target)
target - the runnable targetThread.Thread(Runnable)public JBossThread(Runnable target, String name)
target - the runnable targetname - the initial thread nameThread.Thread(Runnable, String)public JBossThread(ThreadGroup group, Runnable target) throws SecurityException
group - the parent thread grouptarget - the runnable targetSecurityException - if the current thread cannot create a thread in the specified thread groupThread.Thread(ThreadGroup, Runnable)public JBossThread(ThreadGroup group, Runnable target, String name) throws SecurityException
group - the parent thread grouptarget - the runnable targetname - the initial thread nameSecurityException - if the current thread cannot create a thread in the specified thread groupThread.Thread(ThreadGroup,Runnable,String)public JBossThread(ThreadGroup group, Runnable target, String name, long stackSize) throws SecurityException
group - the parent thread grouptarget - the runnable targetname - the initial thread nameSecurityException - if the current thread cannot create a thread in the specified thread groupThread.Thread(ThreadGroup,Runnable,String,long)public void interrupt()
public boolean isInterrupted()
isInterrupted in class Threadpublic static void executeWithInterruptDeferred(Runnable task)
JBossThread, the task is simply run as-is.task - the task to runpublic static void executeWithInterruptDeferred(DirectExecutor directExecutor, Runnable task)
JBossThread, the task is simply run as-is.directExecutor - the task executor to usetask - the task to runpublic static <T> T executeWithInterruptDeferred(Callable<T> action) throws Exception
JBossThread, the task is simply run as-is.T - the callable's return typeaction - the task to runException - if the action throws an exceptionpublic static <T> T executeWithInterruptDeferred(PrivilegedAction<T> action)
JBossThread, the task is simply run as-is.T - the action's return typeaction - the task to runpublic static <T> T executeWithInterruptDeferred(PrivilegedExceptionAction<T> action) throws Exception
JBossThread, the task is simply run as-is.T - the action's return typeaction - the task to runException - if the action throws an exceptionpublic static <T,U,R,E extends Exception> R applyInterruptDeferredEx(org.wildfly.common.function.ExceptionBiFunction<T,U,R,E> function, T param1, U param2) throws E extends Exception
E extends Exceptionpublic static <T,R,E extends Exception> R applyInterruptDeferredEx(org.wildfly.common.function.ExceptionFunction<T,R,E> function, T param) throws E extends Exception
E extends Exceptionpublic static <T,E extends Exception> T getInterruptDeferredEx(org.wildfly.common.function.ExceptionSupplier<T,E> supplier) throws E extends Exception
E extends Exceptionpublic static <T,E extends Exception> void acceptInterruptDeferredEx(org.wildfly.common.function.ExceptionObjLongConsumer<T,E> consumer, T param1, long param2) throws E extends Exception
E extends Exceptionpublic static <T,E extends Exception> void acceptInterruptDeferredEx(org.wildfly.common.function.ExceptionObjIntConsumer<T,E> consumer, T param1, int param2) throws E extends Exception
E extends Exceptionpublic static <T,U,E extends Exception> void acceptInterruptDeferredEx(org.wildfly.common.function.ExceptionBiConsumer<T,U,E> consumer, T param1, U param2) throws E extends Exception
E extends Exceptionpublic static <T,E extends Exception> void acceptInterruptDeferredEx(org.wildfly.common.function.ExceptionConsumer<T,E> consumer, T param) throws E extends Exception
E extends Exceptionpublic static <E extends Exception> void runInterruptDeferredEx(org.wildfly.common.function.ExceptionRunnable<E> runnable) throws E extends Exception
E extends Exceptionpublic static <T,U,R,E extends Exception> R applyInterruptResumedEx(org.wildfly.common.function.ExceptionBiFunction<T,U,R,E> function, T param1, U param2) throws E extends Exception
E extends Exceptionpublic static <T,R,E extends Exception> R applyInterruptResumedEx(org.wildfly.common.function.ExceptionFunction<T,R,E> function, T param) throws E extends Exception
E extends Exceptionpublic static <T,E extends Exception> T getInterruptResumedEx(org.wildfly.common.function.ExceptionSupplier<T,E> supplier) throws E extends Exception
E extends Exceptionpublic static <T,E extends Exception> void acceptInterruptResumedEx(org.wildfly.common.function.ExceptionObjLongConsumer<T,E> consumer, T param1, long param2) throws E extends Exception
E extends Exceptionpublic static <T,E extends Exception> void acceptInterruptResumedEx(org.wildfly.common.function.ExceptionObjIntConsumer<T,E> consumer, T param1, int param2) throws E extends Exception
E extends Exceptionpublic static <T,U,E extends Exception> void acceptInterruptResumedEx(org.wildfly.common.function.ExceptionBiConsumer<T,U,E> consumer, T param1, U param2) throws E extends Exception
E extends Exceptionpublic static <T,E extends Exception> void acceptInterruptResumedEx(org.wildfly.common.function.ExceptionConsumer<T,E> consumer, T param) throws E extends Exception
E extends Exceptionpublic static <E extends Exception> void runInterruptResumedEx(org.wildfly.common.function.ExceptionRunnable<E> runnable) throws E extends Exception
E extends Exceptionpublic void run()
Runnable. Logs a trace message at the start and end of execution.public static JBossThread currentThread()
JBossThread, or null if the current thread is not a JBossThread.nullpublic void start()
start in class ThreadIllegalThreadStateException - if the thread was already started.public void setUncaughtExceptionHandler(Thread.UncaughtExceptionHandler eh)
setUncaughtExceptionHandler in class Threadeh - the new handlerpublic static InterruptHandler getAndSetInterruptHandler(InterruptHandler newInterruptHandler)
finally
block like this:
InterruptHandler oldHandler = JBossThread.getAndSetInterruptHandler(newHandler);
try {
...execute interrupt-sensitive operation...
} finally {
JBossThread.getAndSetInterruptHandler(oldHandler);
}
newInterruptHandler - the new interrupt handlerpublic static <T,U,R,E extends Exception> R applyWithInterruptHandler(InterruptHandler interruptHandler, org.wildfly.common.function.ExceptionBiFunction<T,U,R,E> function, T param1, U param2) throws E extends Exception
E extends Exceptionpublic static <T,R,E extends Exception> R applyWithInterruptHandler(InterruptHandler interruptHandler, org.wildfly.common.function.ExceptionFunction<T,R,E> function, T param1) throws E extends Exception
E extends Exceptionpublic static <R,E extends Exception> R getWithInterruptHandler(InterruptHandler interruptHandler, org.wildfly.common.function.ExceptionSupplier<R,E> function) throws E extends Exception
E extends Exceptionpublic static <T,E extends Exception> void acceptWithInterruptHandler(InterruptHandler interruptHandler, org.wildfly.common.function.ExceptionObjLongConsumer<T,E> function, T param1, long param2) throws E extends Exception
E extends Exceptionpublic static <T,E extends Exception> void acceptWithInterruptHandler(InterruptHandler interruptHandler, org.wildfly.common.function.ExceptionObjIntConsumer<T,E> function, T param1, int param2) throws E extends Exception
E extends Exceptionpublic static <T,U,E extends Exception> void acceptWithInterruptHandler(InterruptHandler interruptHandler, org.wildfly.common.function.ExceptionBiConsumer<T,U,E> function, T param1, U param2) throws E extends Exception
E extends Exceptionpublic static <T,E extends Exception> void acceptWithInterruptHandler(InterruptHandler interruptHandler, org.wildfly.common.function.ExceptionConsumer<T,E> function, T param1) throws E extends Exception
E extends Exceptionpublic static <E extends Exception> void runWithInterruptHandler(InterruptHandler interruptHandler, org.wildfly.common.function.ExceptionRunnable<E> function) throws E extends Exception
E extends ExceptionCopyright © 2019 JBoss by Red Hat. All rights reserved.