Announcement Announcement Module
Collapse
No announcement yet.
Access to job statistics from launcher Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Access to job statistics from launcher

    Hi,

    A have written a simple implementation of a job launcher which reads a SimpleJobLauncher from the Spring Batch config file, and invokes the run() method.

    What I would like to do is to print the job statistics after the job has been run. The class SimpleJobExecutionFacade has a method getStatistics(), and is a member varaible of SimpleJobLauncher, however there is no getter i.e. simpleJobLauncher.getSimpleJobExecutionFacade().ge tStatistics() .

    Would this be good idea? Or is there another way of getting statistics?

  • #2
    Isn't SimpleJobLauncher a StatisticsProvider? If it wasn't then it certainly is now. You can also get updates by listening for RepeatOperationsApplicationEvents. Or by looking in the StepContext (using StepContextAware or StepSynchronizationManager).

    By the way, the nightly snapshots now have a fix for BATCH-159 which removes the facade as a public API altogether.

    Comment

    Working...
    X