
public class JNIThreadProxy extends Thread
Thread that is called by Ferry native code.
This class is called from native code to tell if a thread is interrupted. It only exposes the methods that are called from the native code, and adds logging to aid in debugging.
If allows a global handler to be set. This can be useful for catching threads that are started from native code as there is no other way to detect those and interrupt them. If set, the global handler will always be checked BEFORE the local thread allowing users to always get a callback on each interrupt check if they want.
Do not change the name or location of this class without also changing the JNIHelper.cpp code that refers to it.
| Modifier and Type | Class and Description |
|---|---|
static interface |
JNIThreadProxy.Interruptable
Interface that global interrupt handlers should use.
|
Thread.State, Thread.UncaughtExceptionHandlerMAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Modifier and Type | Method and Description |
|---|---|
static Thread |
currentThread() |
static JNIThreadProxy.Interruptable |
getGlobalInterruptHandler()
Gets the current global interrupt handler
|
void |
interrupt() |
boolean |
isInterrupted() |
static JNIThreadProxy.Interruptable |
setGlobalInterruptable(JNIThreadProxy.Interruptable handler)
Set a new global interrupt handler.
|
activeCount, checkAccess, countStackFrames, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupted, isAlive, isDaemon, join, join, join, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldpublic static JNIThreadProxy.Interruptable getGlobalInterruptHandler()
public static JNIThreadProxy.Interruptable setGlobalInterruptable(JNIThreadProxy.Interruptable handler)
handler - The new handler to use, or null to disable.public static Thread currentThread()
Thread.currentThread()public boolean isInterrupted()
isInterrupted in class ThreadCopyright © 2018 Humble Software. All rights reserved.