java.lang.Object
java.lang.Thread
net.i2p.util.I2PThread
net.i2p.util.I2PAppThread
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
DaemonThread, I2PTunnelOutproxyRunner, I2PTunnelRunner, InternalSocketRunner, UpdateRunner
Nested Class Summary
Nested classes/interfaces inherited from class I2PThread
I2PThread.OOMEventListenerModifier and TypeClassDescriptionstatic interfaceListener for out-of-memory events.Nested classes/interfaces inherited from class Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandlerField Summary
Fields inherited from class Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITYConstructor Summary
ConstructorsConstructorDescriptionCreates a new I2PAppThread with no target or name.Creates a new I2PAppThread with the given target runnable.I2PAppThread(Runnable r, String name) Creates a new I2PAppThread with the given target and name.I2PAppThread(Runnable r, String name, boolean isDaemon) Creates a new I2PAppThread with the given target, name, and daemon status.I2PAppThread(String name) Creates a new I2PAppThread with the given name.I2PAppThread(ThreadGroup group, Runnable r, String name) Creates a new I2PAppThread in the given thread group.Method Summary
All MethodsModifier and TypeMethodDescriptionvoidRegister a new component that wants notification of OOM events.protected voidfireOOM(OutOfMemoryError oom) Notify listeners that an OutOfMemoryError occurred.voidUnregister a component that wants notification of OOM events.Methods inherited from class I2PThread
addOOMEventListener, removeOOMEventListener, run, startModifier and TypeMethodDescriptionstatic voidRegister a new component that wants notification of OOM events.static voidUnregister a component that wants notification of OOM events.voidrun()Run the thread, catching and reporting OOM and other failures.voidstart()Overridden to provide useful info to users on OOM, and to prevent shutting down the whole JVM for what is most likely not a heap issue.Methods inherited from class Thread
activeCount, clone, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, startVirtualThread, threadId, toString, yield
Constructor Details
I2PAppThread
public I2PAppThread()Creates a new I2PAppThread with no target or name.I2PAppThread
Creates a new I2PAppThread with the given name.- Parameters:
name- the thread name
I2PAppThread
Creates a new I2PAppThread with the given target runnable.- Parameters:
r- the target runnable
I2PAppThread
I2PAppThread
I2PAppThread
Creates a new I2PAppThread in the given thread group.- Parameters:
group- the thread groupr- the target runnablename- the thread name
Method Details
fireOOM
Description copied from class:I2PThreadNotify listeners that an OutOfMemoryError occurred.addOOMEventThreadListener
Register a new component that wants notification of OOM events.- Parameters:
lsnr- the listener to register
removeOOMEventThreadListener
Unregister a component that wants notification of OOM events.- Parameters:
lsnr- the listener to unregister