Class DelegateConnection

  • All Implemented Interfaces:
    AutoCloseable, org.aesh.terminal.Connection

    public class DelegateConnection
    extends Object
    implements org.aesh.terminal.Connection
    Fake connection that can be used to stop a running aesh instance If you create a console with one of these and then close it Aesh will assume the program is done and exit
    • Field Detail

      • closed

        volatile boolean closed
    • Constructor Detail

      • DelegateConnection

        public DelegateConnection​(org.aesh.terminal.Connection delegate)
    • Method Detail

      • device

        public org.aesh.terminal.Device device()
        Specified by:
        device in interface org.aesh.terminal.Connection
      • size

        public org.aesh.terminal.tty.Size size()
        Specified by:
        size in interface org.aesh.terminal.Connection
      • getSizeHandler

        public Consumer<org.aesh.terminal.tty.Size> getSizeHandler()
        Specified by:
        getSizeHandler in interface org.aesh.terminal.Connection
      • setSizeHandler

        public void setSizeHandler​(Consumer<org.aesh.terminal.tty.Size> consumer)
        Specified by:
        setSizeHandler in interface org.aesh.terminal.Connection
      • getSignalHandler

        public Consumer<org.aesh.terminal.tty.Signal> getSignalHandler()
        Specified by:
        getSignalHandler in interface org.aesh.terminal.Connection
      • setSignalHandler

        public void setSignalHandler​(Consumer<org.aesh.terminal.tty.Signal> consumer)
        Specified by:
        setSignalHandler in interface org.aesh.terminal.Connection
      • getStdinHandler

        public Consumer<int[]> getStdinHandler()
        Specified by:
        getStdinHandler in interface org.aesh.terminal.Connection
      • setStdinHandler

        public void setStdinHandler​(Consumer<int[]> consumer)
        Specified by:
        setStdinHandler in interface org.aesh.terminal.Connection
      • stdoutHandler

        public Consumer<int[]> stdoutHandler()
        Specified by:
        stdoutHandler in interface org.aesh.terminal.Connection
      • setCloseHandler

        public void setCloseHandler​(Consumer<Void> consumer)
        Specified by:
        setCloseHandler in interface org.aesh.terminal.Connection
      • getCloseHandler

        public Consumer<Void> getCloseHandler()
        Specified by:
        getCloseHandler in interface org.aesh.terminal.Connection
      • close

        public void close()
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface org.aesh.terminal.Connection
      • openBlocking

        public void openBlocking()
        Specified by:
        openBlocking in interface org.aesh.terminal.Connection
      • openNonBlocking

        public void openNonBlocking()
        Specified by:
        openNonBlocking in interface org.aesh.terminal.Connection
      • put

        public boolean put​(org.aesh.terminal.tty.Capability capability,
                           Object... objects)
        Specified by:
        put in interface org.aesh.terminal.Connection
      • getAttributes

        public org.aesh.terminal.Attributes getAttributes()
        Specified by:
        getAttributes in interface org.aesh.terminal.Connection
      • setAttributes

        public void setAttributes​(org.aesh.terminal.Attributes attributes)
        Specified by:
        setAttributes in interface org.aesh.terminal.Connection
      • inputEncoding

        public Charset inputEncoding()
        Specified by:
        inputEncoding in interface org.aesh.terminal.Connection
      • outputEncoding

        public Charset outputEncoding()
        Specified by:
        outputEncoding in interface org.aesh.terminal.Connection
      • supportsAnsi

        public boolean supportsAnsi()
        Specified by:
        supportsAnsi in interface org.aesh.terminal.Connection
      • close

        public void close​(int exit)
        Specified by:
        close in interface org.aesh.terminal.Connection
      • write

        public org.aesh.terminal.Connection write​(String s)
        Specified by:
        write in interface org.aesh.terminal.Connection
      • enterRawMode

        public org.aesh.terminal.Attributes enterRawMode()
        Specified by:
        enterRawMode in interface org.aesh.terminal.Connection
      • getCursorPosition

        public org.aesh.terminal.tty.Point getCursorPosition()
        Specified by:
        getCursorPosition in interface org.aesh.terminal.Connection