• 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:

Spring scheduler query

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have to schedule a task in my spring mvc application one hour after an event occurs. I have read about the TimerTask which is based on the Java Timer class and also I have read about the Quartz scheduler. Both of these are for periodical execution of a task either on application startup or periodic after every specific interval of time. I want my method to execute one hour after some condition is met in one of my beans only once.
Is it fair to assume that I will have to make use of the raw java Timer class by specifying the delay as one hour and period as zero, and not use what spring offers because it does not suffice my requirement?
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
TimerTask and Quartz can both do "execute this in one hour, no repeats" - it's just a matter of which you prefer.
 
reply
    Bookmark Topic Watch Topic
  • New Topic