javax.ejb

Interface TimerService

public interface TimerService

The timer interface

Method Summary

Timer
createTimer(Date expiration, Serializable info)
Creates a timer
Timer
createTimer(Date expiration, long interval, Serializable info)
Creates a timer
Timer
createTimer(long duration, Serializable info)
Creates a timer for a duration.
Timer
createTimer(long initialDuration, long intervalDuration, Serializable info)
Creates an interval timer
Collection<E>
getTimers()
Returns the timers

Method Details

createTimer

public Timer createTimer(Date expiration,
                         Serializable info)
            throws EJBException
Creates a timer
Usages and Demos :

View More Examples of createTimer(Date expiration,Serializable info)
   1: 
   2:     @Resource javax.ejb.TimerService timerService;
   3: 
   4:         ...
   5: 
   6:         for (Object obj : timerService.getTimers()) {
   7:             javax.ejb.Timer timer = (javax.ejb.Timer)obj;
   8:         ...
   9: 
  10:         timerService.createTimer(dateOf, item);
  11:     }

View Full Code Here
   1: import javax.ejb.TimerHandle;
   2: import javax.ejb.TimerService;
   3: 
   4:         ...
   5:     public void shedule(long time) {
   6:         TimerService timerService = context.getTimerService();
   7:         ...
   8:         timerService.createTimer(time, null);
   9:     }

View Full Code Here

createTimer

public Timer createTimer(Date expiration,
                         long interval,
                         Serializable info)
            throws EJBException
Creates a timer

createTimer

public Timer createTimer(long duration,
                         Serializable info)
            throws EJBException
Creates a timer for a duration.
Usages and Demos :

View More Examples of createTimer(long duration,Serializable info)
   1: 
   2:     @Resource javax.ejb.TimerService timerService;
   3: 
   4:         ...
   5: 
   6:         for (Object obj : timerService.getTimers()) {
   7:             javax.ejb.Timer timer = (javax.ejb.Timer)obj;
   8:         ...
   9: 
  10:         timerService.createTimer(dateOf, item);
  11:     }

View Full Code Here
   1: import javax.ejb.TimerHandle;
   2: import javax.ejb.TimerService;
   3: 
   4:         ...
   5:     public void shedule(long time) {
   6:         TimerService timerService = context.getTimerService();
   7:         ...
   8:         timerService.createTimer(time, null);
   9:     }

View Full Code Here

createTimer

public Timer createTimer(long initialDuration,
                         long intervalDuration,
                         Serializable info)
            throws EJBException
Creates an interval timer

getTimers

public Collection<E> getTimers()
            throws EJBException
Returns the timers
Usages and Demos :

View More Examples of getTimers()
   1: 
   2:     @Resource javax.ejb.TimerService timerService;
   3: 
   4:         ...
   5: 
   6:         for (Object obj : timerService.getTimers()) {
   7:             javax.ejb.Timer timer = (javax.ejb.Timer)obj;
   8:         ...
   9: 
  10:         timerService.createTimer(dateOf, item);
  11:     }

View Full Code Here