Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

schedule a task

 
Sherif Shehab
Ranch Hand
Posts: 485
Android Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi pals ,

i need to run a specific class in 12 am everyday, except predefined 2 days in the week , i found the TimerTask class but i saw it will not provide me to stop in the 2 days i want , so any recommendation to accomplish this ?
 
Wouter Oet
Saloon Keeper
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use your os's scheduling system, quartz or build something yourself using something like Timer.
 
Rob Spoor
Sheriff
Pie
Posts: 20511
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the operating system. Linux has cron, Windows has its own Scheduled Tasks / Task Scheduler. Both give you a lot of freedom, and you don't need to have your application running in the background all the time. With Windows you'll need to go to the more advanced settings, but even these are not really advanced.
 
Sherif Shehab
Ranch Hand
Posts: 485
Android Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
unfortunately i'm using windows , So what do you think the professional way to accomplish this, is by using Quartz or windows schedule task ?
 
Rob Spoor
Sheriff
Pie
Posts: 20511
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see one as being more professional than the other. I'd use the Windows Task Scheduler, but that's because it's easier to configure. And of course you should document that there is a scheduled task and what it's for
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic