• 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

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)
Ranch Hand
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?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!