Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Task Sheduling

 
crazzzy coder
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
How can i shedule one task in java daily , weekly monthly with out using java.util.timer

thanks in advance
 
Ove Lindström
Ranch Hand
Posts: 326
Android Firefox Browser Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
crazzzy coder wrote:Hi All,
How can i shedule one task in java daily , weekly monthly with out using java.util.timer

thanks in advance



You use the Scheduled Executor Service. http://download.oracle.com/javase/1,5.0/docs/api/java/util/concurrent/ScheduledExecutorService.html
 
Ove Lindström
Ranch Hand
Posts: 326
Android Firefox Browser Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And welcome to the ranch.

Please take a look at http://www.javaranch.com/name.jsp and then go into your profile and correct the name.
 
crazzzy coder
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks..........
 
Tim Moores
Bartender
Posts: 2798
38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
with out using java.util.timer

Reading something like this, I always wonder: is there an actual reason for that, or is it more like a manager-doesn't-like-feature-X-so-forbids-it-for-no-good-reason-and-nobody-dares-question-him kind of things.
 
Ove Lindström
Ranch Hand
Posts: 326
Android Firefox Browser Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Moores wrote:
with out using java.util.timer

Reading something like this, I always wonder: is there an actual reason for that, or is it more like a manager-doesn't-like-feature-X-so-forbids-it-for-no-good-reason-and-nobody-dares-question-him kind of things.


Most likely yes. But it is often the lead system architect that makes the decision to "start using the concurrency package since it is easier and more robust than using timers" and then communicates that with the manager. The thing with managers is that they tend to only remember the last part of a sentence. So they say "you are not allowed to use timers. They are not robust." ;)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic