Class LocalSlaveStreamHandler
java.lang.Object
com.carrotsearch.ant.tasks.junit4.LocalSlaveStreamHandler
- All Implemented Interfaces:
org.apache.tools.ant.taskdefs.ExecuteStreamHandler
public class LocalSlaveStreamHandler
extends Object
implements org.apache.tools.ant.taskdefs.ExecuteStreamHandler
Establish event passing with a subprocess and pump events to the bus.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate CharsetClient charset extracted fromBootstrapEvent.private final com.google.common.eventbus.EventBusprivate final InputStreamprivate final longprivate LongA timestamp of last received event (GH-106).private final ClassLoaderprivate InputStreamprivate OutputStreamraw input stream to the client.private OutputStreamWritercharacter-wrapped input stream to the client.private InputStreamprivate booleanprivate final RandomAccessFileprivate final OutputStreamprivate final OutputStreamprivate final OutputStreamprivate final PrintStreamprivate ThreadWatchdog thread if heartbeat is to be measured. -
Constructor Summary
ConstructorsConstructorDescriptionLocalSlaveStreamHandler(com.google.common.eventbus.EventBus eventBus, ClassLoader classLoader, PrintStream warnStream, InputStream eventStream, OutputStream sysout, OutputStream syserr, long heartbeat, RandomAccessFile streamsBuffer) -
Method Summary
Modifier and TypeMethodDescription(package private) voidpumpEvents(InputStream eventStream) Pump events from event stream.voidvoidvoidvoidstart()voidstop()
-
Field Details
-
eventBus
private final com.google.common.eventbus.EventBus eventBus -
refLoader
-
stdout
-
stderr
-
stdin
raw input stream to the client. -
stdinWriter
character-wrapped input stream to the client. -
warnStream
-
eventStream
-
stopping
private volatile boolean stopping -
pumpers
-
sysout
-
syserr
-
heartbeat
private final long heartbeat -
streamsBuffer
-
streamsBufferWrapper
-
lastActivity
A timestamp of last received event (GH-106). -
watchdog
Watchdog thread if heartbeat is to be measured. -
clientCharset
Client charset extracted fromBootstrapEvent.
-
-
Constructor Details
-
LocalSlaveStreamHandler
public LocalSlaveStreamHandler(com.google.common.eventbus.EventBus eventBus, ClassLoader classLoader, PrintStream warnStream, InputStream eventStream, OutputStream sysout, OutputStream syserr, long heartbeat, RandomAccessFile streamsBuffer)
-
-
Method Details
-
setProcessErrorStream
- Specified by:
setProcessErrorStreamin interfaceorg.apache.tools.ant.taskdefs.ExecuteStreamHandler- Throws:
IOException
-
setProcessOutputStream
- Specified by:
setProcessOutputStreamin interfaceorg.apache.tools.ant.taskdefs.ExecuteStreamHandler- Throws:
IOException
-
setProcessInputStream
- Specified by:
setProcessInputStreamin interfaceorg.apache.tools.ant.taskdefs.ExecuteStreamHandler- Throws:
IOException
-
start
- Specified by:
startin interfaceorg.apache.tools.ant.taskdefs.ExecuteStreamHandler- Throws:
IOException
-
pumpEvents
Pump events from event stream. -
stop
public void stop()- Specified by:
stopin interfaceorg.apache.tools.ant.taskdefs.ExecuteStreamHandler
-