Package org.zeroturnaround.exec.listener
Class CompositeProcessListener
java.lang.Object
org.zeroturnaround.exec.listener.ProcessListener
org.zeroturnaround.exec.listener.CompositeProcessListener
- All Implemented Interfaces:
Cloneable
Composite process event handler.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(ProcessListener listener) Add new listener.void
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.void
clear()
Remove all existing listeners.clone()
void
remove
(ProcessListener listener) Remove existing listener.void
removeAll
(Class<? extends ProcessListener> type) Remove existing listeners of given type or its sub-types.
-
Field Details
-
children
-
-
Constructor Details
-
CompositeProcessListener
public CompositeProcessListener() -
CompositeProcessListener
-
-
Method Details
-
add
Add new listener.- Parameters:
listener
- listener to be added.
-
remove
Remove existing listener.- Parameters:
listener
- listener to be removed.
-
removeAll
Remove existing listeners of given type or its sub-types.- Parameters:
type
- listener type.
-
clear
public void clear()Remove all existing listeners. -
clone
-
beforeStart
Description copied from class:ProcessListener
Invoked before a process is started.- Overrides:
beforeStart
in classProcessListener
- 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
Description copied from class:ProcessListener
Invoked after a process has started.- Overrides:
afterStart
in classProcessListener
- 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
Description copied from class:ProcessListener
Invoked after a process has finished successfully.- Overrides:
afterFinish
in classProcessListener
- Parameters:
process
- process just finished.result
- result of the finished process.
-
afterStop
Description copied from class:ProcessListener
Invoked after a process has exited (whether finished or cancelled).- Overrides:
afterStop
in classProcessListener
- Parameters:
process
- process just stopped.
-