Class RunGameInOwnJVM.NullDumper

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

    private static class RunGameInOwnJVM.NullDumper
    extends java.lang.Object
    implements java.lang.Runnable
    NullDumper is a dummy reader that just consumes all the output produced by a Game's process - similar to /dev/null. That is needed because we have to take care to read all what comes on the Game's processes stdout and stderr, otherwise the game would block at some point. If the boolean argument toNull to constructor is false, it will send the produced output to the log instead. TODO rename to toLog instead. Should toLog be default nowadays that there is not much output any more?
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) java.lang.String prefix  
      (package private) java.lang.Process process  
      (package private) java.io.BufferedReader reader  
      (package private) java.lang.Thread thread  
      (package private) boolean toNull  
    • Constructor Summary

      Constructors 
      Constructor Description
      NullDumper​(java.lang.Process p, boolean toNull, java.io.InputStream is, java.lang.String prefix)  
    • Field Detail

      • process

        java.lang.Process process
      • toNull

        boolean toNull
      • reader

        java.io.BufferedReader reader
      • prefix

        java.lang.String prefix
      • thread

        java.lang.Thread thread
    • Constructor Detail

      • NullDumper

        public NullDumper​(java.lang.Process p,
                          boolean toNull,
                          java.io.InputStream is,
                          java.lang.String prefix)
    • Method Detail

      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
      • done

        public void done()