Class DefaultProcessListener

  • All Implemented Interfaces:
    IProcessListener

    public class DefaultProcessListener
    extends AProcessListener
    The DefaultProcessListener might be used to forward any type of outputs of a process to a logger.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean verbose
      Flag whether standard outputs are forwarded to the logger.
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultProcessListener​(boolean verbose)
      Constructor to initialize the DefaultProcessListener.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void handleError​(java.lang.String error)
      Handle the output of the error output stream.
      void handleInput​(java.lang.String input)
      Handle the output of the standard output stream.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • verbose

        protected final boolean verbose
        Flag whether standard outputs are forwarded to the logger.
    • Constructor Detail

      • DefaultProcessListener

        public DefaultProcessListener​(boolean verbose)
        Constructor to initialize the DefaultProcessListener.
        Parameters:
        verbose - Flag whether standard outputs are forwarded to the logger.
    • Method Detail

      • handleError

        public void handleError​(java.lang.String error)
        Description copied from class: AProcessListener
        Handle the output of the error output stream.
        Specified by:
        handleError in class AProcessListener
        Parameters:
        error - The line sent by the process via the error stream.
      • handleInput

        public void handleInput​(java.lang.String input)
                         throws java.io.IOException,
                                java.lang.InterruptedException
        Description copied from class: AProcessListener
        Handle the output of the standard output stream.
        Specified by:
        handleInput in class AProcessListener
        Throws:
        java.io.IOException - An IOException is thrown if there is an issue reading from the process's stream.
        java.lang.InterruptedException - An interrupted exception is thrown if the thread/process is interrupted while processing the standard output messages.