Package gda.jython

Class JythonServer

java.lang.Object
gda.jython.JythonServer
All Implemented Interfaces:
ConfigurableAware, Findable, TextCompleter, ICurrentScanInformationHolder, IDefaultScannableProvider, IJythonServerNotifer, IJythonServerStatusProvider, ITerminalInputProvider, Jython, LocalJython, gda.observable.IObservable

This controls the information given to the Jython engine (GDAJythonInterpreter). This implements the Jython interface, so is distributed, but classes outside this package should not communicate with this class directly. Instead they should talk to the Jython Server (Command Server) via the JythonServerFacade class. The exception to this rule is scan objects, which require information via methods which are not distributed and are shared via the ICurrentScanHolder, IJythonServerNotifer, and IDefaultScannableProvider interfaces.
  • Field Details

  • Constructor Details

    • JythonServer

      public JythonServer()
  • Method Details

    • getJythonScriptPaths

      public ScriptPaths getJythonScriptPaths()
      Get the jython script folder object.
      Returns:
      This object's jython script path finder.
    • setJythonScriptPaths

      public void setJythonScriptPaths(ScriptPaths jythonScriptPaths)
      Set this object's jython script folder list.
      Parameters:
      jythonScriptPaths - A jython script finder instance.
    • removeDefault

      public boolean removeDefault(Scannable scannable)
      Remove the scannable from the list of defaults
      Parameters:
      scannable -
    • addDefault

      public boolean addDefault(Scannable scannable)
      Add a scannable to the list of defaults
      Parameters:
      scannable -
    • clearDefaults

      public void clearDefaults()
    • getName

      public String getName()
      Description copied from interface: Findable
      Get the object name. Used by Castor to check if the object name has been set before calling the Findable.setName(String) method.
      Specified by:
      getName in interface Findable
      Returns:
      a String containing the object name.
    • setName

      public void setName(String name)
      Description copied from interface: Findable
      Set or change the name of the object (as defined in XML).
      Specified by:
      setName in interface Findable
      Parameters:
      name - the object name
    • setMessageHandler

      public void setMessageHandler(gda.messages.MessageHandler messageHandler)
    • preConfigure

      public void preConfigure() throws FactoryException
      Description copied from interface: ConfigurableAware
      Called before the configuration process starts when no beans have been configured.

      Order in which implementations of this method are called is undetermined.

      Specified by:
      preConfigure in interface ConfigurableAware
      Throws:
      FactoryException - if thrown, considered a fatal configuration exception
    • postConfigure

      public void postConfigure()
      Description copied from interface: ConfigurableAware
      Called after the configuration process is complete.

      When this is called, all beans are guaranteed to have been configured although the order in which implementations of this method are called is undetermined

      Specified by:
      postConfigure in interface ConfigurableAware
    • runCommandSynchronously

      public void runCommandSynchronously(String scriptFullPath) throws Exception
      Runs a command in the same thread and only returns when the command completed. This method is not distributed and is only for use by the "run" command which runs scripts from within other scripts or from the GDA terminal. It assumes that the contents of this file have not been translated yet.
      Parameters:
      scriptFullPath -
      Throws:
      Exception
    • runCommand

      public void runCommand(String command, String jsfIdentifier)
      Description copied from interface: Jython
      Executes the Jython command in a new thread.

      Non-blocking, Interruptible, Not script locked.
      See ICommandRunner for the other options.
      Specified by:
      runCommand in interface Jython
      Parameters:
      command - to run
      jsfIdentifier - - the unique ID of the JythonServerFacade calling this method
    • executeCommand

      public void executeCommand(String command, String jsfIdentifier) throws ScriptExecutionException
      Description copied from interface: Jython
      Executes the Jython command in a new thread

      Blocking, Interruptible, Not script locked.
      See ICommandRunner for the other options.
      Specified by:
      executeCommand in interface Jython
      Parameters:
      command - to run
      jsfIdentifier -
      Throws:
      ScriptExecutionException - if there is an exception in the script
    • executeCommand

      public void executeCommand(String command, String jsfIdentifier, InputStream stdin) throws ScriptExecutionException
      Description copied from interface: Jython
      Executes the Jython command in a new thread with the provided stdin input stream.

      Blocking, Interruptible, Not script locked.
      See ICommandRunner for the other options.
      See Jython.executeCommand(String, String) for alternative using the RCP input stream
      Specified by:
      executeCommand in interface Jython
      Parameters:
      command - to run
      jsfIdentifier -
      stdin - an InputStream to use as the source of user input
      Throws:
      ScriptExecutionException - if there is an exception in the script
    • runScript

      public CommandThreadEvent runScript(String command, String scriptName, String jsfIdentifier)
      Description copied from interface: Jython
      Runs the Jython script, and changes the ScriptStatus as is goes.

      Non-blocking, Interruptible, Script locked.
      See ICommandRunner for the other options.
      Specified by:
      runScript in interface Jython
      Parameters:
      command - to run
      scriptName - used to acquire a lock
      jsfIdentifier - - the unique ID of the JythonServerFacade calling this method
      Returns:
      status
    • evaluateCommand

      public String evaluateCommand(String command, String jsfIdentifier)
      Description copied from interface: Jython
      Runs a single line Jython command through the interpreter and returns the result in the form of a string. Note: this method waits until the command has finished so it can return the result. If the command takes a long time it will hang the thread which calls this method. So this method must be called in a separate thread from the main GUI thread, else the GUI will seize up until the command given to this method has returned. For an example of the, see the gda.jython.JythonTerminal class.

      Blocking, Not interruptible, Not script locked.
      See ICommandRunner for the other options.
      Specified by:
      evaluateCommand in interface Jython
      Parameters:
      command - command to run
      jsfIdentifier - - the unique ID of the JythonServerFacade calling this method
      Returns:
      the string representation of the result
    • runsource

      public boolean runsource(String command, String jsfIdentifier)
      Description copied from interface: Jython
      Similar to Jython.runCommand(java.lang.String, java.lang.String), except that a boolean is returned if the command was complete or if additional lines of a multi-line command are required. Used only by the JythonTerminal to determine which prompt to display. Note: this method waits until the command has finished so it can return the result. If the command takes a long time it will hang the thread which calls this method. So this method must be called in a separate thread from the main GUI thread, else the GUI will seize up until the command given to this method has returned.

      Blocking, Interruptible, Not script locked.
      See ICommandRunner for the other options.
      Specified by:
      runsource in interface Jython
      Parameters:
      command - to run
      jsfIdentifier - the unique ID of the JythonServerFacade calling this method
      Returns:
      true if command was incomplete and more is required (eg "if True:"), false otherwise (including on error)
      See Also:
    • runsource

      public boolean runsource(String command, String jsfIdentifier, InputStream stdin)
      Description copied from interface: Jython
      Similar to Jython.runsource(java.lang.String, java.lang.String) but allows a specific InputStream to be used.

      Blocking, Interruptible, Not script locked.
      See ICommandRunner for the other options.
      Specified by:
      runsource in interface Jython
      Parameters:
      command - to run
      jsfIdentifier - - the unique ID of the JythonServerFacade calling this method
      stdin - input stream to use as stdin for this command
      Returns:
      true if command was incomplete and more is required (eg "if True:"), false otherwise (including on error)
      See Also:
    • runAsJython

      public Thread runAsJython(Runnable task, String jsfIdentifier)
      Description copied from interface: LocalJython
      Run the given task in a Jython thread - allows it to be linked to a specific client and be restricted by its authorization level
      Specified by:
      runAsJython in interface LocalJython
    • setRawInput

      public void setRawInput(String theInput, String jsfIdentifier)
      Description copied from interface: Jython
      After a requestRawInput has been called, the response should be returned via this method. The string is then the returned string to script which called requestRawInput. This method is distributed because the response could come from any object. The requestRawInput should only come from within a script, so that method is not distributed.
      Specified by:
      setRawInput in interface Jython
      Parameters:
      theInput -
      jsfIdentifier - - the unique ID of the JythonServerFacade calling this method.
    • requestRawInput

      public String requestRawInput() throws InterruptedException
      when users ask for command_line input during a script, this gives the Jython the response
      Returns:
      - the output from the user
      Throws:
      InterruptedException
    • requestFinishEarly

      public void requestFinishEarly(String jsfIdentifier)
      Description copied from interface: Jython
      Cleanly stops the current scan.
      Specified by:
      requestFinishEarly in interface Jython
      Parameters:
      jsfIdentifier - - the unique ID of the JythonServerFacade calling this method.
    • pauseCurrentScan

      public void pauseCurrentScan(String jsfIdentifier)
      Description copied from interface: Jython
      Pauses the current scan
      Specified by:
      pauseCurrentScan in interface Jython
      Parameters:
      jsfIdentifier - - the unique ID of the JythonServerFacade calling this method.
    • resumeCurrentScan

      public void resumeCurrentScan(String jsfIdentifier)
      Description copied from interface: Jython
      Resumes the currently paused scan.
      Specified by:
      resumeCurrentScan in interface Jython
      Parameters:
      jsfIdentifier - - the unique ID of the JythonServerFacade calling this method.
    • restartCurrentScan

      public void restartCurrentScan(String jsfIdentifier)
      Description copied from interface: Jython
      Restarts the last scan which was run, if it ended due to an error or it was interrupted. If the last scan completed successfully, then this will do nothing.
      Specified by:
      restartCurrentScan in interface Jython
      Parameters:
      jsfIdentifier - - the unique ID of the JythonServerFacade calling this method.
    • beamlineHalt

      public void beamlineHalt(String jsfIdentifier)
      Description copied from interface: Jython
      Stops all scripts, scans, and commands immediately. Also calls the stop method on all motors.
      Specified by:
      beamlineHalt in interface Jython
      Parameters:
      jsfIdentifier - - the unique ID of the JythonServerFacade calling this method.
    • abortCommands

      public void abortCommands(String jsfIdentifier)
      Description copied from interface: Jython
      Stops all scripts, scans, and commands running from the Jython Server immediately.
      Specified by:
      abortCommands in interface Jython
      Parameters:
      jsfIdentifier - - the unique ID of the JythonServerFacade calling this method.
    • pauseCurrentScript

      public void pauseCurrentScript(String jsfIdentifier)
      Description copied from interface: Jython
      Pauses the current script the next time it calls the ScriptBase.checkForPuases method until resumeCurrentScript is called.
      Specified by:
      pauseCurrentScript in interface Jython
      Parameters:
      jsfIdentifier - - the unique ID of the JythonServerFacade calling this method.
    • resumeCurrentScript

      public void resumeCurrentScript(String jsfIdentifier)
      Description copied from interface: Jython
      Resumes the currently paused script
      Specified by:
      resumeCurrentScript in interface Jython
      Parameters:
      jsfIdentifier - - the unique ID of the JythonServerFacade calling this method.
    • getTerminalWriter

      public Writer getTerminalWriter()
    • addFacade

      public int addFacade(String jsfIdentifier, String hostName, String username, String fullName, String visitID) throws DeviceException
      Description copied from interface: Jython
      For use by the JythonServerFacade class. Allows an instance of this class operating in a different process to remotely register itself with a JythonServer.
      Specified by:
      addFacade in interface Jython
      Parameters:
      jsfIdentifier -
      hostName -
      username -
      fullName -
      visitID -
      Returns:
      the index number of the facade (i.e. its public key)
      Throws:
      DeviceException - - thrown if an error during authentication/authorisation
    • switchUser

      public void switchUser(String uniqueFacadeName, String username, String visitID) throws DeviceException
      Description copied from interface: Jython
      For an already registered JythonServerFacade, changes information for that facade. This can change the permission level of this facade (and so this client) or the visit which data is savaed as when this client has the baton.
      Specified by:
      switchUser in interface Jython
      Parameters:
      uniqueFacadeName -
      username -
      visitID -
      Throws:
      DeviceException
    • removeFacade

      public void removeFacade(String uniqueFacadeName)
      Description copied from interface: Jython
      Removes the registration of the facade with this server and returns the baton if applicable.
      Specified by:
      removeFacade in interface Jython
      Parameters:
      uniqueFacadeName -
    • notifyServer

      public void notifyServer(Object scan, Object data)
      Description copied from interface: IJythonServerNotifer
      This method passes information from a scan to the local facade objects. These in turn pass the data to the local version of the GUI panel which created the scan.
      Specified by:
      notifyServer in interface IJythonServerNotifer
      Parameters:
      scan - The serialized scan object which has created the data.
      data - A vector carrying the latest data collected by the scan
    • restart

      public void restart()
    • addResetHook

      public void addResetHook(Runnable hook)
      Add a task to be run before the namespace is reset. Useful for cleanup of Jython objects that would otherwise be inaccessible after a reset.
      Tasks are only run once and will not be run before subsequent resets.

      NB. When registering hooks from Jython, nonlocal names are looked up at runtime, not when they are added. ie using

      addResetHook(lambda: thing.deleteIObserver(foo))
      will try and delete whatever foo is bound to at the time the namespace is reset (eg, it will fail if foo has been deleted). To bind the name at the time the hook is added, use
      addResetHook(lambda obs=foo: thing.deleteIObserver(obs))
      Parameters:
      hook - task to run just before restarting the JythonServer.
    • getScanStatus

      public JythonStatus getScanStatus(String jsfIdentifier)
      Description copied from interface: Jython
      Returns the scan of the queue (running, idle, paused).
      Specified by:
      getScanStatus in interface Jython
      Parameters:
      jsfIdentifier - - the unique ID of the JythonServerFacade calling this method.
      Returns:
      int
    • getScriptStatus

      public JythonStatus getScriptStatus(String jsfIdentifier)
      Description copied from interface: Jython
      Returns the status of the script (running, idle, paused).
      Specified by:
      getScriptStatus in interface Jython
      Parameters:
      jsfIdentifier - - the unique ID of the JythonServerFacade calling this method.
      Returns:
      int
    • setScriptStatus

      public void setScriptStatus(JythonStatus newStatus, String jsfIdentifier)
      Description copied from interface: Jython
      Sets the script status.
      Specified by:
      setScriptStatus in interface Jython
      Parameters:
      newStatus - JythonStatus of script
      jsfIdentifier - - the unique ID of the JythonServerFacade calling this method.
    • placeInJythonNamespace

      public void placeInJythonNamespace(String objectName, Object obj, String jsfIdentifier)
      Description copied from interface: Jython
      Pass a copy of an object to the Jython interpreter. This object must be relatively simple otherwise it will not be passed over CORBA successfully. So the object must be a native type (or only contain native types) and must not have any object references inside.
      Specified by:
      placeInJythonNamespace in interface Jython
      Parameters:
      objectName -
      obj -
      jsfIdentifier - - the unique ID of the JythonServerFacade calling this method.
    • getFromJythonNamespace

      public Object getFromJythonNamespace(String objectName, String jsfIdentifier)
      Description copied from interface: Jython
      Get a copy of an object from the Jython interpreter. Note that the retreived object will have to be cast by the local code. As the object will be passed over CORBA, this method should only be used on native types or classes containing only native types.
      Specified by:
      getFromJythonNamespace in interface Jython
      Parameters:
      objectName -
      jsfIdentifier - - the unique ID of the JythonServerFacade calling this method.
      Returns:
      Object
    • getAllObjectsOfType

      public <F extends Findable> Map<String,F> getAllObjectsOfType(Class<F> clazz)
      Specified by:
      getAllObjectsOfType in interface LocalJython
    • getAllNamesForObject

      public Set<String> getAllNamesForObject(Object obj) throws DeviceException
      Description copied from interface: Jython
      Returns all names for an Object in the Jython namespace
      Specified by:
      getAllNamesForObject in interface Jython
      Parameters:
      obj -
      Returns:
      All names that refer to the Object in the Jython namespace
      Throws:
      DeviceException
    • setTranslator

      public void setTranslator(Translator newTranslator)
      Changes dynamically the syntax translator to use.
      Parameters:
      newTranslator -
    • getRelease

      public String getRelease(String jsfIdentifier)
      Description copied from interface: Jython
      Returns the name of the GDA release being used by the CommandServer. This is the String returned by the JythonServer's local copy of gda.util.Version. This enables Client and Server processes to check if they are of the same GDA version.
      Specified by:
      getRelease in interface Jython
      Parameters:
      jsfIdentifier - - the unique ID of the JythonServerFacade calling this method.
      Returns:
      the current GDA release used by the CommandServer.
    • getStartupOutput

      public String getStartupOutput(String jsfIdentifier)
      Description copied from interface: Jython
      This is used by clients when they start to immediately give any output messages from the startup script.
      Specified by:
      getStartupOutput in interface Jython
      Parameters:
      jsfIdentifier - - the unique ID of the JythonServerFacade calling this method.
      Returns:
      the output generated when the CommandServer ran its startup file as a string.
    • setCurrentScan

      public void setCurrentScan(Scan newScan)
      Description copied from interface: ICurrentScanInformationHolder
      Registers the supplied object as the scan currently running. This is the scan which will be restarted by resumeCurrentScan if the status is HALTED.
      Specified by:
      setCurrentScan in interface ICurrentScanInformationHolder
      Parameters:
      newScan -
    • addAliasedCommand

      public void addAliasedCommand(String commandName, String jsfIdentifier)
      Description copied from interface: Jython
      Add a new aliased command.
      Specified by:
      addAliasedCommand in interface Jython
      Parameters:
      commandName -
      jsfIdentifier - - the unique ID of the JythonServerFacade calling this method.
    • addAliasedVarargCommand

      public void addAliasedVarargCommand(String commandName, String jsfIdentifier)
      Description copied from interface: Jython
      Add a new vararg aliased command
      Specified by:
      addAliasedVarargCommand in interface Jython
      Parameters:
      commandName -
      jsfIdentifier - - the unique ID of the JythonServerFacade calling this method.
    • removeAlias

      public void removeAlias(String command, String jsfIdentifier)
      Description copied from interface: Jython
      Remove an alias
      Specified by:
      removeAlias in interface Jython
      Parameters:
      command - to remove
    • getDefaultScannables

      public Collection<Scannable> getDefaultScannables()
      Description copied from interface: IDefaultScannableProvider
      Returns a collection of scannable objects which must be called in every scan. Used by scans to construct the list of objects whose positions are reported at every node of a scan.

      This returns a collection of object references of all the objects in the Jython namepsace listed in the DefaultScannablesList object named "scannablesList" in the configuration information.

      As this method returns object references, this method must only be called by objects local to this object. This method must never be available remotely.

      Specified by:
      getDefaultScannables in interface IDefaultScannableProvider
      Returns:
      Collection
    • amIBatonHolder

      public boolean amIBatonHolder(String myJSFIdentifier)
      Specified by:
      amIBatonHolder in interface Jython
      Parameters:
      myJSFIdentifier -
      Returns:
      boolean if the given client holds the beamline baton
    • assignBaton

      public void assignBaton(String myJSFIdentifier, int indexOfReciever, int indexOfPasser)
      Description copied from interface: Jython
      Inform the JythonServer which Client should now have the baton. This method will only be run for current holders of the baton.
      Specified by:
      assignBaton in interface Jython
      Parameters:
      myJSFIdentifier -
      indexOfReciever -
      indexOfPasser -
    • getClientInformation

      public ClientDetails getClientInformation(String myJSFIdentifier)
      Description copied from interface: Jython
      Returns details of this client
      Specified by:
      getClientInformation in interface Jython
      Parameters:
      myJSFIdentifier -
      Returns:
      ClientDetails
    • getOtherClientInformation

      public ClientDetails[] getOtherClientInformation(String myJSFIdentifier)
      Description copied from interface: Jython
      Returns an array of objects describing the other clients on this beamline.

      This array may be slightly out of date if the client was not closed down properly, but after a few minutes the client should be automatically removed from the list.

      Specified by:
      getOtherClientInformation in interface Jython
      Parameters:
      myJSFIdentifier -
      Returns:
      ClientDetails[]
    • isBatonHeld

      public boolean isBatonHeld()
      Description copied from interface: Jython
      Returns true if any client holds the baton. If no client holds the baton then all clients may operate hardware subject to their authorisation level.
      Specified by:
      isBatonHeld in interface Jython
      Returns:
      true if any client holds the baton.
    • requestBaton

      public boolean requestBaton(String uniqueIdentifier)
      Description copied from interface: Jython
      Ask for the baton for control of the beamline devices.
      Specified by:
      requestBaton in interface Jython
      Parameters:
      uniqueIdentifier -
      Returns:
      boolean
    • returnBaton

      public void returnBaton(String uniqueIdentifier)
      Description copied from interface: Jython
      Inform the JythonServer that the baton is no longer required by this connection.
      Specified by:
      returnBaton in interface Jython
      Parameters:
      uniqueIdentifier - String
    • sendMessage

      public void sendMessage(String myJSFIdentifier, String message)
      Description copied from interface: Jython
      Broadcast a message to other users on this beamline. Such messages will be displayed in a special viewer.
      Specified by:
      sendMessage in interface Jython
      Parameters:
      myJSFIdentifier -
      message -
    • getMessageHistory

      public List<UserMessage> getMessageHistory(String myJSFIdentifier)
      Description copied from interface: Jython
      Returns previous messages sent during this visit.
      Specified by:
      getMessageHistory in interface Jython
    • getAliasedCommands

      public Collection<String> getAliasedCommands(String jsfIdentifier)
      Description copied from interface: Jython
      Get the list of aliased commands - GDA syntax extension in Jython environment
      Specified by:
      getAliasedCommands in interface Jython
      Parameters:
      jsfIdentifier -
      Returns:
      the aliased commands
    • getAliasedVarargCommands

      public Collection<String> getAliasedVarargCommands(String jsfIdentifier)
      Description copied from interface: Jython
      Get the list of vararg aliased commands - GDA syntax extension in Jython environment
      Specified by:
      getAliasedVarargCommands in interface Jython
      Parameters:
      jsfIdentifier -
      Returns:
      the aliased vararg commands
    • hasAlias

      public boolean hasAlias(String command, String jsfIdentifier)
      Description copied from interface: Jython
      Check if given command is aliased
      Specified by:
      hasAlias in interface Jython
      Parameters:
      command -
      Returns:
      True if command is an alias
    • locateScript

      public String locateScript(String scriptToRun)
      Description copied from interface: Jython
      Find a script with given name in the GDA's script project folders.
      Specified by:
      locateScript in interface Jython
      Parameters:
      scriptToRun - The name of the script.
      Returns:
      The path to the script, or null if it can't be found.
    • getDefaultScriptProjectFolder

      public String getDefaultScriptProjectFolder()
      Description copied from interface: Jython
      The default location for Jython scripts in the server.
      Specified by:
      getDefaultScriptProjectFolder in interface Jython
      Returns:
      A path to a folder where the server will search for Jython scripts.
    • getAllScriptProjectFolders

      public List<String> getAllScriptProjectFolders()
      Specified by:
      getAllScriptProjectFolders in interface Jython
    • getProjectNameForPath

      public String getProjectNameForPath(String path)
      Specified by:
      getProjectNameForPath in interface Jython
    • projectIsUserType

      public boolean projectIsUserType(String path)
      Specified by:
      projectIsUserType in interface Jython
    • projectIsConfigType

      public boolean projectIsConfigType(String path)
      Specified by:
      projectIsConfigType in interface Jython
    • projectIsCoreType

      public boolean projectIsCoreType(String path)
      Specified by:
      projectIsCoreType in interface Jython
    • getInterp

      public org.python.util.InteractiveConsole getInterp()
    • getCommandThreadInfo

      public ICommandThreadInfo[] getCommandThreadInfo()
      Description copied from interface: Jython
      Returns information about each active command thread
      Specified by:
      getCommandThreadInfo in interface Jython
      Returns:
      Array of command thread information
    • setStopJythonScannablesOnStopAll

      public void setStopJythonScannablesOnStopAll(boolean stopJythonScannablesOnStopAll)
    • isStoppingJythonScannablesOnStopAll

      public boolean isStoppingJythonScannablesOnStopAll()
    • getCurrentScanInformation

      public ScanInformation getCurrentScanInformation()
      Description copied from interface: ICurrentScanInformationHolder
      Return some information about the currently running scan
      Specified by:
      getCurrentScanInformation in interface ICurrentScanInformationHolder
      Returns:
      ScanInformation
    • isFinishEarlyRequested

      public boolean isFinishEarlyRequested()
      Specified by:
      isFinishEarlyRequested in interface Jython
      Returns:
      true if the current scan has had requestFinishEarly called on it.
    • setDisableBatonControlOverVisitMetadataEntry

      public void setDisableBatonControlOverVisitMetadataEntry(boolean disable)
    • isDisableBatonControlOverVisitMetadataEntry

      public boolean isDisableBatonControlOverVisitMetadataEntry()
    • addInputTerminal

      public void addInputTerminal(Terminal term)
      Specified by:
      addInputTerminal in interface ITerminalInputProvider
    • deleteInputTerminal

      public void deleteInputTerminal(Terminal term)
      Specified by:
      deleteInputTerminal in interface ITerminalInputProvider
    • addJythonServerStatusObserver

      public void addJythonServerStatusObserver(IJythonServerStatusObserver anObserver)
      Specified by:
      addJythonServerStatusObserver in interface IJythonServerStatusProvider
    • deleteJythonServerStatusObserver

      public void deleteJythonServerStatusObserver(IJythonServerStatusObserver anObserver)
      Specified by:
      deleteJythonServerStatusObserver in interface IJythonServerStatusProvider
    • getJythonServerStatus

      public JythonServerStatus getJythonServerStatus()
      Description copied from interface: Jython
      Get the state of running scripts/scans
      Specified by:
      getJythonServerStatus in interface IJythonServerStatusProvider
      Specified by:
      getJythonServerStatus in interface Jython
    • showUsers

      public void showUsers()
    • eval

      public org.python.core.PyObject eval(String s)
      Description copied from interface: Jython
      Evaluates a string as a Python expression and returns the result. Bypasses translator, batton control, and is not available across corba.

      This is of particular utility compared to other offerings as calls are synchronous, throw exceptions and can return an actual object.

      Specified by:
      eval in interface Jython
      Parameters:
      s - The pure Jython string command to eval.
      Returns:
      PyObject The result of the eval
    • exec

      public void exec(String s)
      Description copied from interface: Jython
      Executes a string of Python source in the local namespace. Bypasses translator, batton control, and is not available across corba.

      This is of particular utility compared to other offerings as calls are synchronous and throw exceptions.

      Specified by:
      exec in interface Jython
      Parameters:
      s - The pure Jython string command to exec.
    • getCompletionsFor

      public AutoCompletion getCompletionsFor(String line, int posn)
      Specified by:
      getCompletionsFor in interface Jython
      Specified by:
      getCompletionsFor in interface TextCompleter
    • print

      public void print(String text)
      Specified by:
      print in interface Jython
    • addIObserver

      public void addIObserver(gda.observable.IObserver anIObserver)
      Specified by:
      addIObserver in interface gda.observable.IObservable
    • deleteIObserver

      public void deleteIObserver(gda.observable.IObserver anIObserver)
      Specified by:
      deleteIObserver in interface gda.observable.IObservable
    • deleteIObservers

      public void deleteIObservers()
      Specified by:
      deleteIObservers in interface gda.observable.IObservable