net.i2p.util
Class I2PThread

java.lang.Object
  extended by java.lang.Thread
      extended by net.i2p.util.I2PThread
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
DHSessionKeyBuilder.PrecalcRunner, I2PAppThread

public class I2PThread
extends Thread

In case its useful later... (e.g. w/ native programatic thread dumping, etc)


Nested Class Summary
static interface I2PThread.OOMEventListener
           
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
I2PThread()
           
I2PThread(Runnable r)
           
I2PThread(Runnable r, String name)
           
I2PThread(Runnable r, String name, boolean isDaemon)
           
I2PThread(String name)
           
I2PThread(ThreadGroup g, Runnable r)
           
 
Method Summary
static void addOOMEventListener(I2PThread.OOMEventListener lsnr)
          register a new component that wants notification of OOM events
protected  void fireOOM(OutOfMemoryError oom)
          protected void finalize() throws Throwable { //log(Log.DEBUG, "Thread finalized: " + _name); super.finalize(); }
static void removeOOMEventListener(I2PThread.OOMEventListener lsnr)
          unregister a component that wants notification of OOM events
 void run()
          private void log(int level, String msg) { log(level, msg, null); } private void log(int level, String msg, Throwable t) { // we cant assume log is created if (_log == null) _log = new Log(I2PThread.class); if (_log.shouldLog(level)) _log.log(level, msg, t); }
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

I2PThread

public I2PThread()

I2PThread

public I2PThread(String name)

I2PThread

public I2PThread(Runnable r)

I2PThread

public I2PThread(Runnable r,
                 String name)

I2PThread

public I2PThread(Runnable r,
                 String name,
                 boolean isDaemon)

I2PThread

public I2PThread(ThreadGroup g,
                 Runnable r)
Method Detail

run

public void run()
private void log(int level, String msg) { log(level, msg, null); } private void log(int level, String msg, Throwable t) { // we cant assume log is created if (_log == null) _log = new Log(I2PThread.class); if (_log.shouldLog(level)) _log.log(level, msg, t); }

Specified by:
run in interface Runnable
Overrides:
run in class Thread

fireOOM

protected void fireOOM(OutOfMemoryError oom)
protected void finalize() throws Throwable { //log(Log.DEBUG, "Thread finalized: " + _name); super.finalize(); }


addOOMEventListener

public static void addOOMEventListener(I2PThread.OOMEventListener lsnr)
register a new component that wants notification of OOM events


removeOOMEventListener

public static void removeOOMEventListener(I2PThread.OOMEventListener lsnr)
unregister a component that wants notification of OOM events