Results 1 to 3 of 3

Thread: Default JobParameters

  1. #1
    Join Date
    Apr 2010
    Posts
    8

    Default Default JobParameters

    I wish to declare a step-scoped listener, common to many jobs which prepends its logging statements with a job-specific tag (i.e. "JOB1 : chunk committed"). The simplest configuration for the common listener is to configure as:
    Code:
    <bean ... scope="step" p:logToken="#{jobParameters[logToken]}" />
    There are a few more reductions that I am planning around the same pattern if someone can help explain how to achieve it!

    The "logToken" job property is essentially "static". I want each job to declare it alongside the job itself such that no invoker of the job (JobLauncher, Quartz or anything else) has to specify or know about it.

    How do I do this? On perhaps a related note, can I define a set of default JobParameters?

  2. #2
    Join Date
    Jun 2005
    Posts
    4,231

    Default

    You can do that with a simple custom wrapper for the JobLauncher, right? JobParametersIncrementer and JobParametersValidator might also be relevant. Or, if all you need is the job name, you can simply use a different late binding expression to pull that out at runtime: #{jobName} should work I think (from memory).

  3. #3
    Join Date
    Apr 2010
    Posts
    8

    Default

    Thanks, I'll look at those other classes. My requirement for success is that these "static" job parameters get added automatically no matter how the job is invoked.

Posting Permissions

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