Uploaded image for project: 'Spring Batch'
  1. Spring Batch
  2. BATCH-2564

Consider Changing AutomaticJobRegistrar to Implement SmartLifeCycle

    Details

      Description

      The AutomaticJobRegistrar is automatically start() ed when a ContextRefreshedEvent is emitted.

      This is too late when components using jobs implement SmartLifecycle.

      It should really implement SmartLifecycle and load jobs in an early-ish phase.

      There is actually a TODO in the code...

      public final void onApplicationEvent(ApplicationEvent event) {
      	// TODO: With Spring 3 a SmartLifecycle is started automatically
          ...
      }
      

      See the referenced Stack Overflow question.

      This can probably be a 4.0 only change; since there's a work-around.

        Attachments

          Activity

            People

            • Assignee:
              mbenhassine Mahmoud Ben Hassine
              Reporter:
              grussell Gary Russell
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: