Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class RunApp {
- public static void main(String[] args) {
- String[] springConfig = { "hello-job.xml" };
- ApplicationContext context = new ClassPathXmlApplicationContext(
- springConfig);
- JobLauncher jobLauncher = (JobLauncher) context.getBean("jobLauncher");
- Job job = (Job) context.getBean("helloJob");
- try {
- JobExecution execution = jobLauncher.run(job, new JobParameters());
- System.out.println("Exit Status : " + execution.getStatus());
- } catch (Exception e) {
- e.printStackTrace();
- }finally{
- ((AbstractApplicationContext)context).close();
- }
- System.out.println("Done");
- }
- }
- <import resource="classpath:/config/hello-job.xml" />
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement