[jboss-user] [JBoss Seam] - Re: Problem with TimerService
hasc
do-not-reply at jboss.com
Wed Oct 3 10:19:30 EDT 2007
bean using the TimerService:
@Stateless
| @Name("listener")
| public class DBChangeListenerService implements DBChangeListener {
|
| @Resource TimerService timerservice;
|
| @Logger Log log;
|
| public DBChangeListenerService() {}
|
| public void initTimer() {
| log.info("initTimer");
| timerservice.createTimer(2*60*1000, 2*60*1000,"DBChangeListener");
| }
|
| @Timeout
| public void queryState(Timer timer) {
| log.info("query db state");
| }
| }
and the bean calling the initTimer() method
| @Stateless
| @AutoCreate
| @Name("objectcache")
| public class ObjectCacheService implements ObjectCache{
|
|
| @In(create=true)
| DBChangeListenerService listener;
|
| public void init() {
| listener.initTimer();
| }
| }
|
Thanks for your help
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4091078#4091078
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4091078
More information about the jboss-user
mailing list