Class SPRunner<T>
java.lang.Object
com.inductiveautomation.rm.base.RMListenerList
com.inductiveautomation.rm.base.RMObject
com.inductiveautomation.snap.util.SPRunner<T>
- All Implemented Interfaces:
RMPropertyChanger,Cloneable
- Direct Known Subclasses:
SwingRunner
A class for running operations in the background.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()Cancels the runner.voidThe method to run when cancelled.voidThe method to run on failure.voidfinished()The method to run when finished (after success()/failure() call).Returns a description of the current activity beging performed.longReturns the elapsed time.longReturns the end time.Returns the exception.getName()Returns the name of runner (and thread).doubleReturns the progress value.Returns the result.longReturns the start time.Returns the status.protected longReturns the system time.Returns the thread.protected voidRuns the success method.protected voidRuns the run method.booleanisActive()Returns whether thread is still active.booleanWhether runner has been cancelled.join()Joins the runner.join(int aTimeout) Joins the runner.abstract Trun()The method to run.voidsetActivityText(String aString) Sets a description of the current activity beging performed.voidSets the name of runner (and thread).voidsetProgress(double aValue) Sets the progress value.protected voidsetStatus(SPRunner.Status aStatus) Sets the status.start()Starts the runner.voidThe method run on success.Methods inherited from class com.inductiveautomation.rm.base.RMObject
addPropertyChangeListener, animUpdate, firePropertyChange, firePropertyChange, firePropertyChange, getPCEvent, removePropertyChangeListener, sendPropertyChange, toStringMethods inherited from class com.inductiveautomation.rm.base.RMListenerList
addListener, clone, getListener, getListenerCount, getListenerCount, getListenerList, getListeners, hasListeners, removeListener
-
Field Details
-
Progress_Prop
- See Also:
-
ActivityText_Prop
- See Also:
-
Status_Prop
- See Also:
-
-
Constructor Details
-
SPRunner
public SPRunner()
-
-
Method Details
-
getProgress
public double getProgress()Returns the progress value. -
setProgress
public void setProgress(double aValue) Sets the progress value. -
getName
Returns the name of runner (and thread). -
setName
Sets the name of runner (and thread). -
getActivityText
Returns a description of the current activity beging performed. -
setActivityText
Sets a description of the current activity beging performed. -
getStatus
Returns the status. -
setStatus
Sets the status. -
getThread
Returns the thread. -
join
Joins the runner. -
join
Joins the runner. -
isActive
public boolean isActive()Returns whether thread is still active. -
isCancelled
public boolean isCancelled()Whether runner has been cancelled. -
getStartTime
public long getStartTime()Returns the start time. -
getEndTime
public long getEndTime()Returns the end time. -
getElapsedTime
public long getElapsedTime()Returns the elapsed time. -
getSystemTime
protected long getSystemTime()Returns the system time. -
start
Starts the runner. -
cancel
public void cancel()Cancels the runner. -
run
The method to run.- Throws:
Exception
-
success
The method run on success. -
cancelled
The method to run when cancelled. -
failure
The method to run on failure. -
finished
public void finished()The method to run when finished (after success()/failure() call). -
getResult
Returns the result. -
getExeption
Returns the exception. -
invokeRun
protected void invokeRun()Runs the run method. -
invokeFinished
protected void invokeFinished()Runs the success method.
-