JBoss Community

how to deploy a service pojo depending on ejb timer

reply from Maria Luisa Della Vedova in EJB 3.0 - View the full discussion

Here is the code of my stateless EJB

My EJB is a multiple Timer Object using the TimerService object.

 

@Stateless

@Local(ITimer.class)

public class TheTimerBean implements ITimer {

 

 

      @Resource

      private SessionContext ctx;

 

      @Override

      public void attiva() {

            ctx.getTimerService().createTimer(1 * 1000, 1 * 1000, null);

 

      }

 

      @Timeout

      public void timeOutMethod(Timer timer) {

            …

      }

 

}

Thanks

Reply to this message by going to Community

Start a new discussion in EJB 3.0 at Community