|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jmonks.batch.framework.JobController org.jmonks.batch.framework.controller.basic.BasicJobController
BasicJobController creates and executes the Basic Job Processor class defined in job configuration. It creates the configured number of instances and have each instance run in a seperate thread. Once all the processors have finished their processing, returns the appropriate return code.
This controller is useful to write and execute a simple business logic
stands on its own. Allows the flexibility to run that code in a number
of instances. Following is an example configuration to configure the
batch job written based on BasicJobController.
XML Configuration is as follows
<job-config job-name="process_file_abc"> <job-controller controller-class-name="org.jmonks.batch.framework.controller.basic.BasicJobController"> <basic-job-processor basic-job-processor-class-name="com.mycompany.batch.processfileabc.AbcJobProcessor" thread-count="5"> <property key="basic-job-processor-config1">basic-job-processor-value1</property> </basic-job-processor> <property key="basic-controller-config1">basic-controller-value1</property> </job-controller> <job-logging-config> <logging-property-file>com.mycompany.batch.processfileabc.Logging</logging-property-file> </job-logging-config> </job-config>
TableName.ColumnName | Value |
job_config.job_name | process_file_abc |
job_config.job_status | 1 |
job_config.job_controller_class_name | org.jmonks.batch.framework.controller.basic.BasicJobController |
job_config.job_controller_props | basic-controller-config1=basic-controller-value1:basic-controller-config1=basic-controller-value2 |
basic_job_controller_config.job_name | process_file_abc |
basic_job_controller_config.basic_job_processor_class_name | com.mycompany.batch.processfileabc.AbcJobProcessor |
basic_job_controller_config.basic_job_processor_props | basic-job-processor-config1=basic-job-processor-value1 |
basic_job_controller_config.basic_job_processor_thread_cnt | 1 |
Field Summary |
Fields inherited from class org.jmonks.batch.framework.JobController |
jobContext |
Constructor Summary | |
BasicJobController()
Constructor enables the instantiation of the basic job controller instance. |
Method Summary | |
long |
getExpectedRecordsCount()
Returns the total number of records this job going to process. |
JobStatistics |
getJobStatistics()
Returns the statistics of this job. |
long |
getProcessedRecordsCount()
Returns the number of records processed so far. |
java.lang.String[] |
getProcessorIDList()
Returns the IDs of all the processors as string array. |
ProcessorState |
getProcessorState(java.lang.String processorID)
Returns the state of the requested processor as a ProcessorState object. |
ProcessorStatus |
getProcessorStatus(java.lang.String processorID)
Returns the status of the processor identified by the given processor ID. |
ErrorCode |
process()
Executes the job by running the configured number of basic job processors and returns the appropriate errorcode. |
boolean |
resume(java.lang.String processorID)
Resumes the processor identified by given processor ID. |
boolean |
stop(java.lang.String processorID)
Stops the processor identified by the given processor ID. |
boolean |
suspend(java.lang.String processorID)
Suspends the processor identified by the given processor ID. |
Methods inherited from class org.jmonks.batch.framework.JobController |
changeLogLevel, createJobController, getLogLevel |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BasicJobController()
Method Detail |
public ErrorCode process()
Executes the job by running the configured number of basic job processors and returns the appropriate errorcode. It collects all the return codes returned by job processors and return the first non successful return code it found in the list. If it doesnt find any non successful return code, it will return successful error code.
process
in class JobController
public long getExpectedRecordsCount()
public long getProcessedRecordsCount()
public java.lang.String[] getProcessorIDList()
public ProcessorState getProcessorState(java.lang.String processorID)
public ProcessorStatus getProcessorStatus(java.lang.String processorID)
processorID
- ID assigned to each processor.
public boolean stop(java.lang.String processorID)
processorID
- ID assigned to each processor.
public boolean suspend(java.lang.String processorID)
processorID
- ID assigned to each processor.
public boolean resume(java.lang.String processorID)
processorID
- ID assigned to each processor.
public JobStatistics getJobStatistics()
JobController
getJobStatistics
in class JobController
org.jmonks.batch.framework.controller.JobController#getJobStatistics()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |