Class LegacyForkChannel
java.lang.Object
org.apache.maven.surefire.extensions.ForkChannel
org.apache.maven.plugin.surefire.extensions.LegacyForkChannel
- All Implemented Interfaces:
Closeable,AutoCloseable
The main purpose of this class is to bind the
command reader reading the commands from
CommandReader, serializing them and writing the stream to the
sub-process. It binds the
event handler deserializing
a received event and sends the event object to the event handler.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbindCommandReader(CommandReader commands, WritableByteChannel stdIn) Binds command handler to the channel.voidbindEventHandler(EventHandler<Event> eventHandler, CountdownCloseable countdownCloseable, ReadableByteChannel stdOut) Starts a Thread reading the events.voidclose()voiddisable()intthe permits inCountdownCloseable.This is server related class, which if binds to a TCP port, determines the connection string for the client.voidAsynchronously connects to the client.Methods inherited from class org.apache.maven.surefire.extensions.ForkChannel
getArguments
-
Field Details
-
commandReaderBindings
-
eventHandlerBindings
-
-
Constructor Details
-
LegacyForkChannel
LegacyForkChannel(@Nonnull ForkNodeArguments arguments)
-
-
Method Details
-
tryConnectToClient
public void tryConnectToClient()Description copied from class:ForkChannelAsynchronously connects to the client.- Specified by:
tryConnectToClientin classForkChannel
-
getForkNodeConnectionString
Description copied from class:ForkChannelThis is server related class, which if binds to a TCP port, determines the connection string for the client.- Specified by:
getForkNodeConnectionStringin classForkChannel- Returns:
- a connection string utilized by the client in the fork JVM
-
getCountdownCloseablePermits
public int getCountdownCloseablePermits()Description copied from class:ForkChannelthe permits inCountdownCloseable.- Specified by:
getCountdownCloseablePermitsin classForkChannel
-
bindCommandReader
Description copied from class:ForkChannelBinds command handler to the channel. Starts a Thread streaming out the commands.- Specified by:
bindCommandReaderin classForkChannel- Parameters:
commands- command reader, seeCommandReader.readNextCommand()stdIn- optional standard input stream of the JVM to write the encoded commands into it
-
bindEventHandler
public void bindEventHandler(@Nonnull EventHandler<Event> eventHandler, @Nonnull CountdownCloseable countdownCloseable, ReadableByteChannel stdOut) Description copied from class:ForkChannelStarts a Thread reading the events.- Specified by:
bindEventHandlerin classForkChannel- Parameters:
eventHandler- event eventHandlercountdownCloseable- count down of the final call ofCloseable.close()stdOut- optional standard output stream of the JVM
-
disable
public void disable()- Specified by:
disablein classForkChannel
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classForkChannel
-