• Post Reply Bookmark Topic Watch Topic
  • New Topic

TimerTask Execution  RSS feed

 
palmari sivasubramanian
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
 
Stan James
(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?
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!