|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread cz.cuni.amis.utils.StreamSink
public class StreamSink
Reads content of the stream and discards it.
Optionally it may log the content of the stream to some logger (i.e., redirects the output of the stream to some log).
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
protected java.util.logging.Logger |
log
|
protected java.lang.String |
logId
|
protected java.util.logging.Level |
logLevel
|
protected java.io.InputStream |
os
|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
StreamSink(java.lang.String name,
java.io.InputStream os)
Constructs the sink to silently discard all contents of 'os'. |
|
StreamSink(java.lang.String name,
java.io.InputStream os,
java.util.logging.Logger log)
Constructs the sink to redirect all output from 'os' into 'log' (used log level is Level.INFO ) as default. |
|
StreamSink(java.lang.String name,
java.io.InputStream os,
java.util.logging.Logger log,
java.lang.String logId)
Constructs the sink to redirect all output from 'os' into 'log' (used log level is Level.INFO ) as default. |
Method Summary | |
---|---|
java.util.logging.Logger |
getLog()
|
java.lang.String |
getLogId()
|
java.util.logging.Level |
getLogLevel()
|
protected void |
handleInput(java.lang.String str)
|
void |
run()
|
protected StreamSink |
setLog(java.util.logging.Logger log)
|
protected StreamSink |
setLogId(java.lang.String logId)
|
StreamSink |
setLogLevel(java.util.logging.Level logLevel)
|
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, clone, 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 |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.io.InputStream os
protected java.util.logging.Logger log
protected java.lang.String logId
protected java.util.logging.Level logLevel
Constructor Detail |
---|
public StreamSink(java.lang.String name, java.io.InputStream os)
name
- name of the sink threados
- stream to be sunkpublic StreamSink(java.lang.String name, java.io.InputStream os, java.util.logging.Logger log)
Level.INFO
) as default. May
be changed by setLogLevel(Level)
.
May
name
- name of the sink threados
- log
- public StreamSink(java.lang.String name, java.io.InputStream os, java.util.logging.Logger log, java.lang.String logId)
Level.INFO
) as default. May
be changed by setLogLevel(Level)
. Additionally all messages from the 'os' will be prefixed with 'logId+" "'.
name
- name of the sink threados
- log
- logId
- Method Detail |
---|
public java.util.logging.Level getLogLevel()
public StreamSink setLogLevel(java.util.logging.Level logLevel)
public java.util.logging.Logger getLog()
protected StreamSink setLog(java.util.logging.Logger log)
public java.lang.String getLogId()
protected StreamSink setLogId(java.lang.String logId)
protected void handleInput(java.lang.String str)
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |