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.Closeable
Knows 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) class
ThreadedStreamConsumer.Pumper
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
END_ITEM
private static int
ITEM_LIMIT_BEFORE_SLEEP
private java.util.concurrent.BlockingQueue<java.lang.String>
items
private ThreadedStreamConsumer.Pumper
pumper
private java.util.concurrent.atomic.AtomicBoolean
stop
private java.lang.Thread
thread
-
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 void
close()
void
consumeLine(java.lang.String s)
private boolean
shouldStopQueueing(java.lang.String item)
Compared item withEND_ITEM
by 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:
consumeLine
in interfaceorg.apache.maven.shared.utils.cli.StreamConsumer
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
shouldStopQueueing
private boolean shouldStopQueueing(java.lang.String item)
Compared item withEND_ITEM
by identity.- Parameters:
item
- element fromitems
- Returns:
true
if tail of the queue
-
-