0

我正在研究 SpringBatch CommandLineJobRunner。我想从单个作业运行多个作业。这是我的代码。我的代码没问题,但如果 CommandLineJobRunner.presetSystemExiter( new SystemExiter() 不包括它只运行 1 个作业并且不能提供多个作业,我不理解。所以请解释一下这是如何工作的。

 CommandLineJobRunner.presetSystemExiter( new SystemExiter() 
                  { 
                        public void exit( int status ) 
                        {
                    }
                  });

  String[] params1 = { jobConfig1, jobID1, "runId=" + new Date().getTime() };
  CommandLineJobRunner.main(params1);

  String[] params2 = { jobConfig2, jobID2, "runId=" + new Date().getTime() };
  CommandLineJobRunner.main(params2);

非常感谢。

4

1 回答 1

0

简而言之:默认退出程序只是调用 JVM System.exit(),它会终止您的 JVM。

在这里更详细地解释:http: //www.dotkam.com/2011/03/15/spring-batch-commandlinejobrunner-to-run-multiple-jobs/

于 2014-04-10T13:20:38.170 回答