Spring Batch
  1. Spring Batch
  2. BATCH-2071

Add Thread Context Class Loading for batch artifacts (JSR-352 section 10.5)

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Complete
    • Affects Version/s: None
    • Fix Version/s: 3.0.0
    • Component/s: Core
    • Labels:
      None

      Description

      There are three options for loading batch artifacts via JSR-352. An implementation specific way if desired (would be Spring DI in our case), an artifact loader that looks for a batch.xml file located in /META-INF/ of the artifact or (if the others do not return the required artifact) a thread context classloader. Section 10.5 of JSR-352 defines the thread context classloader requirement as such:

      3. Thread Context Class Loader
      If the archive loader fails to resolve a batch artifact reference (returns null), then the batch runtime implementation must resolve the reference by treating the reference as a class name and loading it through the thread context class loader. The loader must return an instance or null.

      This will probably require a component implementing BeanClassLoaderAware to add the bean to the current context.

      TCK test com.ibm.jbatch.tck.tests.jslxml.ExecutionTests#testInvokeJobUsingTCCL validates this functionality.

        Activity

        Show
        Michael Minella added a comment - Pull request: https://github.com/SpringSource/spring-batch/pull/215

          People

          • Assignee:
            Michael Minella
            Reporter:
            Michael Minella
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 5d
              5d
              Remaining:
              Remaining Estimate - 5d
              5d
              Logged:
              Time Spent - Not Specified
              Not Specified