Class LegacyForkChannel
- java.lang.Object
-
- org.apache.maven.surefire.extensions.ForkChannel
-
- org.apache.maven.plugin.surefire.extensions.LegacyForkChannel
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
final class LegacyForkChannel extends ForkChannel
The main purpose of this class is to bind thecommand readerreading the commands fromCommandReader, serializing them and writing the stream to thesub-process. It binds theevent handlerdeserializing a received event and sends the event object to theevent handler.
-
-
Field Summary
Fields Modifier and Type Field Description private CloseableDaemonThreadcommandReaderBindingsprivate CloseableDaemonThreadeventHandlerBindings
-
Constructor Summary
Constructors Constructor Description LegacyForkChannel(ForkNodeArguments arguments)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbindCommandReader(CommandReader commands, java.nio.channels.WritableByteChannel stdIn)Binds command handler to the channel.voidbindEventHandler(EventHandler<Event> eventHandler, CountdownCloseable countdownCloseable, java.nio.channels.ReadableByteChannel stdOut)Starts a Thread reading the events.voidclose()voiddisable()intgetCountdownCloseablePermits()the permits inCountdownCloseable.java.lang.StringgetForkNodeConnectionString()This is server related class, which if binds to a TCP port, determines the connection string for the client.voidtryConnectToClient()Asynchronously connects to the client.-
Methods inherited from class org.apache.maven.surefire.extensions.ForkChannel
getArguments
-
-
-
-
Field Detail
-
commandReaderBindings
private CloseableDaemonThread commandReaderBindings
-
eventHandlerBindings
private CloseableDaemonThread eventHandlerBindings
-
-
Constructor Detail
-
LegacyForkChannel
LegacyForkChannel(@Nonnull ForkNodeArguments arguments)
-
-
Method Detail
-
tryConnectToClient
public void tryConnectToClient()
Description copied from class:ForkChannelAsynchronously connects to the client.- Specified by:
tryConnectToClientin classForkChannel
-
getForkNodeConnectionString
public java.lang.String 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
public void bindCommandReader(@Nonnull CommandReader commands, java.nio.channels.WritableByteChannel stdIn)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, java.nio.channels.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 interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein classForkChannel
-
-