Class TestLessInputStream.TestLessInputStreamBuilder
- java.lang.Object
-
- org.apache.maven.plugin.surefire.booterclient.lazytestprovider.TestLessInputStream.TestLessInputStreamBuilder
-
- Enclosing class:
- TestLessInputStream
public static final class TestLessInputStream.TestLessInputStreamBuilder extends java.lang.ObjectBuildsstreams, registers cachable commands and provides accessible API to dispatch immediate commands to all atomically alive streams.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classTestLessInputStream.TestLessInputStreamBuilder.CachableCommandsEvent is persisted.private classTestLessInputStream.TestLessInputStreamBuilder.CItprivate classTestLessInputStream.TestLessInputStreamBuilder.ImmediateCommandsEvent is called just now for all alive streams and command is not persisted.private static classTestLessInputStream.TestLessInputStreamBuilder.Node
-
Field Summary
Fields Modifier and Type Field Description private java.util.Queue<TestLessInputStream>aliveStreamsprivate TestLessInputStream.TestLessInputStreamBuilder.CachableCommandscachableCommandsprivate TestLessInputStream.TestLessInputStreamBuilder.Nodeheadprivate TestLessInputStream.TestLessInputStreamBuilder.ImmediateCommandsimmediateCommandsprivate java.lang.Iterable<Command>iterableCachableprivate java.util.concurrent.locks.ReentrantReadWriteLockrwLock
-
Constructor Summary
Constructors Constructor Description TestLessInputStreamBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private booleanaddTailNodeIfAbsent(Command command)TestLessInputStreambuild()NotifiableTestStreamgetCachableCommands()Cached commands are sent to all alive or future alive forks.NotifiableTestStreamgetImmediateCommands()OnlyNotifiableTestStream.noop()andNotifiableTestStream.shutdown(Shutdown)are supported.(package private) java.lang.Iterable<Command>getIterableCachable()The iterator is not thread safe.private static TestLessInputStream.TestLessInputStreamBuilder.NodenextCachedNode(TestLessInputStream.TestLessInputStreamBuilder.Node current)voidremoveStream(TestLessInputStream is)
-
-
-
Field Detail
-
rwLock
private final java.util.concurrent.locks.ReentrantReadWriteLock rwLock
-
aliveStreams
private final java.util.Queue<TestLessInputStream> aliveStreams
-
immediateCommands
private final TestLessInputStream.TestLessInputStreamBuilder.ImmediateCommands immediateCommands
-
cachableCommands
private final TestLessInputStream.TestLessInputStreamBuilder.CachableCommands cachableCommands
-
head
private final TestLessInputStream.TestLessInputStreamBuilder.Node head
-
iterableCachable
private final java.lang.Iterable<Command> iterableCachable
-
-
Method Detail
-
build
public TestLessInputStream build()
-
removeStream
public void removeStream(TestLessInputStream is)
-
getImmediateCommands
public NotifiableTestStream getImmediateCommands()
OnlyNotifiableTestStream.noop()andNotifiableTestStream.shutdown(Shutdown)are supported. Another methods throwUnsupportedOperationException.- Returns:
- commands which are immediately transmitted once to all alive forked JVMs, not cached. As opposite to cached commands, the immediate commands disappear and cannot be seen by any fork initiated after the command has dispatched.
-
getCachableCommands
public NotifiableTestStream getCachableCommands()
Cached commands are sent to all alive or future alive forks. These are termination commands which are not reversible and therefore onlyNotifiableTestStream.shutdown(Shutdown)andNotifiableTestStream.skipSinceNextTest()are supported. Another methods throwUnsupportedOperationException.- Returns:
- commands which are cached for currently alive or future forks.
-
getIterableCachable
java.lang.Iterable<Command> getIterableCachable()
The iterator is not thread safe.
-
addTailNodeIfAbsent
private boolean addTailNodeIfAbsent(Command command)
-
nextCachedNode
private static TestLessInputStream.TestLessInputStreamBuilder.Node nextCachedNode(TestLessInputStream.TestLessInputStreamBuilder.Node current)
-
-