public abstract class SPRunner<T> extends RMObject
Modifier and Type | Class and Description |
---|---|
static class |
SPRunner.Status |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ActivityText_Prop |
static java.lang.String |
Progress_Prop |
static java.lang.String |
Status_Prop |
Constructor and Description |
---|
SPRunner() |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancels the runner.
|
void |
cancelled(java.lang.Exception e)
The method to run when cancelled.
|
void |
failure(java.lang.Exception e)
The method to run on failure.
|
void |
finished()
The method to run when finished (after success()/failure() call).
|
java.lang.String |
getActivityText()
Returns a description of the current activity beging performed.
|
long |
getElapsedTime()
Returns the elapsed time.
|
long |
getEndTime()
Returns the end time.
|
java.lang.Throwable |
getExeption()
Returns the exception.
|
java.lang.String |
getName()
Returns the name of runner (and thread).
|
double |
getProgress()
Returns the progress value.
|
T |
getResult()
Returns the result.
|
long |
getStartTime()
Returns the start time.
|
SPRunner.Status |
getStatus()
Returns the status.
|
protected long |
getSystemTime()
Returns the system time.
|
java.lang.Thread |
getThread()
Returns the thread.
|
protected void |
invokeFinished()
Runs the success method.
|
protected void |
invokeRun()
Runs the run method.
|
boolean |
isActive()
Returns whether thread is still active.
|
boolean |
isCancelled()
Whether runner has been cancelled.
|
SPRunner<T> |
join()
Joins the runner.
|
SPRunner<T> |
join(int aTimeout)
Joins the runner.
|
abstract T |
run()
The method to run.
|
void |
setActivityText(java.lang.String aString)
Sets a description of the current activity beging performed.
|
void |
setName(java.lang.String aName)
Sets the name of runner (and thread).
|
void |
setProgress(double aValue)
Sets the progress value.
|
protected void |
setStatus(SPRunner.Status aStatus)
Sets the status.
|
SPRunner<T> |
start()
Starts the runner.
|
void |
success(T aResult)
The method run on success.
|
addPropertyChangeListener, animUpdate, firePropertyChange, firePropertyChange, firePropertyChange, getPCEvent, removePropertyChangeListener, sendPropertyChange, toString
addListener, clone, getListener, getListenerCount, getListenerCount, getListenerList, getListeners, hasListeners, removeListener
public static final java.lang.String Progress_Prop
public static final java.lang.String ActivityText_Prop
public static final java.lang.String Status_Prop
public double getProgress()
public void setProgress(double aValue)
public java.lang.String getName()
public void setName(java.lang.String aName)
public java.lang.String getActivityText()
public void setActivityText(java.lang.String aString)
public SPRunner.Status getStatus()
protected void setStatus(SPRunner.Status aStatus)
public java.lang.Thread getThread()
public boolean isActive()
public boolean isCancelled()
public long getStartTime()
public long getEndTime()
public long getElapsedTime()
protected long getSystemTime()
public void cancel()
public abstract T run() throws java.lang.Exception
java.lang.Exception
public void success(T aResult)
public void cancelled(java.lang.Exception e)
public void failure(java.lang.Exception e)
public void finished()
public T getResult()
public java.lang.Throwable getExeption()
protected void invokeRun()
protected void invokeFinished()