Class KillHandler

  • All Implemented Interfaces:
    java.lang.Runnable

    public class KillHandler
    extends java.lang.Thread
    Utility class for when releasing resources when the runtime system is shutting down.
    Since:
    3.0
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static interface  KillHandler.Killable
      Interface denoting an object which can be killed by the KillHandler
      • Nested classes/interfaces inherited from class java.lang.Thread

        java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected KillHandler.Killable killable  
      • Fields inherited from class java.lang.Thread

        MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void addKillhandler​(KillHandler.Killable object)
      Add a Killable objects to the shutdown list which are invoked when the runtime system is terminating.
      static void removeKillhandler​(KillHandler.Killable object)
      Remove a Killable objects from the shutdown list which are invoked when the runtime system is terminating.
      void run()
      • Methods inherited from class java.lang.Thread

        activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • addKillhandler

        public static void addKillhandler​(KillHandler.Killable object)
        Add a Killable objects to the shutdown list which are invoked when the runtime system is terminating.
        Parameters:
        object - the object with the kill handler
      • removeKillhandler

        public static void removeKillhandler​(KillHandler.Killable object)
        Remove a Killable objects from the shutdown list which are invoked when the runtime system is terminating.
        Parameters:
        object - the object with the kill handler
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
        Overrides:
        run in class java.lang.Thread