Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

detecting delayed timer after server restart

 
Jonh Smith
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following is taken from the ejb 3.0 spec:

"Timers are persistent objects. In the event of a container crash, any single-event timers that have expired
during the intervening time before container restart must cause the timeout callback method to be
invoked upon restart. Any interval timers that have expired during the intervening time must cause the
timeout callback method to be invoked at least once upon restart."

I have a single-action timer and in case of a server crash that takes long enough so that the timer becomes outdated, I need to make sure that the timeout handling is done in a different way. I was hoping that the getTimeRemaining method would return a negative value in this case but apparently google search indicates otherwise. There seems to be nothing in the standard addressing my need. Is there any easy way to detect a delayed timer due to server restart in the bean's timeout method?

thanks
 
Devaka Cooray
ExamLab Creator
Marshal
Pie
Posts: 4262
229
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"new forjavaranch", please check your private messages regarding an important administrative matter.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic