Class CommandBase

java.lang.Object
gda.commandqueue.CommandBase
All Implemented Interfaces:
Command, gda.observable.IObservable, Serializable
Direct Known Subclasses:
BatonPassCommand, JythonScriptFileRunnerCommand, StopCommand

public abstract class CommandBase extends Object implements Command
The class provides default implementations Command interface methods: getDescription and getState The developer need only subclass this class and define the run method. It is assumed that the run method was take a while to execute. Wrap the code in the run method in calls to beginRun and endRun to ensure the state is set correctly
See Also:
  • Field Details

    • obsComp

      protected gda.observable.ObservableComponent obsComp
  • Constructor Details

    • CommandBase

      public CommandBase()
  • Method Details

    • getDescription

      public String getDescription()
      Specified by:
      getDescription in interface Command
    • setDescription

      public void setDescription(String description)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getState

      public Command.STATE getState()
      Specified by:
      getState in interface Command
    • setState

      protected void setState(Command.STATE newState)
    • abort

      public void abort()
      Specified by:
      abort in interface Command
    • pause

      public void pause()
      Specified by:
      pause in interface Command
    • beginRun

      public void beginRun()
    • endRun

      public void endRun()
    • 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
    • resume

      public void resume() throws Exception
      Specified by:
      resume in interface Command
      Throws:
      Exception