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

  • ClassPathXmlApplicationContextJobFactory?

    The documentation refers us to the ClassPathXmlApplicationContextJobFactory as a reference for creating custom job factories. I could not seem to find this class in the sample project however. I looked at the online JavaDocs API for it and it does not seem to be listed there either.

    4.1.3. JobFactory and Stateful Components in Steps

    ...

    The strategy provided by Spring Batch to deal with this scenario is the JobFactory, and the samples provide an example of a specialized implementation that can load an ApplicationContext and close it properly when the job is finished. A relevant examples is ClassPathXmlApplicationContextJobFactory and its use in the adhoc-job-launcher-context.xml and the quartz-job-launcher-context.xml, which can be found in the Samples project.
    I would like to configure the steps required for a job dynamically based on user input. It seems the me the job factory is the proper way to do so. Is that correct? Is a reference factory available?

    Thanks.

    Keith

  • #2
    Perhaps...

    Perhaps its more favorable just to let unnecessary steps fail but still return a job success if they weren't required... looks like that would be the way to fit this into the framework as step/job definitions are configured via XML.

    Keith

    Comment


    • #3
      Or...

      I can set the stepStatus to completed in a stepExecutionListener.beforeStep() if the step is not required...

      That'll work!

      Keith

      Comment

      Working...
      X