Methods Summary |
---|
public void | cancel()Cause the timer and all its associated expiration notifications to be cancelled.
checkState();
try {
// TODO: call TimerServiceImpl.cancelTimer instead
scheduler.unscheduleJob(trigger.getName(), trigger.getGroup());
}
catch(SchedulerException e) {
log.error("cancel failed", e);
throw new EJBException(e.getMessage());
}
|
protected void | checkState()
// TODO: implement bean state checking to see if a call is allowed
if(trigger.getNextFireTime() == null)
throw new NoSuchObjectLocalException("timer has expired");
|
public javax.ejb.TimerHandle | getHandle()Get a serializable handle to the timer. This handle can be used at a later time to re-obtain the timer reference.
checkState();
return null; // FIXME: implement getHandle
|
public java.io.Serializable | getInfo()Get the information associated with the timer at the time of creation.
checkState();
return info;
|
public java.util.Date | getNextTimeout()Get the point in time at which the next timer expiration is scheduled to occur.
checkState();
Date nextTimeout = trigger.getNextFireTime();
if(nextTimeout == null)
throw new IllegalStateException("trigger does not have a next fire time"); // TODO: proper EJB3 state check & exception
return nextTimeout;
|
public long | getTimeRemaining()Get the number of milliseconds that will elapse before the next scheduled timer expiration.
// leave all checks to getNextTimeout
return getNextTimeout().getTime() - System.currentTimeMillis();
|