Class LegacyForkChannel

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    final class LegacyForkChannel
    extends ForkChannel
    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.
    • Constructor Detail

    • Method Detail

      • getForkNodeConnectionString

        public java.lang.String 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 class ForkChannel
        Returns:
        a connection string utilized by the client in the fork JVM
      • bindCommandReader

        public void bindCommandReader​(@Nonnull
                                      CommandReader commands,
                                      java.nio.channels.WritableByteChannel stdIn)
        Description copied from class: ForkChannel
        Binds command handler to the channel. Starts a Thread streaming out the commands.
        Specified by:
        bindCommandReader in class ForkChannel
        Parameters:
        commands - command reader, see CommandReader.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: ForkChannel
        Starts a Thread reading the events.
        Specified by:
        bindEventHandler in class ForkChannel
        Parameters:
        eventHandler - event eventHandler
        countdownCloseable - count down of the final call of Closeable.close()
        stdOut - optional standard output stream of the JVM
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in class ForkChannel