Class ThreadedStreamConsumer.Pumper

  • All Implemented Interfaces:
    java.lang.Runnable
    Enclosing class:
    ThreadedStreamConsumer

    final class ThreadedStreamConsumer.Pumper
    extends java.lang.Object
    implements java.lang.Runnable
    • Constructor Summary

      Constructors 
      Constructor Description
      Pumper​(org.apache.maven.shared.utils.cli.StreamConsumer target)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) boolean hasErrors()  
      void run()
      Calls ForkClient.consumeLine(String) which may throw any RuntimeException.
      Even if ForkClient is not fault-tolerant, this method MUST be fault-tolerant and thus the try-catch block must be inside of the loop which prevents from loosing events from StreamConsumer.
      (package private) void throwErrors()  
      • Methods inherited from class java.lang.Object

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

      • target

        private final org.apache.maven.shared.utils.cli.StreamConsumer target
    • Constructor Detail

      • Pumper

        Pumper​(org.apache.maven.shared.utils.cli.StreamConsumer target)
    • Method Detail

      • run

        public void run()
        Calls ForkClient.consumeLine(String) which may throw any RuntimeException.
        Even if ForkClient is not fault-tolerant, this method MUST be fault-tolerant and thus the try-catch block must be inside of the loop which prevents from loosing events from StreamConsumer.
        If ConsoleOutputFileReporter.writeTestOutput(java.lang.String, boolean, boolean) throws IOException and then target.consumeLine() throws any RuntimeException, this method MUST NOT skip reading the events from the forked JVM; otherwise we could simply lost events e.g. acquire-next-test which means that ForkClient could hang on waiting for old test to complete and therefore the plugin could be permanently in progress.
        Specified by:
        run in interface java.lang.Runnable
      • hasErrors

        boolean hasErrors()
      • throwErrors

        void throwErrors()
                  throws java.io.IOException
        Throws:
        java.io.IOException