Apr 15th, 2008, 10:39 PM
question on the CommandLineJobRunner
Base on my observation , spring batch can seperate the job definition config from the container config. That is a very good way.
But why does the CommandLineJobRunner only have one path argument?
Does that mean I have to coupling my job definition config with the container config when I am using the CommandLineJobRunner ?
Apr 15th, 2008, 11:05 PM
No, you don't have to put them in one file. You can use either imports to combine multiple contexts, which is fine if you don't think you'll be changing references very often, or you can use another context file to tie them together, as we do in the samples project.
Apr 16th, 2008, 12:45 AM
Yes, you are right. Now I am using another context file to tie them together. Thanks for ur advice.
Apr 16th, 2008, 10:03 AM
the advantage of one file with imports over multiple files is that it forces you to think about the contents of your application context a little harder. the command line job runner uses autowiring to set properties and we all know how flaky autowiring can be in spring. i think that one file serves as a helpful reminder that all of these beans need to coexist.