类 ShutdownHookProcessDestroyer
java.lang.Object
com.sh.common.exec.ShutdownHookProcessDestroyer
- 所有已实现的接口:
ProcessDestroyer,Runnable
Description:
Title:首亨软件 - CRM、TSS、ERP等信息化管理软件
-
构造器概要
构造器构造器说明Constructs aProcessDestroyerand obtainsRuntime.addShutdownHook()andRuntime.removeShutdownHook()through reflection. -
方法概要
修饰符和类型方法说明booleanReturnstrueif the specifiedProcesswas successfully added to the list of processes to destroy upon VM exit.booleanReturns whether or not the ProcessDestroyer is registered as as shutdown hookbooleanReturnstrueif the specifiedProcesswas successfully removed from the list of processes to destroy upon VM exit.voidrun()Invoked by the VM when it is exiting.intsize()Returns the number of registered processes.
-
构造器详细资料
-
ShutdownHookProcessDestroyer
public ShutdownHookProcessDestroyer()Constructs aProcessDestroyerand obtainsRuntime.addShutdownHook()andRuntime.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, thisProcessDestroyeris registered as a shutdown hook. If removing a process results in an empty list, theProcessDestroyeris 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
Returnstrueif the specifiedProcesswas successfully added to the list of processes to destroy upon VM exit.- 指定者:
add在接口中ProcessDestroyer- 参数:
process- the process to add- 返回:
trueif the specifiedProcesswas successfully added
-
remove
Returnstrueif the specifiedProcesswas successfully removed from the list of processes to destroy upon VM exit.- 指定者:
remove在接口中ProcessDestroyer- 参数:
process- the process to remove- 返回:
trueif the specifiedProcesswas 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.
-