-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
  • 23,261
  • 7
  • 71
  • 99
IAdapter
  • 62,595
  • 73
  • 179
  • 242

3 Answers3

1

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

Evgeniy Dorofeev
  • 133,369
  • 30
  • 199
  • 275
0

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

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
mightyrick
  • 910
  • 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,168
  • 1
  • 24
  • 37