Class CleanupHook

  • All Implemented Interfaces:
    Runnable

    public class CleanupHook
    extends Thread
    Defines a ShutdownHook for a class which has a cleanup method.
    • Constructor Detail

      • CleanupHook

        public CleanupHook​(CleanupIF app)
        Returns a ShutdownHook thread for an object with a cleanup() method.
        Parameters:
        app - the Object to be cleaned up
    • Method Detail

      • run

        public void run()
        Called by the JVM to clean up the object before exiting. The method calls the cleanup() method Note: System.out.println is added in this method because logging may or may not be active at this time.
        Specified by:
        run in interface Runnable
        Overrides:
        run in class Thread