Announcement Announcement Module
Collapse
No announcement yet.
Wrapping JobLauncher Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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

    Comment


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

      Comment


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

        Comment


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

          Code:
          for (Resource resource : resources) {
            jobLauncher.run(job, 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.

          Comment


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

            Comment

            Working...
            X