public interface Timer
Timer
interface contains information about a timer
that was created through the EJB Timer Service.Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cause the timer and all its associated expiration notifications to
be cancelled.
|
TimerHandle |
getHandle()
Get a serializable handle to the timer.
|
Serializable |
getInfo()
Get the information associated with the timer at the time of
creation.
|
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()
Return whether this timer is a calendar-based timer.
|
boolean |
isPersistent()
Return whether this timer has persistent semantics.
|
void cancel() throws IllegalStateException, NoSuchObjectLocalException, EJBException
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.long getTimeRemaining() throws IllegalStateException, NoSuchObjectLocalException, NoMoreTimeoutsException, EJBException
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.javax.ejb.NoMoreTimeoutsExceptions
- Indicates that the
timer has no future timeoutsEJBException
- If this method could not complete due
to a system-level failure.NoMoreTimeoutsException
Date getNextTimeout() throws IllegalStateException, NoSuchObjectLocalException, NoMoreTimeoutsException, EJBException
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.javax.ejb.NoMoreTimeoutsExceptions
- Indicates that the
timer has no future timeoutsEJBException
- If this method could not complete due
to a system-level failure.NoMoreTimeoutsException
ScheduleExpression getSchedule() throws IllegalStateException, NoSuchObjectLocalException, EJBException
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 is not a
calendar-based timer.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 IllegalStateException, NoSuchObjectLocalException, EJBException
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 isCalendarTimer() throws IllegalStateException, NoSuchObjectLocalException, EJBException
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.Serializable getInfo() throws IllegalStateException, NoSuchObjectLocalException, EJBException
info
string that was
passed to the timer creation method or the info
element of the Schedule
annotaiton.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.TimerHandle getHandle() throws IllegalStateException, NoSuchObjectLocalException, EJBException
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 non-persistent timer.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.Copyright © 1996-2017, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.