|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jasig.portal.utils.threading.BaseTask
public abstract class BaseTask
A convenience base task class for subclasses.
Introduces an execute() method which declares throws Exception,
which subclasses may override. Any Exception thrown from execute
will be caught and stored, to be accessible through getException
NOTE: Throwable is not caught to avoid catching Errors
| Field Summary | |
|---|---|
protected Exception |
exception
|
| Constructor Summary | |
|---|---|
BaseTask()
|
|
| Method Summary | |
|---|---|
abstract void |
execute()
Subclasses should implement this method NOTE: not declaring throws Throwable. |
Exception |
getException()
Returns the exception that was thrown during execution, if any |
void |
run()
Run implementation which delegates to execute(). |
protected void |
setException(Exception e)
Only subclasses are allowed to use this |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Exception exception
| Constructor Detail |
|---|
public BaseTask()
| Method Detail |
|---|
public void run()
execute().
Catches and stores any exception execute() throws.
run in interface Runnableexecute()protected void setException(Exception e)
e - exception to set
public abstract void execute()
throws Exception
Exceptionpublic Exception getException()
getException in interface Task
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||