|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jmonks.batch.framework.controller.basic.BasicJobProcessor
BasicJobProcessor lets job developers to implement their business logic
in the process method and this method will be executed by the BasicJobController.
public class MyBasicJobProcessor extends BasicJobProcessor { public ErrorCode process(JobContext jobContext) { //Perform the business logic. return ErrorCode.JOB_COMPLETED_SUCCESSFULLY; } }
Field Summary | |
protected ProcessorStatus |
processorStatus
Indicates the status of this processor. |
protected java.lang.Thread |
processorThread
Holds the thread references this processor has been spawned. |
Constructor Summary | |
BasicJobProcessor()
|
Method Summary | |
abstract long |
getProcessedRecordsCount()
This is for monitoring applications to know how many records this particular (if there are multiple job processors) job processor has finished processing. |
abstract java.lang.Object |
getProcessorState()
This is for monitoring applications to know what the information (record) this job processor is processing. |
ProcessorStatus |
getProcessorStatus()
Returns the status of the processor as a ProcessorStatus object, which gives the information like whether the processor is running, suspended, resumed or stopped. |
abstract long |
getTotalRecordsCount()
This is for monitoring applications to know how many records this particular (if there are multiple job processors) job processor is going to process. |
abstract ErrorCode |
process(JobContext jobContext)
Does the processing and return the appropriate error code. |
boolean |
resume()
Basic job controller calls this method to resume the job processor, when it receives a resume message from the managemet interface. |
boolean |
stop()
Basic job controller calls this method to stop the job processor, when it receives a stop message from the managemet interface. |
boolean |
suspend()
Basic job controller calls this method to suspend the job processor, when it receives a suspsend message from the managemet interface. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.Thread processorThread
protected ProcessorStatus processorStatus
Constructor Detail |
public BasicJobProcessor()
Method Detail |
public boolean suspend()
Basic job controller calls this method to suspend the job processor, when it receives a suspsend message from the managemet interface. Default implementation will suspend the job processor abruptly as soon as it receives the message. Implementors can provide their own implementation by overriding this method to provide better mechanism.
public boolean resume()
Basic job controller calls this method to resume the job processor, when it receives a resume message from the managemet interface. Default implementation will resume the job processor abruptly as soon as it receives the message. Implementors can provide their own implementation by overriding this method to provide better mechanism.
public boolean stop()
Basic job controller calls this method to stop the job processor, when it receives a stop message from the managemet interface. Default implementation will stop the job processor abruptly as soon as it receives the message. Implementors can provide their own implementation by overriding this method to provide better mechanism.
public abstract ErrorCode process(JobContext jobContext)
Does the processing and return the appropriate error code. Properties configured for this job processor can be retrieved from the JobContext.
jobContext
- Context of the job, where all the properties will be defined.
public abstract java.lang.Object getProcessorState()
public ProcessorStatus getProcessorStatus()
public abstract long getTotalRecordsCount()
public abstract long getProcessedRecordsCount()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |