0

Is it possible to timeout all stateless beans at once? IF possible, how?

lego.warrior
  • 342
  • 3
  • 16
  • What do you mean by "timeout"? Are you asking "how can I remove all stateless beans from the pool?" or "how can I prevent EJBs from being pooled in the first place" or something else? – Brett Kail Oct 21 '14 at 03:42
  • Stateless beans have a function annotated @timeout. I have set these functions to do a specific task every X number of minutes. What i want is to get all stateless beans to execute their timeout methods at once. – lego.warrior Oct 23 '14 at 17:49
  • When you say "at once", do you mean "at the same time"? Rather than trying to coordinate distinct timers for each beans, can you instead create a single timer that invokes a method on all the individual beans? – Brett Kail Oct 23 '14 at 19:41
  • yes, i mean at the same time. :) I don't want a single timer, but i would like to know whether that is possible as well. What i want is a method that invokes all the timeout functions at the same time. :) – lego.warrior Oct 25 '14 at 01:54
  • The obvious answer seems to be to use TimerService to create timers with a Date. What have you tried so far, and why didn't it work? – Brett Kail Oct 25 '14 at 15:42
  • At the moment, i have them all firing the @timeout annotated function every X minutes. Your date suggestion is something interesting to think about. Do you think it is possible to get the @ timeout annotated function on all beans to fire on one event, such as a button click? sorry, if i sound like a broken record:) – lego.warrior Oct 25 '14 at 20:30
  • No, there is no way to cause an immediate timeout of a prescheduled timer. I think the best choice would be to do the action immediately and then cancel the timer. – Brett Kail Oct 27 '14 at 02:49

0 Answers0