Package org.aesh.terminal.tty.impl
Class ExternalTerminal
java.lang.Object
org.aesh.terminal.tty.impl.AbstractTerminal
org.aesh.terminal.tty.impl.LineDisciplineTerminal
org.aesh.terminal.tty.impl.ExternalTerminal
- All Implemented Interfaces:
Closeable,AutoCloseable,Terminal
- Direct Known Subclasses:
WinExternalTerminal
Console implementation with embedded line disciplined.
This console is well-suited for supporting incoming external
connections, such as from the network (through telnet, ssh,
or any kind of protocol).
The console will start consuming the input in a separate thread
to generate interruption events.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.aesh.terminal.Terminal
Terminal.SignalHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final InputStreamThe master input stream for reading data from the external source.Fields inherited from class org.aesh.terminal.tty.impl.LineDisciplineTerminal
attributes, masterOutput, size, slaveInput, slaveInputPipe, slaveOutput -
Constructor Summary
ConstructorsConstructorDescriptionExternalTerminal(String name, String type, InputStream masterInput, OutputStream masterOutput) Constructs an ExternalTerminal with the specified parameters. -
Method Summary
Methods inherited from class org.aesh.terminal.tty.impl.LineDisciplineTerminal
closeSlaveInputPipe, getAttributes, getSize, input, output, processInputByte, processInputBytes, processInputBytes, processInputBytes, processOutputByte, raise, setAttributesMethods inherited from class org.aesh.terminal.tty.impl.AbstractTerminal
device, echo, echo, echoSignal, getName, getType, handle, handleDefaultSignalMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.aesh.terminal.Terminal
getCodePointConsumer
-
Field Details
-
masterInput
The master input stream for reading data from the external source.
-
-
Constructor Details
-
ExternalTerminal
public ExternalTerminal(String name, String type, InputStream masterInput, OutputStream masterOutput) throws IOException Constructs an ExternalTerminal with the specified parameters.- Parameters:
name- the terminal nametype- the terminal typemasterInput- the master input stream for reading external datamasterOutput- the master output stream for writing data- Throws:
IOException- if an I/O error occurs during initialization
-
-
Method Details
-
close
Closes this terminal and releases any associated resources.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classLineDisciplineTerminal- Throws:
IOException- if an I/O error occurs
-
pump
public void pump()Pumps data from the master input stream to the terminal. This method runs in a separate thread and continuously reads from the master input, processing the bytes through the line discipline.
-