Package org.zeroturnaround.exec.listener
Class ProcessListener
java.lang.Object
org.zeroturnaround.exec.listener.ProcessListener
- Direct Known Subclasses:
CompositeProcessListener
,DestroyerListenerAdapter
Event handler for process events.
This is a class instead of interface in order to add new methods without updating all implementations.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
afterFinish
(Process process, ProcessResult result) Invoked after a process has finished successfully.void
afterStart
(Process process, ProcessExecutor executor) Invoked after a process has started.void
Invoked after a process has exited (whether finished or cancelled).void
beforeStart
(ProcessExecutor executor) Invoked before a process is started.
-
Constructor Details
-
ProcessListener
public ProcessListener()
-
-
Method Details
-
beforeStart
Invoked before a process is started.- Parameters:
executor
- executor used for starting a process. Any changes made here apply to the starting process. Once the process has started it is not affected by theProcessExecutor
any more.
-
afterStart
Invoked after a process has started.- Parameters:
process
- the process started.executor
- executor used for starting the process. Modifying theProcessExecutor
only affects the following processes not the one just started.
-
afterFinish
Invoked after a process has finished successfully.- Parameters:
process
- process just finished.result
- result of the finished process.- Since:
- 1.8
-
afterStop
Invoked after a process has exited (whether finished or cancelled).- Parameters:
process
- process just stopped.
-