net.sf.colossus.webserver
Class RunGameInOwnJVM.NullDumper

java.lang.Object
  extended by net.sf.colossus.webserver.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
(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
RunGameInOwnJVM.NullDumper(java.lang.Process p, boolean toNull, java.io.InputStream is, java.lang.String prefix)
           
 
Method Summary
 void done()
           
 void run()
           
 RunGameInOwnJVM.NullDumper start()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

RunGameInOwnJVM.NullDumper

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

start

public RunGameInOwnJVM.NullDumper start()

run

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

done

public void done()