Interface ShutdownHook


public interface ShutdownHook
Implementations of this interface can be optionally supplied to UpdateManager to be invoked before the application is restarted. Application restarts are needed as new extension jars are downloaded, installed, or uninstalled. The application may need to do some cleanup before the application exits - close database connections, save all work, etc. This hook provides a way to be notified before a restart. Shutdown hooks cannot prevent the restart - this is a notification, not a request.

NOTE: all registered shutdown hooks are triggered ONLY on application restart, not when the application exits normally. This is not a replacement for your normal cleanup mechanism!

Since:
swing-extras 2.5
Author:
scorbo2
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    The application is about to restart.
  • Method Details

    • applicationWillRestart

      void applicationWillRestart()
      The application is about to restart. Perform whatever cleanup your application requires here, before the restart happens.

      NOTE: Don't start a worker thread to handle your cleanup! As soon as the last shutdown hook returns, System.exit() is invoked. Make sure your buffers are flushed, your changes are saved, and your connections are closed!