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 TypeMethodDescriptionvoid
bindCommandReader
(CommandReader commands, WritableByteChannel stdIn) Binds command handler to the channel.void
bindEventHandler
(EventHandler<Event> eventHandler, CountdownCloseable countdownCloseable, ReadableByteChannel stdOut) Starts a Thread reading the events.void
close()
void
disable()
int
the permits inCountdownCloseable
.This is server related class, which if binds to a TCP port, determines the connection string for the client.void
Asynchronously 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:ForkChannel
Asynchronously connects to the client.- Specified by:
tryConnectToClient
in classForkChannel
-
getForkNodeConnectionString
Description copied from class:ForkChannel
This is server related class, which if binds to a TCP port, determines the connection string for the client.- Specified by:
getForkNodeConnectionString
in classForkChannel
- Returns:
- a connection string utilized by the client in the fork JVM
-
getCountdownCloseablePermits
public int getCountdownCloseablePermits()Description copied from class:ForkChannel
the permits inCountdownCloseable
.- Specified by:
getCountdownCloseablePermits
in classForkChannel
-
bindCommandReader
Description copied from class:ForkChannel
Binds command handler to the channel. Starts a Thread streaming out the commands.- Specified by:
bindCommandReader
in 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:ForkChannel
Starts a Thread reading the events.- Specified by:
bindEventHandler
in 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:
disable
in classForkChannel
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classForkChannel
-