@Stateless public class TimerSessionBean implements TimerSession { @Resource TimerService timerService; public void startTimer() { Timer timer = timerService.createTimer(200, "Created new timer"); } @Timeout public void timeout(Timer timer) { logger.info("Timeout occurred"); } }
public void createTimer(Date initialExpiration, long intervalDuration, Serializable info) { try { logger.log(Level.INFO,"Creating timer on " + InetAddress.getLocalHost().getCanonicalHostName()); } catch (UnknownHostException ex) { Logger.getLogger(DataverseTimerServiceBean.class.getName()).log(Level.SEVERE, null, ex); } timerService.createTimer(initialExpiration, intervalDuration, info); }
public Timer createTimer(long initialDuration, long intervalDuration, Serializable info) throws IllegalArgumentException, IllegalStateException, EJBException { assertAllowedIn("TimerService.createTimer"); return timerService.createTimer(initialDuration, intervalDuration, info); }
public Timer createTimer(Date expiration, Serializable info) throws IllegalArgumentException, IllegalStateException, EJBException { assertAllowedIn("TimerService.createTimer"); return delegate.createTimer(expiration, info); }
public Timer createTimer(long duration, Serializable info) throws IllegalArgumentException, IllegalStateException, EJBException { assertAllowedIn("TimerService.createTimer"); return delegate.createTimer(duration, info); }
public Timer createTimer(long duration, Serializable info) throws IllegalArgumentException, IllegalStateException, EJBException { assertAllowedIn("TimerService.createTimer"); return timerService.createTimer(duration, info); }
public Timer createTimer(long initialDuration, long intervalDuration, Serializable info) throws IllegalArgumentException, IllegalStateException, EJBException { assertAllowedIn("TimerService.createTimer"); return timerService.createTimer(initialDuration, intervalDuration, info); }
public Timer createTimer(Date expiration, Serializable info) throws IllegalArgumentException, IllegalStateException, EJBException { assertAllowedIn("TimerService.createTimer"); return timerService.createTimer(expiration, info); }
public Timer createTimer(long duration, Serializable info) throws IllegalArgumentException, IllegalStateException, EJBException { assertAllowedIn("TimerService.createTimer"); return timerService.createTimer(duration, info); }
public Timer createTimer(Date initialExpiration, long intervalDuration, Serializable info) throws IllegalArgumentException, IllegalStateException, EJBException { assertAllowedIn("TimerService.createTimer"); return timerService.createTimer(initialExpiration, intervalDuration, info); }
public Timer createTimer(long duration, Serializable info) throws IllegalArgumentException, IllegalStateException, EJBException { assertAllowedIn("TimerService.createTimer"); return timerService.createTimer(duration, info); }
public Timer createTimer(Date initialExpiration, long intervalDuration, Serializable info) throws IllegalArgumentException, IllegalStateException, EJBException { assertAllowedIn("TimerService.createTimer"); return timerService.createTimer(initialExpiration, intervalDuration, info); }
@Schedule(hour = "*", minute = "*", second = "*/10", info = "Every 10 second timer") public void printSchedule() { logger.info("ProgrammaticTimer Schedule Fired .... "); ts.createTimer(5000, null); }
public Timer createTimer(long initialDuration, long intervalDuration, Serializable info) throws IllegalArgumentException, IllegalStateException, EJBException { assertAllowedIn("TimerService.createTimer"); return timerService.createTimer(initialDuration, intervalDuration, info); }
public void start() { timerService.createTimer(100, "test"); logger.log("Timer created"); }
public Timer createTimer(Date initialExpiration, long intervalDuration, Serializable info) throws IllegalArgumentException, IllegalStateException, EJBException { assertAllowedIn("TimerService.createTimer"); return delegate.createTimer(initialExpiration, intervalDuration, info); }
/** * @see javax.ejb.TimerService#createTimer(long, long, java.io.Serializable) */ public Timer createTimer(long arg0, long arg1, Serializable arg2) throws IllegalArgumentException, IllegalStateException, EJBException { // Not allowed when called from ejbCreate if (getState() < 2) { throw new IllegalStateException("the instance is not allowed to call this method"); } return getTimerService().createTimer(arg0, arg1, arg2); }
/** * @see javax.ejb.TimerService#createTimer(java.util.Date, java.io.Serializable) */ public Timer createTimer(Date arg0, Serializable arg1) throws IllegalArgumentException, IllegalStateException, EJBException { // Not allowed when called from ejbCreate if (getState() < 2) { throw new IllegalStateException("the instance is not allowed to call this method"); } return getTimerService().createTimer(arg0, arg1); }
public Timer scheduleAsynchronousEvent(String type, Object... parameters) { return new TimerProxy( timerService.createTimer( 0l, new AsynchronousEvent(type, parameters) ) ); }
private void schedule(Date dueDate) { log.debug("registering timer #" + getDbid() + " due " + org.jbpm.pvm.internal.job.TimerImpl.formatDueDate(dueDate)); TimerService timerService = entityContext.getTimerService(); timerService.createTimer(dueDate, null); }