public abstract class ForkChannel extends Object implements Closeable
tryConnectToClient(), provides a connection string
getForkNodeConnectionString() needed by the client in forked JVM, binds event handler and command reader.
This object is called in one Thread.| Modifier | Constructor and Description |
|---|---|
protected |
ForkChannel(ForkNodeArguments arguments) |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
bindCommandReader(CommandReader commands,
WritableByteChannel stdIn)
Binds command handler to the channel.
|
abstract void |
bindEventHandler(EventHandler<Event> eventHandler,
CountdownCloseable countdownCloseable,
ReadableByteChannel stdOut)
Starts a Thread reading the events.
|
abstract void |
close() |
abstract void |
disable() |
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.
|
abstract void |
tryConnectToClient()
Asynchronously connects to the client.
|
protected ForkChannel(@Nonnull ForkNodeArguments arguments)
arguments - data necessary for command reader and event handler.public abstract void tryConnectToClient()
throws IOException,
InterruptedException
IOException - if stream failsInterruptedException - if interrupted threadpublic abstract String getForkNodeConnectionString()
public abstract int getCountdownCloseablePermits()
CountdownCloseable.public abstract void bindCommandReader(@Nonnull CommandReader commands, WritableByteChannel stdIn) throws IOException, InterruptedException
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 channelInterruptedException - channel interruptedpublic abstract void bindEventHandler(@Nonnull EventHandler<Event> eventHandler, @Nonnull CountdownCloseable countdownCloseable, ReadableByteChannel stdOut) throws IOException, InterruptedException
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 channelInterruptedException - channel interrupted@Nonnull protected ForkNodeArguments getArguments()
public abstract void disable()
public abstract void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2004–2024 The Apache Software Foundation. All rights reserved.