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?