public abstract class ForkChannel extends Object implements Closeable
connectToClient()
, provides a connection string
getForkNodeConnectionString()
needed by the client in the JVM, binds event handler and command reader.Modifier | Constructor and Description |
---|---|
protected |
ForkChannel(ForkNodeArguments arguments) |
Modifier and Type | Method and Description |
---|---|
abstract CloseableDaemonThread |
bindCommandReader(CommandReader commands,
WritableByteChannel stdIn)
Binds command handler to the channel.
|
abstract CloseableDaemonThread |
bindEventHandler(EventHandler<Event> eventHandler,
CountdownCloseable countdownCloseable,
ReadableByteChannel stdOut) |
abstract void |
connectToClient() |
protected ForkNodeArguments |
getArguments() |
abstract int |
getCountdownCloseablePermits()
the permits in
CountdownCloseable . |
abstract String |
getForkNodeConnectionString()
This is server related class, which if binds to a TCP port, determines the connection string for the client.
|
protected ForkChannel(@Nonnull ForkNodeArguments arguments)
arguments
- data necessary for command reader and event handler.public abstract void connectToClient() throws IOException
IOException
public abstract String getForkNodeConnectionString()
public abstract int getCountdownCloseablePermits()
CountdownCloseable
.public abstract CloseableDaemonThread bindCommandReader(@Nonnull CommandReader commands, WritableByteChannel stdIn) throws IOException
commands
- command reader, see CommandReader.readNextCommand()
stdIn
- optional standard input stream of the JVM to write the encoded commands into itIOException
- if an error in the fork channelpublic abstract CloseableDaemonThread bindEventHandler(@Nonnull EventHandler<Event> eventHandler, @Nonnull CountdownCloseable countdownCloseable, ReadableByteChannel stdOut) throws IOException
eventHandler
- event eventHandlercountdownCloseable
- count down of the final call of Closeable.close()
stdOut
- optional standard output stream of the JVMIOException
- if an error in the fork channel@Nonnull protected ForkNodeArguments getArguments()
Copyright © 2004–2020 The Apache Software Foundation. All rights reserved.