|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.developmentontheedge.jobcontrol.AbstractJobControl
com.developmentontheedge.jobcontrol.FunctionJobControl
Provides JobControl functionality for long time performed functions
FunctionJobControl is intended for control of function processing.
Here the stub demonstrating how FunctionJobControl should be used:
public void function(functionArgumnts, FunctionJobControl control) throws JobControlException
{
try
{
if(control != null)
control.functionStarted();
for(...)
{
if(control != null)
control.checkStatus();
...
if(control != null)
control.setPreparedness( % );
}
if(control != null)
control.functionFinished();
}
catch(Throwable t)
{
if(control != null)
functionTerminatedByError(t);
}
}
| Field Summary | |
protected static org.apache.log4j.Category |
log
|
| Fields inherited from class com.developmentontheedge.jobcontrol.AbstractJobControl |
cat, isTerminated, preparedness, runStatus, startedDate, status |
| Fields inherited from interface com.developmentontheedge.jobcontrol.JobControl |
COMPLETED, CREATED, PAUSED, RUNNING, TERMINATED_BY_ERROR, TERMINATED_BY_REQUEST |
| Constructor Summary | |
FunctionJobControl(org.apache.log4j.Category cat)
Constructs FunctionJobControl |
|
FunctionJobControl(org.apache.log4j.Category cat,
JobControlListener l)
Constructs FunctionJobControl |
|
| Method Summary | |
protected void |
doRun()
Empty implementation |
void |
functionFinished()
This method should be called when Job is finished successfuly |
void |
functionFinished(java.lang.String msg)
This method should be called when Job is finished successfuly |
void |
functionStarted()
This method should be called when Job is started |
void |
functionStarted(java.lang.String msg)
This method should be called when Job is started |
void |
functionTerminatedByError(java.lang.Throwable t)
This method should be called when Job is finished by error |
| Methods inherited from class com.developmentontheedge.jobcontrol.AbstractJobControl |
addListener, begin, begin, checkStatus, end, end, exceptionOccured, fireJobPaused, fireJobResumed, fireJobStarted, fireJobTerminated, fireValueChanged, format, format, getCreatedTime, getElapsedTime, getEndedTime, getPreparedness, getRemainedTime, getStartedTime, getStatus, getTextStatus, isStatusTerminated, pause, reset, resetFlags, resultsAreReady, resume, run, setCompleted, setPreparedness, setTerminated, terminate |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static org.apache.log4j.Category log
| Constructor Detail |
public FunctionJobControl(org.apache.log4j.Category cat)
cat - logging Category
public FunctionJobControl(org.apache.log4j.Category cat,
JobControlListener l)
cat - logging Category| Method Detail |
public void functionStarted()
public void functionStarted(java.lang.String msg)
msg - detailed message. This message is used for creating of JobControlEventJobControlEventpublic void functionFinished(java.lang.String msg)
msg - detailed message. This message is used for creating of JobControlEventpublic void functionFinished()
public void functionTerminatedByError(java.lang.Throwable t)
t - exception that is occured during Job process
protected void doRun()
throws JobControlException
doRun in class AbstractJobControlJobControlException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||