public interface Timer
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cause the timer and all its associated expiration notifications to be
Canceled.
|
TimerHandle |
getHandle()
Get a serializable handle to the timer.
|
java.io.Serializable |
getInfo()
Get the information associated with the timer at the time of creation.
|
java.util.Date |
getNextTimeout()
Get the point in time at which the next timer expiration is scheduled to
occur.
|
ScheduleExpression |
getSchedule()
Get the schedule expression corresponding to this timer.
|
long |
getTimeRemaining()
Get the number of milliseconds that will elapse before the next scheduled
timer expiration.
|
boolean |
isCalendarTimer()
Query whether this timer is a calendar-based timer.
|
boolean |
isPersistent()
Query whether this timer has persistent semantics.
|
void cancel() throws java.lang.IllegalStateException, NoSuchObjectLocalException, EJBException
java.lang.IllegalStateException
- If this method is invoked while the instance is in a state that
does not allow access to this method.NoSuchObjectLocalException
- If invoked on a timer that has expired or has been canceled.EJBException
- If this method could not complete due to a system-level failure.TimerHandle getHandle() throws java.lang.IllegalStateException, NoSuchObjectLocalException, EJBException
java.lang.IllegalStateException
- If this method is invoked while the instance is in a state that
does not allow access to this method.NoSuchObjectLocalException
- If invoked on a timer that has expired or has been canceled.EJBException
- If this method could not complete due to a system-level failure.java.io.Serializable getInfo() throws java.lang.IllegalStateException, NoSuchObjectLocalException, EJBException
java.lang.IllegalStateException
- If this method is invoked while the instance is in a state that
does not allow access to this method.NoSuchObjectLocalException
- If invoked on a timer that has expired or has been canceled.EJBException
- If this method could not complete due to a system-level failure.java.util.Date getNextTimeout() throws java.lang.IllegalStateException, NoSuchObjectLocalException, EJBException
java.lang.IllegalStateException
- If this method is invoked while the instance is in a state that
does not allow access to this method.NoSuchObjectLocalException
- If invoked on a timer that has expired or has been canceled.EJBException
- If this method could not complete due to a system-level failure.long getTimeRemaining() throws java.lang.IllegalStateException, NoSuchObjectLocalException, EJBException
java.lang.IllegalStateException
- If this method is invoked while the instance is in a state that
does not allow access to this method.NoSuchObjectLocalException
- If invoked on a timer that has expired or has been canceled.EJBException
- If this method could not complete due to a system-level failure.ScheduleExpression getSchedule() throws java.lang.IllegalStateException, NoSuchObjectLocalException, EJBException
java.lang.IllegalStateException
- If this method is invoked while the instance is in a state that
does not allow access to this method. Also thrown if invoked on a
timer that was created with one of the non-ScheduleExpression
TimerService.createTimer APIs.NoSuchObjectLocalException
- If invoked on a timer that has expired or has been canceled.EJBException
- If this method could not complete due to a system-level failure.boolean isCalendarTimer() throws java.lang.IllegalStateException, NoSuchObjectLocalException, EJBException
java.lang.IllegalStateException
- If this method is invoked while the instance is in a state that
does not allow access to this method.NoSuchObjectLocalException
- If invoked on a timer that has expired or has been cancelled.EJBException
- If this method could not complete due to a system-level failure.boolean isPersistent() throws java.lang.IllegalStateException, NoSuchObjectLocalException, EJBException
java.lang.IllegalStateException
- If this method is invoked while the instance is in a state that
does not allow access to this method.NoSuchObjectLocalException
- If invoked on a timer that has expired or has been canceled.EJBException
- If this method could not complete due to a system-level failure.