The TimerService interface in javax.ejb package provides facility to access the container-provided Timer Service. The EJB Timer Service works with entity beans, stateless session beans, and message-driven beans to for timer callback events at a particular / after a specified elapsed time/after a specified interval.

This example Code creates a timer:

 TimerService timerService = context.getTimerService();
  Timer timer = timerService.createTimer(2200,"timer creation "); 

When a timer expires then container calls the ejbTimeout method of the corresponding bean implementation class. The ejbTimeout method contains the business logic that handles the timed event.