Interface Scriptcontroller

All Superinterfaces:
Configurable, Findable, gda.observable.IObservable
All Known Subinterfaces:
ILoggingScriptController
All Known Implementing Classes:
LoggingScriptController, ScriptControllerBase

public interface Scriptcontroller extends gda.observable.IObservable, Findable, Configurable
A interface for a distributed class which runs a Jython script. This class is distributed and IObservable so that GUI object can receive messages back from the running script to inform the user of progress.

To run the script, the GUI should run the command returned by the getCommand method using the JythonServerFacade object. The GUI should be set to IObserve this Scriptcontroller, which will then pass messages from the script to its observers via CORBA messaging.

It is recommended that the script sends progress messages back to this object's IObserver in the form of gda.jython.scriptcontroller.event classes.

If parameters need to be given to the script, a serializable object should be created of the type the script is expecting and placed into the Jython namespace under the name return by this objects getParametersName method. The object is placed into the Jython namespace using the JythonServerFacade object.

The import command is the command to run when this object is configured so that the script that this object controls is loaded into the Jython namespace

  • Field Details

  • Method Details

    • getCommand

      String getCommand()
      Returns the command that would be run by the runScript command. This should be a function in a Jython file placed in one of the directories defined by the command server's script_paths bean.
      Returns:
      a Jython command which starts the script this object represents
    • setCommand

      void setCommand(String scriptName)
      Sets the command which would be run by the runScript command.
      Parameters:
      scriptName -
    • getParametersName

      String getParametersName()
      Returns the name of the object which is used to pass parameters to the script.
      Returns:
      the name of an object in the Jython namespace
    • setParametersName

      void setParametersName(String parametersName)
      Sets the name of the object in the Jython namepsace which the script and this object uses as a mechanism to pass parameters to the script.

      This object must be serializable.

      Parameters:
      parametersName -
    • addParameter

      void addParameter(Object parameter)
      Add a parameter that will be used to format the script command to run. Subsequent calls will extend the list of parameters. Use reconfigure() method to erase parameters.
      Parameters:
      parameter -
    • getImportCommand

      String getImportCommand()
      Returns the command which should be run to load the script into the Jython namespace.
      Returns:
      the command to load the script
    • setImportCommand

      void setImportCommand(String command)
      Sets the import command.
      Parameters:
      command -
    • notifyIObservers

      void notifyIObservers(Object source, Object event)
      Notify all observers on the list of the requested change
      Parameters:
      source - the observed component
      event - the data to be sent to the observer.
    • update

      void update(Object o, Object arg)
      Updates observers by distributing arg to them.
      Parameters:
      o - the observed component
      arg - the data to be sent to the observer.