Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

@Timeout and the EJB3 Timer Service  RSS feed

 
Cainiao Zou
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In all online examples about EJB3 Timer Service is the Timeout function wroten in the same Bean class which calles createTimer(). I think, there is no parameter about Timeout class in the overloaded createTimer() functions, so that means the Timeout implementation MUST be wroten in the same class, which calls timerservice.createTimer()? Btw, there must be MAX. only one Timeout implementation, right?

thanks
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cainiao Zou wrote:In all online examples about EJB3 Timer Service is the Timeout function wroten in the same Bean class which calles createTimer(). I think, there is no parameter about Timeout class in the overloaded createTimer() functions, so that means the Timeout implementation MUST be wroten in the same class, which calls timerservice.createTimer()?


A EJB timerservice is associated with a EJB class. When the timerservice is used to create a timer, the timeout method is looked for in the same EJB class to which that timerservice belongs.

Btw, there must be MAX. only one Timeout implementation, right?

You can have a single action timer (which fires only once) and a recurring timer (which fires multiple times, based on the schedule that you use while creating it).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!