-2

What sheduler do you recomand for standalone java console application?

Is Quartz the only option?

I want to execute tasks every x minutes and raport the return of operation in a text file.

Nathaniel Waisbrot
  • 21,093
  • 6
  • 69
  • 94
IAdapter
  • 59,319
  • 71
  • 171
  • 240

3 Answers3

1

You can use java.util.Timer or java.util.concurrent.ScheduledExecutorService for this task

Evgeniy Dorofeev
  • 129,181
  • 28
  • 195
  • 266
0

If you are using a Java EE application server, you can use an EJB @Timer for this.

Arjan Tijms
  • 37,353
  • 12
  • 107
  • 135
mightyrick
  • 900
  • 4
  • 6
0

Quartz is a commonly used scheduler library. However it sounds like you need something really simple. Can you just do something like this? (pseudocode)

while (!some_termination_condition) {
   Result r = doTask();
   logResult(r);
   Thread.sleep (x_minutes*60*1000);
}
seand
  • 5,132
  • 1
  • 23
  • 37