| |
|
| java.lang.Object org.apache.tools.ant.taskdefs.ProcessDestroyer
ProcessDestroyer | class ProcessDestroyer implements Runnable(Code) | | Destroys all registered Process es when the VM exits.
since: Ant 1.5 |
Constructor Summary | |
public | ProcessDestroyer() Constructs a ProcessDestroyer and obtains
Runtime.addShutdownHook() and
Runtime.removeShutdownHook() through reflection. |
Method Summary | |
public boolean | add(Process process) Returns true if the specified Process was
successfully added to the list of processes to destroy upon VM exit. | public boolean | isAddedAsShutdownHook() | public boolean | remove(Process process) Returns true if the specified Process was
successfully removed from the list of processes to destroy upon VM exit. | public void | run() Invoked by the VM when it is exiting. |
ProcessDestroyer | public ProcessDestroyer()(Code) | | 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.
|
add | public boolean add(Process process)(Code) | | Returns true if the specified Process was
successfully added to the list of processes to destroy upon VM exit.
Parameters: process - the process to add true if the specified Process wassuccessfully added |
isAddedAsShutdownHook | public boolean isAddedAsShutdownHook()(Code) | | Returns whether or not the ProcessDestroyer is registered as
as shutdown hook
true if this is currently added as shutdown hook |
remove | public boolean remove(Process process)(Code) | | Returns true if the specified Process was
successfully removed from the list of processes to destroy upon VM exit.
Parameters: process - the process to remove true if the specified Process wassuccessfully removed |
run | public void run()(Code) | | Invoked by the VM when it is exiting.
|
|
|
|