All Implemented Interfaces:
Runnable
Direct Known Subclasses:
DaemonThread, I2PTunnelOutproxyRunner, I2PTunnelRunner, InternalSocketRunner, UpdateRunner

public class I2PAppThreadextends I2PThread
Like I2PThread but with per-thread OOM listeners, rather than a static router-wide listener list, so that an OOM in an app won't call the router listener to shutdown the whole router.

This is preferred for application use. See I2PThread for features.

  • Constructor Details

    • I2PAppThread

      public I2PAppThread()
      Creates a new I2PAppThread with no target or name.
    • I2PAppThread

      public I2PAppThread(String name)
      Creates a new I2PAppThread with the given name.
      Parameters:
      name - the thread name
    • I2PAppThread

      public I2PAppThread(Runnable r)
      Creates a new I2PAppThread with the given target runnable.
      Parameters:
      r - the target runnable
    • I2PAppThread

      public I2PAppThread(Runnable r, String name)
      Creates a new I2PAppThread with the given target and name.
      Parameters:
      r - the target runnable
      name - the thread name
    • I2PAppThread

      public I2PAppThread(Runnable r, String name, boolean isDaemon)
      Creates a new I2PAppThread with the given target, name, and daemon status.
      Parameters:
      r - the target runnable
      name - the thread name
      isDaemon - whether the thread is a daemon
    • I2PAppThread

      public I2PAppThread(ThreadGroup group, Runnable r, String name)
      Creates a new I2PAppThread in the given thread group.
      Parameters:
      group - the thread group
      r - the target runnable
      name - the thread name
  • Method Details

    • fireOOM

      protected void fireOOM(OutOfMemoryError oom)
      Description copied from class: I2PThread
      Notify listeners that an OutOfMemoryError occurred.
      Overrides:
      fireOOM in class I2PThread
      Parameters:
      oom - the error passed to every registered listener
    • addOOMEventThreadListener

      public void addOOMEventThreadListener(I2PThread.OOMEventListener lsnr)
      Register a new component that wants notification of OOM events.
      Parameters:
      lsnr - the listener to register
    • removeOOMEventThreadListener

      public void removeOOMEventThreadListener(I2PThread.OOMEventListener lsnr)
      Unregister a component that wants notification of OOM events.
      Parameters:
      lsnr - the listener to unregister