• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

TimerTask Execution

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic