Results 1 to 6 of 6

Thread: Wrapping JobLauncher

  1. #1

    Default 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. #2

    Default

    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. #3
    Join Date
    Feb 2009
    Location
    Montreal, Qc, Canada
    Posts
    23

    Post

    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.

  4. #4

    Default

    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. #5
    Join Date
    Jun 2005
    Posts
    4,230

    Default

    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.

  6. #6

    Default

    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •