thuy nguyen wrote:I cut and paste this paragraph from the specification:
The message-driven bean class may have superclasses and/or superinterfaces. If the message-driven
bean has superclasses, the methods of the message listener interface, lifecycle callback interceptor
methods, the timeout method, the ejbCreate method, and the methods of the MessageDriven-
Bean interface may be defined in the message-driven bean class or in any of its superclasses. A message-
driven bean class must not have a superclass that is itself a message-driven bean class
Since a MDB can not subclass another MDB, it can only subclass a POJO. It is strange that a POJO can have
"the methods of the message listener interface, lifecycle callback interceptor methods, the timeout method, the ejbCreate method, and the methods of the MessageDriven-Bean interface"
Prasad Kumbhare wrote:If I understand your question correctly about Timer, you want to know how Timer works. Right ? I didn't get your question correctly I apologize.
Timer can be two types, programmatic and automatic.
For Programmatic Timer, you inject TimerService in your Bean and create Timer programmatically using one of the 4 createTimer methods of TimerService.
When Bean instantiates and come to the point where it can create timer, it creates Timer instance and Timer executes timeout callback method as specified while creating timer.
For Automatic Timer, we can use @Scheduler. You can specify when you want to run a particular task in schedule. Timer gets created automatically.
Timer doesn't die with Bean. Once it gets created and bean dies still Timer can execute in the server.
Below URL has some more good information on timer.
Timers in EJB3
Thanks.