This content has been marked as final.
Show 1 reply
-
1. Re: How to (re)start or stop the default Timer ?
lvdberg Jun 17, 2011 6:04 PM (in response to serkan.s.eskici.online.nl)Hi,
Let's assume you have a class with following method:
class YourTimer ... @Transactional @Asynchronous public QuartzTriggerHandle checkMessages(@Expiration Date when, @IntervalDuration Long interval, @FinalExpiration Date endDate){ process(); return null; }
This timer is called from a bean YourBean:
class YourBean .... @In(create=true) YourTimer yourTimer; private QuartzTriggerHandle timerHandle;
Which somewhere in the bean calls:
timerHandle = yourTimer.checkMessages(cal.getTime(), 600000L, null);
After the call you have a handle of the timer and you can do what you want.
Although it looks strange. The Timer method is intercepted, so it returns a handle instead of the null.Hopefully this helps a bit.
Leo