|
||||||||||
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 Error
s
Field Summary | |
---|---|
protected java.lang.Exception |
exception
|
Constructor Summary | |
---|---|
BaseTask()
|
Method Summary | |
---|---|
abstract void |
execute()
Subclasses should implement this method NOTE: not declaring throws Throwable. |
java.lang.Exception |
getException()
Returns the exception that was thrown during execution, if any |
void |
run()
Run implementation which delegates to execute() . |
protected void |
setException(java.lang.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 java.lang.Exception exception
Constructor Detail |
---|
public BaseTask()
Method Detail |
---|
public void run()
execute()
.
Catches and stores any exception execute()
throws.
run
in interface java.lang.Runnable
execute()
protected void setException(java.lang.Exception e)
e
- exception to setpublic abstract void execute() throws java.lang.Exception
java.lang.Exception
public java.lang.Exception getException()
getException
in interface Task
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |