aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes detecting delayed timer after server restart Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "detecting delayed timer after server restart" Watch "detecting delayed timer after server restart" New topic
Author

detecting delayed timer after server restart

Jonh Smith
Ranch Hand

Joined: Mar 18, 2010
Posts: 39
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
Saloon Keeper

Joined: Jul 29, 2008
Posts: 2891
    
  18

"new forjavaranch", please check your private messages regarding an important administrative matter.


Author of ExamLab ExamLab - a free SCJP / OCPJP exam simulator
My Home Page -- Twitter Profile -- JavaRanch FAQ -- How to Ask a Question
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: detecting delayed timer after server restart
 
Similar Threads
Need clarification in TimerService
Doubts - EJB 3.0
Timers
Timer are persisted
Java EE timer service and periodical jobs