• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

TimerTask Execution  RSS feed

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have one timer task execution method. I am getting last scheduled Execution Time using this scheduledExecutionTime(). If my application crashes by any chance, Can i able to get this last scheduled Execution Time? Please give me some idea regarding this.
private FetchTask() {
Timer timer = new Timer();
TimerTask task = new TimerTask() {
public void run() {
time = scheduledExecutionTime();
getData();
}
};

timer.scheduleAtFixedRate(task, 0, 3000);
}

I am calling this getData method for each timer task.
If the application gone down, i need to get the last scheduled time and get the data.
Please help me regarding this.

Thanks,
Palmari
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the application crashes, anything that you didn't write to an external store, like a database or a file, is gone. So I'm guessing the short answer to your question is "no".

Let's dig a little deeper into what you're doing. If the application crashes, what would you like to have happen when you restart it?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!