net.i2p.router.tasks

## Class Spinner

- java.lang.Object
- - java.lang.Thread
  - - net.i2p.router.tasks.Spinner

- All Implemented Interfaces:
    Runnable

      public class Spinner
      extends Thread

  Shutdown delay thread to ensure complete router termination. This non-daemon thread keeps the JVM alive during shutdown processes to prevent premature termination. During router shutdown, various cleanup tasks, file operations, and network shutdown procedures need time to complete properly. Purpose:
  - Prevents JVM from exiting before shutdown tasks finish
  - Provides 5-minute window for complete cleanup
  - Ensures file operations and network graceful shutdown complete
  - Allows time for shutdown hooks to execute fully
  As a non-daemon thread, the JVM will not terminate until this thread completes its 5-minute sleep or is interrupted. This is especially important for ensuring router.info files are written correctly and network connections are closed gracefully.

- - ### Nested Class Summary

    - ### 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

    Constructors
    Constructor and Description
    `Spinner()` Create a new shutdown spinner thread.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `run()` Keep JVM alive for shutdown tasks to complete.

    - ### Methods inherited from class java.lang.Thread

      `activeCount, checkAccess, clone, 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

      `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Spinner

          public Spinner()

      Create a new shutdown spinner thread. This is a non-daemon thread that keeps the JVM alive during shutdown processes to ensure they complete fully.

  - ### Method Detail

    - #### run

          public void run()

      Keep JVM alive for shutdown tasks to complete. This thread simply sleeps for 5 minutes to provide time for shutdown tasks to finish. As a non-daemon thread, it prevents the JVM from exiting until it completes. The thread can be interrupted to terminate early if needed.
      Specified by:
        `run` in interface `Runnable`
      Overrides:
        `run` in class `Thread`