com.developmentontheedge.jobcontrol
Class FunctionJobControl
com.developmentontheedge.jobcontrol.AbstractJobControl
|
+--com.developmentontheedge.jobcontrol.FunctionJobControl
- public class FunctionJobControl
- extends AbstractJobControl
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);
}
}
| Method Summary |
void | functionFinished(String msg) This method should be called when Job is finished successfuly |
void | functionFinished() This method should be called when Job is finished successfuly |
void | functionStarted() This method should be called when Job is started |
void | functionStarted(String msg) This method should be called when Job is started |
void | functionTerminatedByError(Throwable t) This method should be called when Job is finished by error |
| Methods inherited from class com.developmentontheedge.jobcontrol.AbstractJobControl |
addListener, begin, checkStatus, end, fireValueChanged, format, format, getCreatedTime, getElapsedTime, getEndedTime, getPreparedness, getRemainedTime, getStartedTime, getStatus, getTextStatus, pause, resultsAreReady, resume, run, setPreparedness, terminate |
FunctionJobControl
public FunctionJobControl(Category cat)
- Constructs FunctionJobControl
- Parameters:
- cat - logging Category
FunctionJobControl
public FunctionJobControl(Category cat, JobControlListener l)
- Constructs FunctionJobControl
- Parameters:
- cat - logging Category
functionFinished
public void functionFinished(String msg)
- This method should be called when Job is finished successfuly
- Parameters:
- msg - detailed message. This message is used for creating of JobControlEvent
functionFinished
public void functionFinished()
- This method should be called when Job is finished successfuly
functionStarted
public void functionStarted()
- This method should be called when Job is started
functionStarted
public void functionStarted(String msg)
- This method should be called when Job is started
- Parameters:
- msg - detailed message. This message is used for creating of JobControlEvent
- See Also:
- JobControlEvent
functionTerminatedByError
public void functionTerminatedByError(Throwable t)
- This method should be called when Job is finished by error
- Parameters:
- t - exception that is occured during Job process
to Class org.apache.log4j.Category
BOTTOM