Class CompositeProcessListener

java.lang.Object
org.zeroturnaround.exec.listener.ProcessListener
org.zeroturnaround.exec.listener.CompositeProcessListener
All Implemented Interfaces:
Cloneable

public class CompositeProcessListener extends ProcessListener implements Cloneable
Composite process event handler.
  • Field Details

  • Constructor Details

    • CompositeProcessListener

      public CompositeProcessListener()
    • CompositeProcessListener

      public CompositeProcessListener(List<ProcessListener> children)
  • Method Details

    • add

      public void add(ProcessListener listener)
      Add new listener.
      Parameters:
      listener - listener to be added.
    • remove

      public void remove(ProcessListener listener)
      Remove existing listener.
      Parameters:
      listener - listener to be removed.
    • removeAll

      public void removeAll(Class<? extends ProcessListener> type)
      Remove existing listeners of given type or its sub-types.
      Parameters:
      type - listener type.
    • clear

      public void clear()
      Remove all existing listeners.
    • clone

      public CompositeProcessListener clone()
      Overrides:
      clone in class Object
    • beforeStart

      public void beforeStart(ProcessExecutor executor)
      Description copied from class: ProcessListener
      Invoked before a process is started.
      Overrides:
      beforeStart in class ProcessListener
      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 the ProcessExecutor any more.
    • afterStart

      public void afterStart(Process process, ProcessExecutor executor)
      Description copied from class: ProcessListener
      Invoked after a process has started.
      Overrides:
      afterStart in class ProcessListener
      Parameters:
      process - the process started.
      executor - executor used for starting the process. Modifying the ProcessExecutor only affects the following processes not the one just started.
    • afterFinish

      public void afterFinish(Process process, ProcessResult result)
      Description copied from class: ProcessListener
      Invoked after a process has finished successfully.
      Overrides:
      afterFinish in class ProcessListener
      Parameters:
      process - process just finished.
      result - result of the finished process.
    • afterStop

      public void afterStop(Process process)
      Description copied from class: ProcessListener
      Invoked after a process has exited (whether finished or cancelled).
      Overrides:
      afterStop in class ProcessListener
      Parameters:
      process - process just stopped.