public interface TimerService
Modifier and Type | Method and Description |
---|---|
Timer |
createCalendarTimer(ScheduleExpression schedule)
Create a calendar-based timer based on the input schedule expression.
|
Timer |
createCalendarTimer(ScheduleExpression schedule,
TimerConfig timerConfig)
Create a calendar-based timer based on the input schedule expression.
|
Timer |
createIntervalTimer(Date initialExpiration,
long intervalDuration,
TimerConfig timerConfig)
Create an interval timer whose first expiration occurs at a given
point in time and whose subsequent expirations occur after a specified
interval.
|
Timer |
createIntervalTimer(long initialDuration,
long intervalDuration,
TimerConfig timerConfig)
Create an interval timer whose first expiration occurs after a specified
duration, and whose subsequent expirations occur after a specified
interval.
|
Timer |
createSingleActionTimer(Date expiration,
TimerConfig timerConfig)
Create a single-action timer that expires at a given point in time.
|
Timer |
createSingleActionTimer(long duration,
TimerConfig timerConfig)
Create a single-action timer that expires after a specified duration.
|
Timer |
createTimer(Date initialExpiration,
long intervalDuration,
Serializable info)
Create an interval timer whose first expiration occurs at a given
point in time and whose subsequent expirations occur after a specified
interval.
|
Timer |
createTimer(Date expiration,
Serializable info)
Create a single-action timer that expires at a given point in time.
|
Timer |
createTimer(long initialDuration,
long intervalDuration,
Serializable info)
Create an interval timer whose first expiration occurs after a specified
duration, and whose subsequent expirations occur after a specified
interval.
|
Timer |
createTimer(long duration,
Serializable info)
Create a single-action timer that expires after a specified duration.
|
Collection<Timer> |
getAllTimers()
Returns all active timers associated with the beans in the same module in
which the caller bean is packaged.
|
Collection<Timer> |
getTimers()
Returns all active timers associated with this bean.
|
Timer createTimer(long duration, Serializable info) throws IllegalArgumentException, IllegalStateException, EJBException
duration
- the number of milliseconds that must elapse before
the timer expires.info
- application information to be delivered along
with the timer expiration notification. This can be null.IllegalArgumentException
- If duration is negativeIllegalStateException
- If this method is
invoked while the instance is in a state that does not allow access
to this method.EJBException
- If this method fails due to a
system-level failure.Timer createSingleActionTimer(long duration, TimerConfig timerConfig) throws IllegalArgumentException, IllegalStateException, EJBException
duration
- the number of milliseconds that must elapse before
the timer expires.timerConfig
- timer configuration.IllegalArgumentException
- If duration is negativeIllegalStateException
- If this method is
invoked while the instance is in a state that does not allow access
to this method.EJBException
- If this method fails due to a
system-level failure.Timer createTimer(long initialDuration, long intervalDuration, Serializable info) throws IllegalArgumentException, IllegalStateException, EJBException
initialDuration
- The number of milliseconds that must elapse
before the first timer expiration notification.intervalDuration
- The number of milliseconds that must elapse
between timer expiration notifications. Expiration notifications are
scheduled relative to the time of the first expiration. If expiration
is delayed (e.g. due to the interleaving of other method calls on the
bean), two or more expiration notifications may occur in close
succession to "catch up".info
- application information to be delivered along
with the timer expiration. This can be null.IllegalArgumentException
- If initialDuration is
negative or intervalDuration is negative.IllegalStateException
- If this method is
invoked while the instance is in a state that does not allow access
to this method.EJBException
- If this method could not complete
due to a system-level failure.Timer createIntervalTimer(long initialDuration, long intervalDuration, TimerConfig timerConfig) throws IllegalArgumentException, IllegalStateException, EJBException
initialDuration
- The number of milliseconds that must elapse
before the first timer expiration notification.intervalDuration
- The number of milliseconds that must elapse
between timer expiration notifications. Expiration notifications are
scheduled relative to the time of the first expiration. If expiration
is delayed (e.g. due to the interleaving of other method calls on the
bean), two or more expiration notifications may occur in close
succession to "catch up".timerConfig
- timer configurationIllegalArgumentException
- If initialDuration is
negative or intervalDuration is negative.IllegalStateException
- If this method is
invoked while the instance is in a state that does not allow access
to this method.EJBException
- If this method could not complete
due to a system-level failure.Timer createTimer(Date expiration, Serializable info) throws IllegalArgumentException, IllegalStateException, EJBException
expiration
- The point in time at which the timer must expire.info
- application information to be delivered along
with the timer expiration notification. This can be null.IllegalArgumentException
- If expiration is null or
expiration.getTime() is negative.IllegalStateException
- If this method is
invoked while the instance is in a state that does not allow access
to this method.EJBException
- If this method could not complete
due to a system-level failure.Timer createSingleActionTimer(Date expiration, TimerConfig timerConfig) throws IllegalArgumentException, IllegalStateException, EJBException
expiration
- the point in time at which the timer must expire.timerConfig
- timer configuration.IllegalArgumentException
- If expiration is null or
expiration.getTime() is negative.IllegalStateException
- If this method is
invoked while the instance is in a state that does not allow access
to this method.EJBException
- If this method could not complete
due to a system-level failure.Timer createTimer(Date initialExpiration, long intervalDuration, Serializable info) throws IllegalArgumentException, IllegalStateException, EJBException
initialExpiration
- the point in time at which the first timer
expiration must occur.intervalDuration
- the number of milliseconds that must elapse
between timer expiration notifications. Expiration notifications are
scheduled relative to the time of the first expiration. If expiration
is delayed (e.g. due to the interleaving of other method calls on the
bean), two or more expiration notifications may occur in close
succession to "catch up".info
- application information to be delivered along
with the timer expiration. This can be null.IllegalArgumentException
- If
initialExpiration is null, if initialExpiration.getTime() is
negative, or if intervalDuration is negative.IllegalStateException
- If this method is
invoked while the instance is in a state that does not allow access
to this method.EJBException
- If this method could not complete
due to a system-level failure.Timer createIntervalTimer(Date initialExpiration, long intervalDuration, TimerConfig timerConfig) throws IllegalArgumentException, IllegalStateException, EJBException
initialExpiration
- the point in time at which the first timer
expiration must occur.intervalDuration
- the number of milliseconds that must elapse
between timer expiration notifications. Expiration notifications are
scheduled relative to the time of the first expiration. If expiration
is delayed (e.g. due to the interleaving of other method calls on the
bean), two or more expiration notifications may occur in close
succession to "catch up".timerConfig
- timer configuration.IllegalArgumentException
- If
initialExpiration is null, if initialExpiration.getTime() is
negative, or if intervalDuration is negative.IllegalStateException
- If this method is
invoked while the instance is in a state that does not allow access
to this method.EJBException
- If this method could not complete
due to a system-level failure.Timer createCalendarTimer(ScheduleExpression schedule) throws IllegalArgumentException, IllegalStateException, EJBException
schedule
- a schedule expression describing the timeouts
for this timer.IllegalArgumentException
- If Schedule represents an
invalid schedule expression.IllegalStateException
- If this method is
invoked while the instance is in a state that does not allow access
to this method.EJBException
- If this method could not complete
due to a system-level failure.Timer createCalendarTimer(ScheduleExpression schedule, TimerConfig timerConfig) throws IllegalArgumentException, IllegalStateException, EJBException
schedule
- a schedule expression describing the timeouts for this timer.timerConfig
- timer configuration.IllegalArgumentException
- If Schedule represents an
invalid schedule expression.IllegalStateException
- If this method is
invoked while the instance is in a state that does not allow access
to this method.EJBException
- If this method could not complete
due to a system-level failure.Collection<Timer> getTimers() throws IllegalStateException, EJBException
javax.ejb.Timer
objects.IllegalStateException
- If this method is
invoked while the instance is in a state that does not allow access
to this method.EJBException
- If this method could not complete
due to a system-level failure.Collection<Timer> getAllTimers() throws IllegalStateException, EJBException
javax.ejb.Timer
objects.IllegalStateException
- If this method is
invoked while the instance is in a state that does not allow access
to this method.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.