接口 SpringApplicationShutdownHandlers


public interface SpringApplicationShutdownHandlers
Interface that can be used to add or remove code that should run when the JVM is shutdown. Shutdown handlers are similar to JVM shutdown hooks except that they run sequentially rather than concurrently.

Shutdown handlers are guaranteed to be called only after registered ApplicationContext instances have been closed and are no longer active.

从以下版本开始:
2.5.1
作者:
Phillip Webb, Andy Wilkinson
另请参阅:
  • 方法概要

    修饰符和类型
    方法
    说明
    void
    add(Runnable action)
    Add an action to the handlers that will be run when the JVM exits.
    void
    remove(Runnable action)
    Remove a previously added an action so that it no longer runs when the JVM exits.
  • 方法详细资料

    • add

      void add(Runnable action)
      Add an action to the handlers that will be run when the JVM exits.
      参数:
      action - the action to add
    • remove

      void remove(Runnable action)
      Remove a previously added an action so that it no longer runs when the JVM exits.
      参数:
      action - the action to remove