public abstract class AbstractGenericTask extends javax.swing.SwingWorker<java.lang.Boolean,java.lang.Object> implements GenericTask, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected boolean |
isCancelled
Member isCancelled should be used in the doThisJob() method to ensure a proper cancellation.
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractGenericTask()
Empty constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
cancel()
This method is called to cancel a running task.
|
protected java.lang.Boolean |
doInBackground()
Compared to the super class, the doInBackground() no longer throws exceptions.
|
protected void |
done() |
protected abstract void |
doThisJob()
This method is the inner part of the doInBackground method.
|
java.lang.Exception |
getFailureReason()
This method returns the exception that has caused the task to terminate incorrectly.
|
java.lang.String |
getName()
This method returns the name of the task.
|
boolean |
hasBeenCancelled()
This method returns true if the method cancel() has been called.
|
boolean |
isCorrectlyTerminated()
This method returns true if the task is correctly terminated or false otherwise.
|
boolean |
isVerbose()
This method returns true if the task displays messages.
|
protected void |
setCorrectlyTerminated(boolean correctlyTerminated)
This methods sets the correctlyTerminated member.
|
protected void |
setFailureReason(java.lang.Exception failureReason)
This method sets the failureReason member.
|
protected void |
setName(java.lang.String name)
This method sets the name of the task.
|
java.lang.String |
toString() |
addPropertyChangeListener, cancel, execute, firePropertyChange, get, get, getProgress, getPropertyChangeSupport, getState, isCancelled, isDone, process, publish, removePropertyChangeListener, run, setProgress
protected boolean isCancelled
public boolean isCorrectlyTerminated()
Executable
isCorrectlyTerminated
in interface Executable
protected void setCorrectlyTerminated(boolean correctlyTerminated)
correctlyTerminated
- a booleanpublic java.lang.Exception getFailureReason()
Executable
getFailureReason
in interface Executable
protected void setFailureReason(java.lang.Exception failureReason)
failureReason
- an Exception instanceprotected void setName(java.lang.String name)
name
- a Stringpublic java.lang.String getName()
GenericTask
getName
in interface GenericTask
public java.lang.String toString()
toString
in class java.lang.Object
public void cancel()
GenericTask
cancel
in interface GenericTask
public final boolean hasBeenCancelled()
GenericTask
hasBeenCancelled
in interface GenericTask
protected final java.lang.Boolean doInBackground()
doInBackground
in class javax.swing.SwingWorker<java.lang.Boolean,java.lang.Object>
protected abstract void doThisJob() throws java.lang.Exception
java.lang.Exception
protected final void done()
done
in class javax.swing.SwingWorker<java.lang.Boolean,java.lang.Object>
public boolean isVerbose()
GenericTask
isVerbose
in interface GenericTask