Class JythonShell

java.lang.Object
gda.jython.server.shell.JythonShell
All Implemented Interfaces:
IScanDataPointObserver, Terminal, gda.observable.IObserver, Closeable, AutoCloseable

public class JythonShell extends Object implements Closeable, Terminal, IScanDataPointObserver
JythonShell provides the REPL for interacting with the GDA server. It offers code completion and persistent history.

It has no knowledge of the connection type

  • Field Details

    • SSH_STARTUP_OUTPUT_PROPERTY

      public static final String SSH_STARTUP_OUTPUT_PROPERTY
      Whether to show the startupOutput when a user first opens the shell
      See Also:
  • Constructor Details

  • Method Details

    • run

      public void run()
      Run the actual REPL. Blocks while running and only returns when EOFException is reached
    • close

      public void close()
      Unsubscribe this shell from receiving IScanDataPoint and terminal output.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • update

      public void update(Object source, Object arg)
      Handle updates from JythonServerFacade. Most likely IScanDataPoints
      Specified by:
      update in interface gda.observable.IObserver
    • write

      public void write(String output)
      Write to the terminal

      If this instance is in the process of reading a new line when the output is being printed, clear the prompt line first, then print the output, then restore the prompt. This prevents half completed commands being disrupted by output from other terminals.

      Specified by:
      write in interface Terminal
      Parameters:
      output -
    • writeInput

      public void writeInput(TerminalInput input)
      Specified by:
      writeInput in interface Terminal
    • toString

      public String toString()
      Overrides:
      toString in class Object