APIdia Launch Partner
Top Description Fields Constructors Methods
jdk.internal.org.jline.terminal.impl

public Class ExternalTerminal

extends LineDisciplineTerminal
Class Inheritance
Imports
java.io.IOException, .InputStream, .OutputStream, java.nio.charset.Charset, java.util.concurrent.atomic.AtomicBoolean, java.util.function.IntConsumer, jdk.internal.org.jline.terminal.Attributes, .Cursor, .Size, jdk.internal.org.jline.terminal.spi.TerminalProvider

Console implementation with embedded line disciplined. This terminal is well-suited for supporting incoming external connections, such as from the network (through telnet, ssh, or any kind of protocol). The terminal will start consuming the input in a separate thread to generate interruption events.
See Also
LineDisciplineTerminal

Field Summary

Modifier and TypeField and Description
protected final AtomicBoolean
protected final Object
protected final InputStream
protected boolean
private final TerminalProvider
protected Thread
Inherited from jdk.internal.org.jline.terminal.impl.LineDisciplineTerminal:
attributesmasterOutputsizeskipNextLfslaveInputslaveInputPipeslaveOutputslaveReaderslaveWriter

Constructor Summary

AccessConstructor and Description
public
ExternalTerminal(String name, String type, InputStream masterInput, OutputStream masterOutput, Charset encoding)

public
ExternalTerminal(TerminalProvider provider, String name, String type, InputStream masterInput, OutputStream masterOutput, Charset encoding, Terminal.SignalHandler signalHandler)

public
ExternalTerminal(TerminalProvider provider, String name, String type, InputStream masterInput, OutputStream masterOutput, Charset encoding, Terminal.SignalHandler signalHandler, boolean paused)

public
ExternalTerminal(TerminalProvider provider, String name, String type, InputStream masterInput, OutputStream masterOutput, Charset encoding, Terminal.SignalHandler signalHandler, boolean paused, Attributes attributes, Size size)

Method Summary

Modifier and TypeMethod and Description
public boolean
protected void
public Cursor
public TerminalProvider
getProvider()

Overrides jdk.internal.org.jline.terminal.impl.LineDisciplineTerminal.getProvider.

Implements jdk.internal.org.jline.terminal.spi.TerminalExt.getProvider.

Returns the TerminalProvider that created this terminal or null if the terminal was created with no provider.

public void
public void
pause(boolean wait)

Overrides jdk.internal.org.jline.terminal.impl.AbstractTerminal.pause.

Implements jdk.internal.org.jline.terminal.Terminal.pause.

Stop reading the input stream and optionally wait for the underlying threads to finish.

public boolean
paused()

Overrides jdk.internal.org.jline.terminal.impl.AbstractTerminal.paused.

Implements jdk.internal.org.jline.terminal.Terminal.paused.

Check whether the terminal is currently reading the input stream or not.

public void
pump()

public void
Inherited from jdk.internal.org.jline.terminal.impl.LineDisciplineTerminal:
doProcessInputBytegetAttributesgetSizegetSystemStreaminputoutputprocessInputByteprocessInputBytesprocessInputBytesprocessIOExceptionprocessOutputByteraisereadersetAttributessetSizewriter

Field Detail

closedback to summary
protected final AtomicBoolean closed
lockback to summary
protected final Object lock
masterInputback to summary
protected final InputStream masterInput
pausedback to summary
protected boolean paused
providerback to summary
private final TerminalProvider provider
pumpThreadback to summary
protected Thread pumpThread

Constructor Detail

ExternalTerminalback to summary
public ExternalTerminal(String name, String type, InputStream masterInput, OutputStream masterOutput, Charset encoding) throws IOException
ExternalTerminalback to summary
public ExternalTerminal(TerminalProvider provider, String name, String type, InputStream masterInput, OutputStream masterOutput, Charset encoding, Terminal.SignalHandler signalHandler) throws IOException
ExternalTerminalback to summary
public ExternalTerminal(TerminalProvider provider, String name, String type, InputStream masterInput, OutputStream masterOutput, Charset encoding, Terminal.SignalHandler signalHandler, boolean paused) throws IOException
ExternalTerminalback to summary
public ExternalTerminal(TerminalProvider provider, String name, String type, InputStream masterInput, OutputStream masterOutput, Charset encoding, Terminal.SignalHandler signalHandler, boolean paused, Attributes attributes, Size size) throws IOException
Annotations
@SuppressWarnings:this-escape

Method Detail

canPauseResumeback to summary
public boolean canPauseResume()

Overrides jdk.internal.org.jline.terminal.impl.AbstractTerminal.canPauseResume.

Implements jdk.internal.org.jline.terminal.Terminal.canPauseResume.

Doc from jdk.internal.org.jline.terminal.Terminal.canPauseResume.

Whether this terminal supports pause() and resume() calls.

Annotations
@Override
doCloseback to summary
protected void doClose() throws IOException

Overrides jdk.internal.org.jline.terminal.impl.LineDisciplineTerminal.doClose.

getCursorPositionback to summary
public Cursor getCursorPosition(IntConsumer discarded)

Overrides jdk.internal.org.jline.terminal.impl.AbstractTerminal.getCursorPosition.

Implements jdk.internal.org.jline.terminal.Terminal.getCursorPosition.

Doc from jdk.internal.org.jline.terminal.Terminal.getCursorPosition.

Query the terminal to report the cursor position. As the response is read from the input stream, some characters may be read before the cursor position is actually read. Those characters can be given back using org.jline.keymap.BindingReader#runMacro(String)

Annotations
@Override
getProviderback to summary
public TerminalProvider getProvider()

Overrides jdk.internal.org.jline.terminal.impl.LineDisciplineTerminal.getProvider.

Implements jdk.internal.org.jline.terminal.spi.TerminalExt.getProvider.

Doc from jdk.internal.org.jline.terminal.spi.TerminalExt.getProvider.

Returns the TerminalProvider that created this terminal or null if the terminal was created with no provider.

Annotations
@Override
pauseback to summary
public void pause()

Overrides jdk.internal.org.jline.terminal.impl.AbstractTerminal.pause.

Implements jdk.internal.org.jline.terminal.Terminal.pause.

Doc from jdk.internal.org.jline.terminal.Terminal.pause.

Stop reading the input stream.

Annotations
@Override
pauseback to summary
public void pause(boolean wait) throws InterruptedException

Overrides jdk.internal.org.jline.terminal.impl.AbstractTerminal.pause.

Implements jdk.internal.org.jline.terminal.Terminal.pause.

Doc from jdk.internal.org.jline.terminal.Terminal.pause.

Stop reading the input stream and optionally wait for the underlying threads to finish.

Annotations
@Override
Exceptions
InterruptedException:
if the call has been interrupted
pausedback to summary
public boolean paused()

Overrides jdk.internal.org.jline.terminal.impl.AbstractTerminal.paused.

Implements jdk.internal.org.jline.terminal.Terminal.paused.

Doc from jdk.internal.org.jline.terminal.Terminal.paused.

Check whether the terminal is currently reading the input stream or not. In order to process signal as quickly as possible, the terminal need to read the input stream and buffer it internally so that it can detect specific characters in the input stream (Ctrl+C, Ctrl+D, etc...) and raise the appropriate signals. However, there are some cases where this processing should be disabled, for example when handing the terminal control to a subprocess.

Annotations
@Override
pumpback to summary
public void pump()
resumeback to summary
public void resume()

Overrides jdk.internal.org.jline.terminal.impl.AbstractTerminal.resume.

Implements jdk.internal.org.jline.terminal.Terminal.resume.

Doc from jdk.internal.org.jline.terminal.Terminal.resume.

Resume reading the input stream.

Annotations
@Override