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);
}
}