• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

Is this possible in spring using annotation/what's the easiest way?

 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
is it possible in spring using just an annotation to execute a method every period (let's say every 7am and 7pm) but will skip to execute the method on the designated time if the initial method is still not finished executing?

For example, at 7am, methodA will execute. On 7pm, if the methodA that was executed on 7am is still not finished, it will not yet execute another one and wait for next 7am. But if finished, will begin executing methodA again.
 
author & internet detective
Posts: 41502
881
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Matt,
On #Scheduled, fixedDelay ensures that two aren't running at once. But it wouldn't run it at 7am/7pm after the first time so that doesn't help.

If I had to do this, I'd have a boolean state value. I'm curious if there is a better way so look forward to watching this thread for replies.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic