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#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...