| Modifier and Type | Field and Description |
|---|---|
| private List | |
| private volatile InterruptHandler | |
| private static final int | |
| private static final RuntimePermission | |
| private static final int | STATE_INTERRUPT_DEFERRED
The thread is not interrupted, and interrupts will be deferred. |
| private static final int | STATE_INTERRUPT_IN_PROGRESS
The thread is in the process of executing interruption logic. |
| private static final int | STATE_INTERRUPT_PENDING
The thread is not interrupted, but there is an interrupt pending for once deferral is ended. |
| private static final int | STATE_MAYBE_INTERRUPTED
The thread is maybe interrupted. |
| private final AtomicInteger | |
| private ThreadNameInfo |
| Access | Constructor and Description |
|---|---|
| public | |
| public | JBossThread(final Runnable
the runnable target target, final String the initial thread name name)Construct a new instance. |
| public | JBossThread(final ThreadGroup
the parent thread group group, final Runnable the runnable target target)Construct a new instance. |
| public | JBossThread(final ThreadGroup
the parent thread group group, final Runnable the runnable target target, final String the initial thread name name)Construct a new instance. |
| public | JBossThread(final ThreadGroup
the parent thread group group, final Runnable the runnable target target, final String the initial thread name name, final long stackSize)Construct a new instance. |
| Modifier and Type | Method and Description |
|---|---|
| public static <T, E extends Exception> void | |
| public static <T, E extends Exception> void | |
| public static <T, U, E extends Exception> void | |
| public static <T, E extends Exception> void | |
| public static <T, E extends Exception> void | |
| public static <T, E extends Exception> void | |
| public static <T, U, E extends Exception> void | |
| public static <T, E extends Exception> void | |
| public static <T, E extends Exception> void | acceptWithInterruptHandler(InterruptHandler interruptHandler, ExceptionObjLongConsumer<T, E> function, T param1, long param2)
|
| public static <T, E extends Exception> void | acceptWithInterruptHandler(InterruptHandler interruptHandler, ExceptionObjIntConsumer<T, E> function, T param1, int param2)
|
| public static <T, U, E extends Exception> void | acceptWithInterruptHandler(InterruptHandler interruptHandler, ExceptionBiConsumer<T, U, E> function, T param1, U param2)
|
| public static <T, E extends Exception> void | acceptWithInterruptHandler(InterruptHandler interruptHandler, ExceptionConsumer<T, E> function, T param1)
|
| public static <T, U, R, E extends Exception> R | |
| public static <T, R, E extends Exception> R | |
| public static <T, U, R, E extends Exception> R | |
| public static <T, R, E extends Exception> R | |
| public static <T, U, R, E extends Exception> R | applyWithInterruptHandler(InterruptHandler interruptHandler, ExceptionBiFunction<T, U, R, E> function, T param1, U param2)
|
| public static <T, R, E extends Exception> R | applyWithInterruptHandler(InterruptHandler interruptHandler, ExceptionFunction<T, R, E> function, T param1)
|
| public static JBossThread | Returns: the current thread, ornullHides java. JBossThread, or null if the current thread is not a JBossThread.
|
| private void | |
| public static void | executeWithInterruptDeferred(final Runnable
the task to run task)Defer interrupts for the duration of some task. |
| public static < the callable's return type T> T | Returns: the value returned from the callablethe task to run action)Defer interrupts for the duration of some task. |
| public static < the action's return type T> T | Returns: the value returned from the callablethe task to run action)Defer interrupts for the duration of some task. |
| public static < the action's return type T> T | Returns: the value returned from the callablethe task to run action)Defer interrupts for the duration of some task. |
| public static InterruptHandler | Returns: the old interrupt handlerthe new interrupt handler newInterruptHandler)Swap the current thread's active interrupt handler. |
| public static <T, E extends Exception> T | |
| public static <T, E extends Exception> T | |
| pack-priv ThreadNameInfo | |
| public static <R, E extends Exception> R | |
| public void | |
| public boolean | isInterrupted()
Overrides java. |
| public static boolean | |
| private static boolean | |
| public void | run()
Overrides java. Implements java. Runnable.
|
| public static <E extends Exception> void | |
| public static <E extends Exception> void | |
| public static <E extends Exception> void | |
| pack-priv void | setThreadNameInfo(final ThreadNameInfo
the new thread name info threadNameInfo)Set the thread name information. |
| public void | setUncaughtExceptionHandler(final Thread.
the new handler ehOverrides java. |
| public void | |
| private static boolean |
| exitHandlers | back to summary |
|---|---|
| private List<Runnable> exitHandlers | |
| interruptHandler | back to summary |
|---|---|
| private volatile InterruptHandler interruptHandler | |
| MAX_INTERRUPT_SPINS | back to summary |
|---|---|
| private static final int MAX_INTERRUPT_SPINS | |
| MODIFY_THREAD_PERMISSION | back to summary |
|---|---|
| private static final RuntimePermission MODIFY_THREAD_PERMISSION | |
| STATE_INTERRUPT_DEFERRED | back to summary |
|---|---|
| private static final int STATE_INTERRUPT_DEFERRED The thread is not interrupted, and interrupts will be deferred. Possible transitions: | |
| STATE_INTERRUPT_IN_PROGRESS | back to summary |
|---|---|
| private static final int STATE_INTERRUPT_IN_PROGRESS The thread is in the process of executing interruption logic. If the thread attempts to defer interrupts during this phase, it will block until the interruption logic is complete. | |
| STATE_INTERRUPT_PENDING | back to summary |
|---|---|
| private static final int STATE_INTERRUPT_PENDING The thread is not interrupted, but there is an interrupt pending for once deferral is ended. Possible transitions: | |
| STATE_MAYBE_INTERRUPTED | back to summary |
|---|---|
| private static final int STATE_MAYBE_INTERRUPTED The thread is maybe interrupted. Possible transitions: | |
| stateRef | back to summary |
|---|---|
| private final AtomicInteger stateRef | |
| threadNameInfo | back to summary |
|---|---|
| private ThreadNameInfo threadNameInfo | |
| JBossThread | back to summary |
|---|---|
| public JBossThread(final Runnable target) Construct a new instance.
| |
| JBossThread | back to summary |
|---|---|
| public JBossThread(final Runnable target, final String name) Construct a new instance.
| |
| JBossThread | back to summary |
|---|---|
| public JBossThread(final ThreadGroup group, final Runnable target) throws SecurityException Construct a new instance.
| |
| JBossThread | back to summary |
|---|---|
| public JBossThread(final ThreadGroup group, final Runnable target, final String name) throws SecurityException Construct a new instance.
| |
| JBossThread | back to summary |
|---|---|
| public JBossThread(final ThreadGroup group, final Runnable target, final String name, final long stackSize) throws SecurityException Construct a new instance.
| |
| acceptInterruptDeferredEx | back to summary |
|---|---|
| public static <T, E extends Exception> void acceptInterruptDeferredEx(final ExceptionObjLongConsumer<T, E> consumer, T param1, long param2) throws ExceptionObjLongConsumer-T-long-:E | |
| acceptInterruptDeferredEx | back to summary |
|---|---|
| public static <T, E extends Exception> void acceptInterruptDeferredEx(final ExceptionObjIntConsumer<T, E> consumer, T param1, int param2) throws ExceptionObjIntConsumer-T-int-:E | |
| acceptInterruptDeferredEx | back to summary |
|---|---|
| public static <T, U, E extends Exception> void acceptInterruptDeferredEx(final ExceptionBiConsumer<T, U, E> consumer, T param1, U param2) throws ExceptionBiConsumer-T-U-:E | |
| acceptInterruptDeferredEx | back to summary |
|---|---|
| public static <T, E extends Exception> void acceptInterruptDeferredEx(final ExceptionConsumer<T, E> consumer, T param) throws ExceptionConsumer-T-:E | |
| acceptInterruptResumedEx | back to summary |
|---|---|
| public static <T, E extends Exception> void acceptInterruptResumedEx(final ExceptionObjLongConsumer<T, E> consumer, T param1, long param2) throws ExceptionObjLongConsumer-T-long-:E | |
| acceptInterruptResumedEx | back to summary |
|---|---|
| public static <T, E extends Exception> void acceptInterruptResumedEx(final ExceptionObjIntConsumer<T, E> consumer, T param1, int param2) throws ExceptionObjIntConsumer-T-int-:E | |
| acceptInterruptResumedEx | back to summary |
|---|---|
| public static <T, U, E extends Exception> void acceptInterruptResumedEx(final ExceptionBiConsumer<T, U, E> consumer, T param1, U param2) throws ExceptionBiConsumer-T-U-:E | |
| acceptInterruptResumedEx | back to summary |
|---|---|
| public static <T, E extends Exception> void acceptInterruptResumedEx(final ExceptionConsumer<T, E> consumer, T param) throws ExceptionConsumer-T-:E | |
| acceptWithInterruptHandler | back to summary |
|---|---|
| public static <T, E extends Exception> void acceptWithInterruptHandler(InterruptHandler interruptHandler, ExceptionObjLongConsumer<T, E> function, T param1, long param2) throws ExceptionObjLongConsumer-T-long-:E | |
| acceptWithInterruptHandler | back to summary |
|---|---|
| public static <T, E extends Exception> void acceptWithInterruptHandler(InterruptHandler interruptHandler, ExceptionObjIntConsumer<T, E> function, T param1, int param2) throws ExceptionObjIntConsumer-T-int-:E | |
| acceptWithInterruptHandler | back to summary |
|---|---|
| public static <T, U, E extends Exception> void acceptWithInterruptHandler(InterruptHandler interruptHandler, ExceptionBiConsumer<T, U, E> function, T param1, U param2) throws ExceptionBiConsumer-T-U-:E | |
| acceptWithInterruptHandler | back to summary |
|---|---|
| public static <T, E extends Exception> void acceptWithInterruptHandler(InterruptHandler interruptHandler, ExceptionConsumer<T, E> function, T param1) throws ExceptionConsumer-T-:E | |
| applyInterruptDeferredEx | back to summary |
|---|---|
| public static <T, U, R, E extends Exception> R applyInterruptDeferredEx(final ExceptionBiFunction<T, U, R, E> function, T param1, U param2) throws ExceptionBiFunction-T-U-:E | |
| applyInterruptDeferredEx | back to summary |
|---|---|
| public static <T, R, E extends Exception> R applyInterruptDeferredEx(final ExceptionFunction<T, R, E> function, T param) throws ExceptionFunction-T-:E | |
| applyInterruptResumedEx | back to summary |
|---|---|
| public static <T, U, R, E extends Exception> R applyInterruptResumedEx(final ExceptionBiFunction<T, U, R, E> function, T param1, U param2) throws ExceptionBiFunction-T-U-:E | |
| applyInterruptResumedEx | back to summary |
|---|---|
| public static <T, R, E extends Exception> R applyInterruptResumedEx(final ExceptionFunction<T, R, E> function, T param) throws ExceptionFunction-T-:E | |
| applyWithInterruptHandler | back to summary |
|---|---|
| public static <T, U, R, E extends Exception> R applyWithInterruptHandler(InterruptHandler interruptHandler, ExceptionBiFunction<T, U, R, E> function, T param1, U param2) throws ExceptionBiFunction-T-U-:E | |
| applyWithInterruptHandler | back to summary |
|---|---|
| public static <T, R, E extends Exception> R applyWithInterruptHandler(InterruptHandler interruptHandler, ExceptionFunction<T, R, E> function, T param1) throws ExceptionFunction-T-:E | |
| currentThread | back to summary |
|---|---|
| public static JBossThread currentThread() Hides java. Get the current
| |
| doInterrupt | back to summary |
|---|---|
| private void doInterrupt() | |
| executeWithInterruptDeferred | back to summary |
|---|---|
| public static void executeWithInterruptDeferred(final Runnable task) Defer interrupts for the duration of some task. Once the task is complete, any deferred interrupt will be
delivered to the thread, thus the thread interrupt status should be checked upon return. If the current thread
is not a
| |
| executeWithInterruptDeferred | back to summary |
|---|---|
| public static <T> T executeWithInterruptDeferred(final Callable<T> action) throws Exception Defer interrupts for the duration of some task. Once the task is complete, any deferred interrupt will be
delivered to the thread, thus the thread interrupt status should be checked upon return. If the current thread
is not a | |
| executeWithInterruptDeferred | back to summary |
|---|---|
| public static <T> T executeWithInterruptDeferred(final PrivilegedAction<T> action) Defer interrupts for the duration of some task. Once the task is complete, any deferred interrupt will be
delivered to the thread, thus the thread interrupt status should be checked upon return. If the current thread
is not a
| |
| executeWithInterruptDeferred | back to summary |
|---|---|
| public static <T> T executeWithInterruptDeferred(final PrivilegedExceptionAction<T> action) throws Exception Defer interrupts for the duration of some task. Once the task is complete, any deferred interrupt will be
delivered to the thread, thus the thread interrupt status should be checked upon return. If the current thread
is not a
| |
| getAndSetInterruptHandler | back to summary |
|---|---|
| public static InterruptHandler getAndSetInterruptHandler(final InterruptHandler newInterruptHandler) Swap the current thread's active interrupt handler. Most callers should restore the old handler in a
InterruptHandler oldHandler = JBossThread.getAndSetInterruptHandler(newHandler);
try {
...execute interrupt-sensitive operation...
} finally {
JBossThread.getAndSetInterruptHandler(oldHandler);
}
| |
| getInterruptDeferredEx | back to summary |
|---|---|
| public static <T, E extends Exception> T getInterruptDeferredEx(final ExceptionSupplier<T, E> supplier) throws ExceptionSupplier-:E | |
| getInterruptResumedEx | back to summary |
|---|---|
| public static <T, E extends Exception> T getInterruptResumedEx(final ExceptionSupplier<T, E> supplier) throws ExceptionSupplier-:E | |
| getThreadNameInfo | back to summary |
|---|---|
| pack-priv ThreadNameInfo getThreadNameInfo() Get the thread name information. This includes information about the thread's sequence number and so forth.
| |
| getWithInterruptHandler | back to summary |
|---|---|
| public static <R, E extends Exception> R getWithInterruptHandler(InterruptHandler interruptHandler, ExceptionSupplier<R, E> function) throws ExceptionSupplier-:E | |
| interrupt | back to summary |
|---|---|
| public void interrupt() Overrides java. Interrupt this thread. Logs a trace message and calls the current interrupt handler, if any. The interrupt handler is called from the calling thread, not the thread being interrupted. | |
| isInterrupted | back to summary |
|---|---|
| public boolean isInterrupted() Overrides java. Doc from java. Tests whether this thread has been interrupted. The interrupted status of the thread is unaffected by this method.
| |
| onExit | back to summary |
|---|---|
| public static boolean onExit(Runnable hook) throws SecurityException Register a runnable task to be executed when the current thread exits.
| |
| registerDeferral | back to summary |
|---|---|
| private static boolean registerDeferral(final JBossThread thread) | |
| run | back to summary |
|---|---|
| public void run() Overrides java. Implements java. Execute the thread's | |
| runInterruptDeferredEx | back to summary |
|---|---|
| public static <E extends Exception> void runInterruptDeferredEx(final ExceptionRunnable<E> runnable) throws ExceptionRunnable-:E | |
| runInterruptResumedEx | back to summary |
|---|---|
| public static <E extends Exception> void runInterruptResumedEx(final ExceptionRunnable<E> runnable) throws ExceptionRunnable-:E | |
| runWithInterruptHandler | back to summary |
|---|---|
| public static <E extends Exception> void runWithInterruptHandler(InterruptHandler interruptHandler, ExceptionRunnable<E> function) throws ExceptionRunnable-:E | |
| setThreadNameInfo | back to summary |
|---|---|
| pack-priv void setThreadNameInfo(final ThreadNameInfo threadNameInfo) throws SecurityException Set the thread name information. This includes information about the thread's sequence number and so forth.
| |
| setUncaughtExceptionHandler | back to summary |
|---|---|
| public void setUncaughtExceptionHandler(final Thread. Overrides java. Change the uncaught exception handler for this thread.
| |
| start | back to summary |
|---|---|
| public void start() Overrides java. Start the thread.
| |
| unregisterDeferral | back to summary |
|---|---|
| private static boolean unregisterDeferral(final JBossThread thread) | |