The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
November 2001



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


Re: Scheduled Tasks

Posted by Brian Sanders on November 20, 2001 at 4:47 PM

One possible approach you could take would be to store a "next scheduled run time" in your data file. For example, if you have a task that is to run every Thursday at 9:00am, the next run time would be Thursday, November 22, 2001 9:00am.

Then, for each task, compare the current date/time to the next scheduled run time. If the current time is equal to or greater than the next scheduled run time, do two things:

  • Update the next scheduled run time to Thursday, November 29 2001 9:00am
  • Start the scheduled task.

If this isn't a viable alternative, we'll see what else we can come up with.


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us