|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jmonks.batch.framework.Main
Main is the entry point to the batch framework. This provides
the methods to accept the information to identify the job and kicks off the job.
The framework can be executed either through command line as an independent
program or from any other java program. The information on how to kickoff using
these two methods available in main(String[])
and process(java.util.Map)
methods of this class.
Field Summary | |
static java.lang.String |
JOB_NAME_KEY_NAME
Name of the parameter key holds the job name in configuration map which is job-name . |
Method Summary | |
static void |
main(java.lang.String[] args)
This method provides the interface to execute the jobs from command line. |
static ErrorCode |
process(java.util.Map configMap)
This method provides the interface to execute the job from another java program. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String JOB_NAME_KEY_NAME
job-name
.
Method Detail |
public static ErrorCode process(java.util.Map configMap)
This method provides the interface to execute the job from another java
program. This accepts the job name and additional configuration information
relate to this job as a key value pairs in the map. Among these entries
in the map, there should be a job-name parameter key available to
identify the job to be executed.
Map configMap=new HashMap(); configMap.put("job-name","process_file_abc"); configMap.put("config-name1","config-value1"); configMap.put("config-name2","config-value2"); ErrorCode exitCode=Main.process(configMap); System.out.println("Job exited with return code : " + exitCode.getCode());
configMap
- Map object consist of all the properties needed to kick off this batch job.
java.lang.IllegalArgumentException
- If input configMap is null.public static void main(java.lang.String[] args)
This method provides the interface to execute the jobs from command line. This accepts the job name and additional configuration information related to this job as a command line parameters. Each parameter passed through command line should be in the format name=value. Among these, job-name=process_file_abc property should exist to identify the job to kick off. The ErrorCode's code value will be returned as exit code.
The format to invoke the job using this interface is as follows.
java org.jmonks.batch.framework.Main job-name=process_file_abc config-name1=config-value1 config-name2=config-value2
Whatever the configuration paremters passed here can be retrieved using
the JobContext reference passed to all the jobs either using their initialize
methods or process methods.
args
- Configuration details in command line params as name=value format
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |