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,- java.lang.Cloneable
 - Direct Known Subclasses:
- SwingRunner
 
 public abstract class SPRunner<T> extends RMObject A class for running operations in the background.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classSPRunner.Status
 - 
Field SummaryFields Modifier and Type Field Description static java.lang.StringActivityText_Propstatic java.lang.StringProgress_Propstatic java.lang.StringStatus_Prop
 - 
Constructor SummaryConstructors Constructor Description SPRunner()
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcancel()Cancels the runner.voidcancelled(java.lang.Exception e)The method to run when cancelled.voidfailure(java.lang.Exception e)The method to run on failure.voidfinished()The method to run when finished (after success()/failure() call).java.lang.StringgetActivityText()Returns a description of the current activity beging performed.longgetElapsedTime()Returns the elapsed time.longgetEndTime()Returns the end time.java.lang.ThrowablegetExeption()Returns the exception.java.lang.StringgetName()Returns the name of runner (and thread).doublegetProgress()Returns the progress value.TgetResult()Returns the result.longgetStartTime()Returns the start time.SPRunner.StatusgetStatus()Returns the status.protected longgetSystemTime()Returns the system time.java.lang.ThreadgetThread()Returns the thread.protected voidinvokeFinished()Runs the success method.protected voidinvokeRun()Runs the run method.booleanisActive()Returns whether thread is still active.booleanisCancelled()Whether runner has been cancelled.SPRunner<T>join()Joins the runner.SPRunner<T>join(int aTimeout)Joins the runner.abstract Trun()The method to run.voidsetActivityText(java.lang.String aString)Sets a description of the current activity beging performed.voidsetName(java.lang.String aName)Sets the name of runner (and thread).voidsetProgress(double aValue)Sets the progress value.protected voidsetStatus(SPRunner.Status aStatus)Sets the status.SPRunner<T>start()Starts the runner.voidsuccess(T aResult)The method run on success.- 
Methods inherited from class com.inductiveautomation.rm.base.RMObjectaddPropertyChangeListener, animUpdate, firePropertyChange, firePropertyChange, firePropertyChange, getPCEvent, removePropertyChangeListener, sendPropertyChange, toString
 - 
Methods inherited from class com.inductiveautomation.rm.base.RMListenerListaddListener, clone, getListener, getListenerCount, getListenerCount, getListenerList, getListeners, hasListeners, removeListener
 
- 
 
- 
- 
- 
Field Detail- 
Progress_Proppublic static final java.lang.String Progress_Prop - See Also:
- Constant Field Values
 
 - 
ActivityText_Proppublic static final java.lang.String ActivityText_Prop - See Also:
- Constant Field Values
 
 - 
Status_Proppublic static final java.lang.String Status_Prop - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getProgresspublic double getProgress() Returns the progress value.
 - 
setProgresspublic void setProgress(double aValue) Sets the progress value.
 - 
getNamepublic java.lang.String getName() Returns the name of runner (and thread).
 - 
setNamepublic void setName(java.lang.String aName) Sets the name of runner (and thread).
 - 
getActivityTextpublic java.lang.String getActivityText() Returns a description of the current activity beging performed.
 - 
setActivityTextpublic void setActivityText(java.lang.String aString) Sets a description of the current activity beging performed.
 - 
getStatuspublic SPRunner.Status getStatus() Returns the status.
 - 
setStatusprotected void setStatus(SPRunner.Status aStatus) Sets the status.
 - 
getThreadpublic java.lang.Thread getThread() Returns the thread.
 - 
isActivepublic boolean isActive() Returns whether thread is still active.
 - 
isCancelledpublic boolean isCancelled() Whether runner has been cancelled.
 - 
getStartTimepublic long getStartTime() Returns the start time.
 - 
getEndTimepublic long getEndTime() Returns the end time.
 - 
getElapsedTimepublic long getElapsedTime() Returns the elapsed time.
 - 
getSystemTimeprotected long getSystemTime() Returns the system time.
 - 
cancelpublic void cancel() Cancels the runner.
 - 
runpublic abstract T run() throws java.lang.Exception The method to run.- Throws:
- java.lang.Exception
 
 - 
successpublic void success(T aResult) The method run on success.
 - 
cancelledpublic void cancelled(java.lang.Exception e) The method to run when cancelled.
 - 
failurepublic void failure(java.lang.Exception e) The method to run on failure.
 - 
finishedpublic void finished() The method to run when finished (after success()/failure() call).
 - 
getResultpublic T getResult() Returns the result.
 - 
getExeptionpublic java.lang.Throwable getExeption() Returns the exception.
 - 
invokeRunprotected void invokeRun() Runs the run method.
 - 
invokeFinishedprotected void invokeFinished() Runs the success method.
 
- 
 
-