java.lang.Object
java.lang.Thread
net.i2p.util.I2PThread
net.i2p.util.I2PAppThread
net.i2p.addressbook.DaemonThread
- All Implemented Interfaces:
Runnable, NamingServiceUpdater
A thread that waits five minutes, then runs the addressbook daemon.
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
ConstructorsConstructorDescriptionDaemonThread(String[] args) Construct a DaemonThread with the command line arguments args.Method Summary
All MethodsModifier and TypeMethodDescriptionvoidhalt()Halt the thread and stop the daemon.voidrun()Run the thread, catching and reporting OOM and other failures.voidupdate(Properties options) The NamingServiceUpdater interface.Methods inherited from class I2PAppThread
addOOMEventThreadListener, fireOOM, removeOOMEventThreadListenerModifier 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, startModifier and TypeMethodDescriptionstatic voidRegister a new component that wants notification of OOM events.static voidUnregister a component that wants notification of OOM events.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
DaemonThread
Construct a DaemonThread with the command line arguments args.- Parameters:
args- A String array to pass toDaemon.main(String[]).
Method Details
run
halt
public void halt()Halt the thread and stop the daemon.update
The NamingServiceUpdater interface. While this may be called directly, the recommended way is to callI2PAppContext.namingService()requestUpdate(Properties) which will call this.- Specified by:
updatein interfaceNamingServiceUpdater- Parameters:
options- ignored, may be null