Announcement Announcement Module
Collapse
No announcement yet.
@Scheduled fixedRate PropertyPlaceholder support Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • @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
    Did you find out a solution ? I'm having the same issue.

    Comment


    • #3
      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.

      Comment


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

        Comment

        Working...
        X