InterviewSolution
| 1. |
What Is Commandlinejobrunner In Spring Batch? |
|
Answer» COMMANDLINEJOBRUNNER is one of the ways to BOOTSTRAP your Spring batch Job. The xml script launching the job needs a Java CLASS main method as as entry point and CommandLineJobRunner helps you to start your job directly using the XML script. The CommandLineJobRunner performs 4 tasks: Load the APPROPRIATE ApplicationContext. Parse command LINE arguments into JobParameters. Locate the appropriate job based on arguments. Use the JobLauncher provided in the application context to launch the job.. The CommandLineJobRunner arguments are jobPath, the location of the XML file that will be used to create an ApplicationContext and the jobName, the name of the job to be run. bash$ java CommandLineJobRunner DailyJobConfig.xml processDailyJob These arguments must be passed in with the path first and the name second. All arguments after these are considered to be JobParameters and must be in the format of 'name=value'. CommandLineJobRunner is one of the ways to bootstrap your Spring batch Job. The xml script launching the job needs a Java class main method as as entry point and CommandLineJobRunner helps you to start your job directly using the XML script. The CommandLineJobRunner performs 4 tasks: Load the appropriate ApplicationContext. Parse command line arguments into JobParameters. Locate the appropriate job based on arguments. Use the JobLauncher provided in the application context to launch the job.. The CommandLineJobRunner arguments are jobPath, the location of the XML file that will be used to create an ApplicationContext and the jobName, the name of the job to be run. bash$ java CommandLineJobRunner DailyJobConfig.xml processDailyJob These arguments must be passed in with the path first and the name second. All arguments after these are considered to be JobParameters and must be in the format of 'name=value'. |
|