Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » timerTask query
timerTask query [message #901590] Mon, 13 August 2012 14:52
alexandra123 l is currently offline alexandra123 lFriend
Messages: 4
Registered: August 2012
Junior Member

I am looking for some guidance here.

I have created a timerTask that will run once every 10 minutes. This timerTask prints out a line every 10 minutes to the console.

I now need to consider - crashes, server stopping and restarting etc.

How would I go about making sure that the process is kicked off everytime the server is started and that it can recover from any state ? I am using Eclipse with a Dynamic Web Project.

public Initialize(int seconds){
		Timer timer = new Timer();
		timer.schedule(new timerTask(), 0, 1*600000);
	class timerTask extends TimerTask{		
		public void run(){
			 Date date = new Date();
			 }catch (Exception e) {

Thanks in advance

Previous Topic:ObjectName to read Tomcat configuration
Next Topic:parse part of string
Goto Forum:

Current Time: Sat Jan 22 12:03:51 GMT 2022

Powered by FUDForum. Page generated in 0.02979 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top