java - How can I call a function every day at 00:00 in my web service -


my problem have restful web service using class gestion. in class, have function _update_, , call function everyday @ 00:00.

i had no idea how that, looked web, , found using threads might option. however, don't know how can use it. have move _update_ function new class ?

if using ejb can use timer service

@singleton public class timerservice {     @inject     helloservice helloservice;      @schedule(second="0", minute="0", hour="0")     public void update(){         system.out.println("timer: " + helloservice.sayhello());     } } 

https://docs.oracle.com/javaee/7/tutorial/ejb-basicexamples004.htm


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -