Class ThreadedStreamConsumer
- java.lang.Object
-
- org.apache.maven.plugin.surefire.booterclient.output.ThreadedStreamConsumer
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,org.apache.maven.shared.utils.cli.StreamConsumer
public final class ThreadedStreamConsumer extends java.lang.Object implements org.apache.maven.shared.utils.cli.StreamConsumer, java.io.CloseableKnows how to reconstruct *all* the state transmitted over stdout by the forked process.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classThreadedStreamConsumer.Pumper
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringEND_ITEMprivate static intITEM_LIMIT_BEFORE_SLEEPprivate java.util.concurrent.BlockingQueue<java.lang.String>itemsprivate ThreadedStreamConsumer.Pumperpumperprivate java.util.concurrent.atomic.AtomicBooleanstopprivate java.lang.Threadthread
-
Constructor Summary
Constructors Constructor Description ThreadedStreamConsumer(org.apache.maven.shared.utils.cli.StreamConsumer target)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidconsumeLine(java.lang.String s)private booleanshouldStopQueueing(java.lang.String item)Compared item withEND_ITEMby identity.
-
-
-
Field Detail
-
END_ITEM
private static final java.lang.String END_ITEM
- See Also:
- Constant Field Values
-
ITEM_LIMIT_BEFORE_SLEEP
private static final int ITEM_LIMIT_BEFORE_SLEEP
- See Also:
- Constant Field Values
-
items
private final java.util.concurrent.BlockingQueue<java.lang.String> items
-
stop
private final java.util.concurrent.atomic.AtomicBoolean stop
-
thread
private final java.lang.Thread thread
-
pumper
private final ThreadedStreamConsumer.Pumper pumper
-
-
Method Detail
-
consumeLine
public void consumeLine(java.lang.String s)
- Specified by:
consumeLinein interfaceorg.apache.maven.shared.utils.cli.StreamConsumer
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
shouldStopQueueing
private boolean shouldStopQueueing(java.lang.String item)
Compared item withEND_ITEMby identity.- Parameters:
item- element fromitems- Returns:
trueif tail of the queue
-
-