org.fhcrc.cpl.toolbox.statistics
Class RInterface.RErrorReaderThread

java.lang.Object
  extended by java.lang.Thread
      extended by org.fhcrc.cpl.toolbox.statistics.RInterface.RErrorReaderThread
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
RInterface

public static class RInterface.RErrorReaderThread
extends java.lang.Thread

Manages the R error inputstream. On some systems, the error inputstream must be read periodically or writing to the outputstream will hang. In particular, I've seen output writing hang after 8kb are written; apparently something gets written to the error outputstream during that write, and unless it's written, nothing doing.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected  java.lang.StringBuffer accumulatedResponse
           
 java.io.IOException exception
           
protected  boolean hasNewData
           
protected  java.io.InputStream inputStream
           
protected  boolean keepReading
           
protected  java.lang.StringBuffer newDataBuf
           
 int status
           
static int STATUS_ERROR
           
static int STATUS_READING
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
RInterface.RErrorReaderThread(java.lang.Process p)
           
 
Method Summary
 java.lang.String getNewData()
           
 java.lang.String getReadString()
           
 boolean hasNewData()
           
 void run()
           
 void shutdown()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

inputStream

protected java.io.InputStream inputStream

accumulatedResponse

protected java.lang.StringBuffer accumulatedResponse

newDataBuf

protected java.lang.StringBuffer newDataBuf

keepReading

protected boolean keepReading

exception

public java.io.IOException exception

status

public int status

STATUS_READING

public static final int STATUS_READING
See Also:
Constant Field Values

STATUS_ERROR

public static final int STATUS_ERROR
See Also:
Constant Field Values

hasNewData

protected boolean hasNewData
Constructor Detail

RInterface.RErrorReaderThread

public RInterface.RErrorReaderThread(java.lang.Process p)
Method Detail

run

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

shutdown

public void shutdown()

getReadString

public java.lang.String getReadString()

hasNewData

public boolean hasNewData()

getNewData

public java.lang.String getNewData()


Fred Hutchinson Cancer Research Center