|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Thread
genopt.simulation.ThreadedInputStream
public class ThreadedInputStream
Class to buffer the error stream. This class is needed to avoid a deadlock of waitFor(), which may happen if the simulation program writes a large message.
This project was carried out at:
and supported byGenOpt Copyright (c) 1998-2011, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
protected java.io.IOException |
ioExc
The IOException stored by this thread |
(package private) java.io.InputStream |
is
The buffered input stream |
(package private) java.lang.StringBuffer |
sb
The string buffer that stores the output of the stream |
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
ThreadedInputStream(java.io.InputStream inputStream)
|
|
| Method Summary | |
|---|---|
(package private) java.lang.String |
getInputStream()
Gets the output input stream that has been buffered |
void |
run()
Runs this thread and buffers its output |
void |
throwStoredException()
Throws all exceptions that have been catched when running run. |
| 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.IOException ioExc
java.io.InputStream is
java.lang.StringBuffer sb
| Constructor Detail |
|---|
public ThreadedInputStream(java.io.InputStream inputStream)
| Method Detail |
|---|
public void run()
run in interface java.lang.Runnablerun in class java.lang.Thread
public void throwStoredException()
throws java.io.IOException
run.
java.io.IOExceptionjava.lang.String getInputStream()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||