I keep seeing wrap the JobLauncher, can some one point me to an example , or paste an example of how this is done. I need to use it in a regular app, not command line or webapp. Thanks.
I keep seeing wrap the JobLauncher, can some one point me to an example , or paste an example of how this is done. I need to use it in a regular app, not command line or webapp. Thanks.
I should clarify, I am trying to follow the sugestion that is in this thread. I can setup a wrapped joblauncher by delegating, but all i know how to do at that point is call the run of the delegate again. Thanks
Brian,
I'm the one who initiated the post you refer to.
For what I understand from your post, my requirements were different than yours but for my specific needs, it has been solved using the "partitioning" features (PartitionStep and Partitioner interface).
Regarding a custom JobLauncher implementation, have a look at SimpleJobLauncher from Batch sources. It gives a good idea.
Regards,
Gino.
You mentioned some code in the eariler thread where you loop through resouces, how did you get those resources, i am using 1.1.4, and I need to be able to capture the file name in a multipleResourceReader. Thanks for you help.
I think the suggestion was to not use the MultiResourceLineReader, and launch separate jobs for each file, e.g. in your wrapper
I guess another thing you could do if you needed MultiResourceLineReader is write a delegate reader that wraps the FlatFileItemReader (or other) and capture the resource in the open() method.Code:for (Resource resource : resources) { jobLauncher.run(job, getJobParameters(resource); }
I wrapped the flatfile reader, but I must of been blind, i didn't notice the open passed got passed execution context, probably lack of sleep.