Package gda.commandqueue
Class CommandBase
java.lang.Object
gda.commandqueue.CommandBase
- All Implemented Interfaces:
Command,gda.observable.IObservable,Serializable
- Direct Known Subclasses:
BatonPassCommand,JythonScriptFileRunnerCommand,StopCommand
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:
-
Nested Class Summary
Nested classes/interfaces inherited from interface gda.commandqueue.Command
Command.STATE -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidabort()voidaddIObserver(gda.observable.IObserver anIObserver) voidbeginRun()voiddeleteIObserver(gda.observable.IObserver anIObserver) voidvoidendRun()getState()voidpause()voidresume()voidsetDescription(String description) protected voidsetState(Command.STATE newState) toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface gda.commandqueue.Command
getCommandSummary, getDetails, run, setDetails
-
Field Details
-
obsComp
protected gda.observable.ObservableComponent obsComp
-
-
Constructor Details
-
CommandBase
public CommandBase()
-
-
Method Details
-
getDescription
- Specified by:
getDescriptionin interfaceCommand
-
setDescription
-
toString
-
getState
-
setState
-
abort
public void abort() -
pause
public void pause() -
beginRun
public void beginRun() -
endRun
public void endRun() -
addIObserver
public void addIObserver(gda.observable.IObserver anIObserver) - Specified by:
addIObserverin interfacegda.observable.IObservable
-
deleteIObserver
public void deleteIObserver(gda.observable.IObserver anIObserver) - Specified by:
deleteIObserverin interfacegda.observable.IObservable
-
deleteIObservers
public void deleteIObservers()- Specified by:
deleteIObserversin interfacegda.observable.IObservable
-
resume
-