Package org.snpeff.osCmd
Class StreamGobbler
- java.lang.Object
-
- java.lang.Thread
-
- org.snpeff.osCmd.StreamGobbler
-
- All Implemented Interfaces:
java.lang.Runnable
public class StreamGobbler extends java.lang.ThreadRead the contents of a stream in a separate thread This class is used when executing OS commands in order to read STDOUT / STDERR and prevent process blocking It can alert an AlertListener when a given string is in the stream- Author:
- pcingola
-
-
Field Summary
Fields Modifier and Type Field Description static intBUFFER_SIZEstatic intHEAD_SIZE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetAlert()java.lang.ObjectgetAlertNotify()java.lang.StringgetAllLines()java.lang.StringgetHead()Head: First HEAD_SIZE lines of this outputjava.lang.StringgetRedirectTo()booleanisAlertDone()booleanisBinary()booleanisRunning()voidresetBuffer()voidrun()voidsetAlert(java.lang.String alert)voidsetAlertNotify(java.lang.Object alertNotify)voidsetBinary(boolean binary)voidsetLineFilter(LineFilter lineFilter)voidsetProgress(Progress progress)voidsetQuietMode()voidsetRedirectTo(java.lang.String redirectTo)voidsetSaveLinesInMemory(boolean saveLinesInMemory)-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Method Detail
-
getAlert
public java.lang.String getAlert()
-
getAlertNotify
public java.lang.Object getAlertNotify()
-
getAllLines
public java.lang.String getAllLines()
-
getHead
public java.lang.String getHead()
Head: First HEAD_SIZE lines of this output- Returns:
-
getRedirectTo
public java.lang.String getRedirectTo()
-
isAlertDone
public boolean isAlertDone()
-
isBinary
public boolean isBinary()
-
isRunning
public boolean isRunning()
-
resetBuffer
public void resetBuffer()
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable- Overrides:
runin classjava.lang.Thread
-
setAlert
public void setAlert(java.lang.String alert)
-
setAlertNotify
public void setAlertNotify(java.lang.Object alertNotify)
-
setBinary
public void setBinary(boolean binary)
-
setLineFilter
public void setLineFilter(LineFilter lineFilter)
-
setProgress
public void setProgress(Progress progress)
-
setQuietMode
public void setQuietMode()
-
setRedirectTo
public void setRedirectTo(java.lang.String redirectTo)
-
setSaveLinesInMemory
public void setSaveLinesInMemory(boolean saveLinesInMemory)
-
-