0

I need to create stand alone application only for processing periodical tasks. Currently I did it by using Spring with @Scheduled tasks, but I don't like while(true) construction.

public static void main(final String[] args) {
    final ApplicationContext context = new ClassPathXmlApplicationContext("application-context.xml");
    while (true) ;
}

Is there a better solution, like sleeping current thread?

ekitru
  • 172
  • 1
  • 5
  • 16
  • 1
    quartz is a good scheduler... you may want to take a look. – Kent Mar 03 '15 at 10:57
  • I already have spring oriented code and it is quite straight forward to use @Scheduled annotation on tasks/ – ekitru Mar 03 '15 at 10:58
  • I found good answer for me http://stackoverflow.com/questions/12176923/scheduled-method-in-a-standalone-application-in-spring – ekitru Mar 03 '15 at 10:58

0 Answers0