1 22 package org.jboss.ejb3.test.timerdependency; 23 24 25 import javax.annotation.Resource; 26 import javax.ejb.Local ; 27 import javax.ejb.Stateless ; 28 import javax.ejb.Timeout ; 29 import javax.ejb.Timer ; 30 import javax.ejb.TimerService ; 31 32 import org.jboss.logging.Logger; 33 34 35 42 @Stateless 43 @Local ({TimerTest.class}) 44 public class TimerTestBean implements TimerTest { 45 @Resource 46 TimerService timerService; 47 48 private static final Logger log = Logger.getLogger(TimerTestBean.class); 49 50 public void createTimer(long intervalDuration) { 51 timerService.createTimer(intervalDuration, "Created new timer"); 52 log.info("created timer in TimerTestBean"); 53 } 54 55 @Timeout 56 public void timeout(Timer timer) { 57 log.info("TimerTestBean: timeout occurred"); 58 } 59 } 60 | Popular Tags |