JBoss Community

the timer service has beean disabled,please add a entry into the ejb section

created by Icey Thomas in EJB Development - View the full discussion

Dear all,

      I want to create a timer-service on JBoss As 7.0.here is my work:

     

@Singleton
@Local(UserLocal.class)
@Startup
public class User implements UserLocal
{
          @Resource
          TimerService timer;
          
          @Timeout
          public void run(Timer timer)
          {
                   System.out.println("time out!");
          }
          @PostConstruct
          public void scheduleTimer()
          {
                   timer.createTimer(new Date(),1000*1*60,null);
           }
}

Reply to this message by going to Community

Start a new discussion in EJB Development at Community