• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Eternal process

 
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi friends,

I need in my app something like an eternal process that will run on the server in a quite low priority. I will not have to initialize it, or maybe only once when I restart tomcat.

I am not sure how it should be done in Java.

When it is invoked it should keep on scanning the database for records with dates that have already passed, do something (send an email), set the record's date to some time in the future (according to additional data found in this record), and continue to scan other records... or go to sleep for a while...

Could you please give me some info about how it should be done on a Java server (Tomcat) and what terms should I look into. Should I use daemons?

Thanks, Joseph.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You have given the textbook definition of a daemon.
 
Joseph Sweet
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you.

What do you think about java.util.TimerTask

or Quartz ???

Job Scheduling in Java
 
reply
    Bookmark Topic Watch Topic
  • New Topic