类 ShutdownHookProcessDestroyer

java.lang.Object
com.sh.common.exec.ShutdownHookProcessDestroyer
所有已实现的接口:
ProcessDestroyer, Runnable

public class ShutdownHookProcessDestroyer extends Object implements ProcessDestroyer, Runnable
Description: Title:首亨软件 - CRM、TSS、ERP等信息化管理软件
  • 构造器概要

    构造器
    构造器
    说明
    Constructs a ProcessDestroyer and obtains Runtime.addShutdownHook() and Runtime.removeShutdownHook() through reflection.
  • 方法概要

    修饰符和类型
    方法
    说明
    boolean
    add(Process process)
    Returns true if the specified Process was successfully added to the list of processes to destroy upon VM exit.
    boolean
    Returns whether or not the ProcessDestroyer is registered as as shutdown hook
    boolean
    remove(Process process)
    Returns true if the specified Process was successfully removed from the list of processes to destroy upon VM exit.
    void
    run()
    Invoked by the VM when it is exiting.
    int
    Returns the number of registered processes.

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 构造器详细资料

    • ShutdownHookProcessDestroyer

      public ShutdownHookProcessDestroyer()
      Constructs a ProcessDestroyer and obtains Runtime.addShutdownHook() and Runtime.removeShutdownHook() through reflection. The ProcessDestroyer manages a list of processes to be destroyed when the VM exits. If a process is added when the list is empty, this ProcessDestroyer is registered as a shutdown hook. If removing a process results in an empty list, the ProcessDestroyer is removed as a shutdown hook.
  • 方法详细资料

    • isAddedAsShutdownHook

      public boolean isAddedAsShutdownHook()
      Returns whether or not the ProcessDestroyer is registered as as shutdown hook
      返回:
      true if this is currently added as shutdown hook
    • add

      public boolean add(Process process)
      Returns true if the specified Process was successfully added to the list of processes to destroy upon VM exit.
      指定者:
      add 在接口中 ProcessDestroyer
      参数:
      process - the process to add
      返回:
      true if the specified Process was successfully added
    • remove

      public boolean remove(Process process)
      Returns true if the specified Process was successfully removed from the list of processes to destroy upon VM exit.
      指定者:
      remove 在接口中 ProcessDestroyer
      参数:
      process - the process to remove
      返回:
      true if the specified Process was successfully removed
    • size

      public int size()
      Returns the number of registered processes.
      指定者:
      size 在接口中 ProcessDestroyer
      返回:
      the number of register process
    • run

      public void run()
      Invoked by the VM when it is exiting.
      指定者:
      run 在接口中 Runnable