Results 1 to 2 of 2

Thread: Access to job statistics from launcher

Hybrid View

  1. #1
    Join Date
    Oct 2007
    Posts
    4

    Default 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. #2
    Join Date
    Jun 2005
    Posts
    4,232

    Default

    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.

Posting Permissions

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