Class AbstractCommandStream
- java.lang.Object
-
- java.io.InputStream
-
- org.apache.maven.plugin.surefire.booterclient.lazytestprovider.AbstractForkInputStream
-
- org.apache.maven.plugin.surefire.booterclient.lazytestprovider.AbstractCommandStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,NotifiableTestStream
- Direct Known Subclasses:
TestLessInputStream,TestProvidingInputStream
public abstract class AbstractCommandStream extends AbstractForkInputStream
Reader stream sends commands to forked jvm std-input-stream.- Since:
- 2.19
- See Also:
Command
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]currentBufferprivate intcurrentPos
-
Constructor Summary
Constructors Constructor Description AbstractCommandStream()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidbeforeNextCommand()Possibly waiting for next command (seenextCommand()) unless the stream is atomically closed (seeisClosed()returnstrue) before this method has returned.protected booleancanContinue()Opposite toisClosed().protected voidinvalidateInternalBuffer()Returns quietly and immediately.protected abstract booleanisClosed()protected abstract CommandnextCommand()intread()Used by single thread in StreamFeeder class.-
Methods inherited from class org.apache.maven.plugin.surefire.booterclient.lazytestprovider.AbstractForkInputStream
setFlushReceiverProvider, tryFlush
-
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.maven.plugin.surefire.booterclient.lazytestprovider.NotifiableTestStream
acknowledgeByeEventReceived, noop, provideNewTest, shutdown, skipSinceNextTest
-
-
-
-
Method Detail
-
isClosed
protected abstract boolean isClosed()
-
canContinue
protected boolean canContinue()
Opposite toisClosed().- Returns:
trueif not closed
-
beforeNextCommand
protected void beforeNextCommand() throws java.io.IOExceptionPossibly waiting for next command (seenextCommand()) unless the stream is atomically closed (seeisClosed()returnstrue) before this method has returned.- Throws:
java.io.IOException- stream error while waiting for notification regarding next test required by forked jvm
-
nextCommand
protected abstract Command nextCommand()
-
invalidateInternalBuffer
protected final void invalidateInternalBuffer()
Returns quietly and immediately.
-
read
public int read() throws java.io.IOExceptionUsed by single thread in StreamFeeder class.- Specified by:
readin classjava.io.InputStream- Returns:
- Throws:
java.io.IOException
-
-