I don't know if it would be the best approach, but you do set up a Servlet that
loads on startup and schedules a TimerTask instance using a Timer instance.
For example, in the init method of your Servlet
public void init() throws ServletException {
Timer timer = new Timer();
// This class needs to extend the abstract TimerTask class
// The code to be executed needs to put in the public void run() method
RepeatableTask repeatableTask = new RepeatableTask();
long interval = 1000 * 60 * 5; // 5 minutes in millis
// this will cause the task start immediately and repeat every 5 minutes
timer.scheduleAtFixedRate(repeatableTask, 0, interval);
}
Hope that helps.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961132#3961132
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961132
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user