Interface Connection
- All Superinterfaces:
AutoCloseable
Represent a connection to either a local/direct/remote Terminal.
- Author:
- invalid input: '<'a href=mailto:stale.pedersen@jboss.org">Ståle W. Pedersen
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Stop reading from the input stream.default voidclose(int exit) device()default Attributesdefault PointGet SignalHandler.Consumer<int[]> voidStart reading from the input stream using the current thread.voidStart reading from the input stream in a separate thread.booleanput(Capability capability, Object... params) Specify terminal settingsvoidsetAttributes(Attributes attr) voidsetCloseHandler(Consumer<Void> closeHandler) Specify handler that's called when the input stream is closed.voidsetSignalHandler(Consumer<Signal> handler) Specify the signal handler.voidsetSizeHandler(Consumer<Size> handler) Specify size handler that's called when the terminal changes size.voidsetStdinHandler(Consumer<int[]> handler) size()Consumer<int[]> Handler that's called for all outputbooleandefault ConnectionWrite a string to the output handler
-
Method Details
-
device
Device device()- Returns:
- type of terminal
-
size
Size size()- Returns:
- terminal size
-
getSizeHandler
-
setSizeHandler
-
getSignalHandler
-
setSignalHandler
-
getStdinHandler
Consumer<int[]> getStdinHandler() -
setStdinHandler
-
stdoutHandler
-
setCloseHandler
-
getCloseHandler
-
close
void close()Stop reading from the input stream. The stream will be closed and cleanup methods will be called Eg for terminals they will be restored to their original settings. Note that if the reader thread is blocking waiting for data it will wait until either killed or if the input stream is closed.- Specified by:
closein interfaceAutoCloseable
-
close
default void close(int exit) -
openBlocking
void openBlocking()Start reading from the input stream using the current thread. The current thread will be blocked while reading/waiting to read from the stream -
openNonBlocking
void openNonBlocking()Start reading from the input stream in a separate thread. The current thread will continue. -
put
Specify terminal settings- Parameters:
capability- capabilityparams- parameters- Returns:
- true if the terminal accepted the settings
-
getAttributes
Attributes getAttributes() -
setAttributes
-
inputEncoding
Charset inputEncoding() -
outputEncoding
Charset outputEncoding() -
supportsAnsi
boolean supportsAnsi() -
write
Write a string to the output handler- Parameters:
s- string- Returns:
- this connection
-
enterRawMode
-
getCursorPosition
-