Class ExternalTerminal

All Implemented Interfaces:
Closeable, AutoCloseable, Terminal
Direct Known Subclasses:
WinExternalTerminal

public class ExternalTerminal extends LineDisciplineTerminal
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:
  • Field Details

    • masterInput

      protected final InputStream 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 name
      type - the terminal type
      masterInput - the master input stream for reading external data
      masterOutput - the master output stream for writing data
      Throws:
      IOException - if an I/O error occurs during initialization
  • Method Details

    • close

      public void close() throws IOException
      Closes this terminal and releases any associated resources.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class LineDisciplineTerminal
      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.