Announcement Announcement Module
No announcement yet.
Wrapping JobLauncher Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Wrapping JobLauncher

    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.

  • #2
    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


    • #3

      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.




      • #4
        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.


        • #5
          I think the suggestion was to not use the MultiResourceLineReader, and launch separate jobs for each file, e.g. in your wrapper

          for (Resource resource : resources) {
  , getJobParameters(resource);
          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.


          • #6
            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.