[jboss-user] [EJB3] - TimerBean: Only one @Timeout on SLSB?

Pasquale Imbemba do-not-reply at jboss.com
Tue Sep 20 02:33:36 EDT 2011


Pasquale Imbemba [http://community.jboss.org/people/pi4630] created the discussion

"TimerBean: Only one @Timeout on SLSB?"

To view the discussion, visit: http://community.jboss.org/message/627369#627369

--------------------------------------------------------------
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.


Thanks
~pasquale
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/627369#627369]

Start a new discussion in EJB3 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2029]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110920/23a7a8c7/attachment-0001.html 


More information about the jboss-user mailing list