2 Replies Latest reply on Sep 20, 2011 3:21 AM by Pasqualino Imbemba

    TimerBean: Only one @Timeout on SLSB?

    Pasqualino Imbemba Newbie

      I've two private methdos on my SLSB, say A and B.

      Both methods are annotated with @Timeout, return void, and take Timer as an argument.


      Two public methods implemented by the interface are basically doing the same thing: according to which one has been called, the create a TimerInfo instance (a container class [POJO] that implements java.io.Serializable, carrying a "label" and an "element", both String), set this instance as Info when creating the timer. Of course, before I create one, I lookup if a timer with that label and that element already exists.


      My client invokes the exposed method that should finish in having method A invoked.


      I then set two breakpoints, one at the beginning of A, the other at the beginning of B.


      When I debug my SLSB with a timer created with timerInfo set so that method A should be invoked, the breakpoint in A never gets active, but it the one in B! Of course, at the beginning of these private methods I check which timer is calling me and therefore do not execute the logic.


      A workaround could be using @Timeout only on one method, and then call the A or B according to the TimerInfo set, sort of "deviator" method.


      I enclose the sourcecode of my SLSB... I wonder what I've missed or completely got wrong about Timers.