Results 1 to 4 of 4

Thread: @Scheduled fixedRate PropertyPlaceholder support

  1. #1
    Join Date
    May 2009
    Location
    Chicago, USA
    Posts
    87

    Default @Scheduled fixedRate PropertyPlaceholder support

    Hi,

    I've been using @Scheduled a lot (great stuff) but I noticed today that only the "cron" attribute of the annotation supports property placeholder configuration since the other two fields are long type.

    I couldn't think of any non-ackward solutions to this but I'm trying to set up a @Scheduled with a fixedRate that is defined by a placeholder property. From the looks of it I will have to use the actual Task Scheduling classes to implement this.

    Would it be reasonable to have a fixedRateString and fixedDelayString added to @Scheduled so that they could be processed and converted into long's by the container or is this a bad way to add features to an annotation?

    Thanks.

  2. #2
    Join Date
    Dec 2008
    Posts
    4

    Default

    Did you find out a solution ? I'm having the same issue.

  3. #3
    Join Date
    May 2009
    Location
    Chicago, USA
    Posts
    87

    Default

    Sorry, haven't got a solution. Should probably make a JIRA since this is a bit simple... I just haven't had to follow through with needing yet.

  4. #4
    Join Date
    Dec 2008
    Posts
    4

    Default

    Code:
    @Scheduled(cron = "${update.interval.cron.value}")
    public void doSomething(){...}
    
    <context:property-placeholder location="myConfig.properties"/>
    this works for me.

Posting Permissions

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