| java.lang.Object org.jboss.ejb.txtimer.TimerServiceImpl
TimerServiceImpl | public class TimerServiceImpl implements TimerService(Code) | | The TimerService provides enterprise bean components with access to the
container-provided Timer Service. The EJB Timer Service allows entity beans, stateless
session beans, and message-driven beans to be registered for timer callback events at
a specified time, after a specified elapsed time, or after a specified interval.
author: Thomas.Diesler@jboss.org author: Dimitris.Andreadis@jboss.org version: $Revision: 57209 $ since: 07-Apr-2004 |
Method Summary | |
void | addTimer(TimerImpl txtimer) | public Timer | createTimer(long duration, Serializable info) Create a single-action txtimer that expires after a specified duration.
Parameters: duration - The number of milliseconds that must elapse before the txtimer expires. Parameters: info - Application information to be delivered along with the txtimer expirationnotification. | public Timer | createTimer(long initialDuration, long intervalDuration, Serializable info) Create an interval txtimer whose first expiration occurs after a specified duration,
and whose subsequent expirations occur after a specified interval.
Parameters: initialDuration - The number of milliseconds that must elapse before the firsttxtimer expiration notification. Parameters: intervalDuration - The number of milliseconds that must elapse between txtimerexpiration notifications. | public Timer | createTimer(Date expiration, Serializable info) Create a single-action txtimer that expires at a given point in time.
Parameters: expiration - The point in time at which the txtimer must expire. Parameters: info - Application information to be delivered along with the txtimer expirationnotification. | public Timer | createTimer(Date initialExpiration, long intervalDuration, Serializable info) Create an interval txtimer whose first expiration occurs at a given point in time and
whose subsequent expirations occur after a specified interval.
Parameters: initialExpiration - The point in time at which the first txtimer expiration must occur. Parameters: intervalDuration - The number of milliseconds that must elapse between txtimerexpiration notifications. | public Collection | getAllTimers() | public TimedObjectInvoker | getTimedObjectInvoker() | public Timer | getTimer(TimerHandle handle) | public Collection | getTimers() Get all the active timers associated with this bean. | Transaction | getTransaction() | void | removeTimer(TimerImpl txtimer) | void | retryTimeout(TimerImpl txtimer) | public void | shutdown(boolean keepState) |
addTimer | void addTimer(TimerImpl txtimer)(Code) | | Add a txtimer to the list of active timers
|
createTimer | public Timer createTimer(long duration, Serializable info) throws IllegalArgumentException, IllegalStateException, EJBException(Code) | | Create a single-action txtimer that expires after a specified duration.
Parameters: duration - The number of milliseconds that must elapse before the txtimer expires. Parameters: info - Application information to be delivered along with the txtimer expirationnotification. This can be null. The newly created Timer. throws: IllegalArgumentException - If duration is negative throws: IllegalStateException - If this method is invoked while the instance is ina state that does not allow access to this method. throws: javax.ejb.EJBException - If this method could not complete due to a system-level failure. |
createTimer | public Timer createTimer(long initialDuration, long intervalDuration, Serializable info) throws IllegalArgumentException, IllegalStateException, EJBException(Code) | | Create an interval txtimer whose first expiration occurs after a specified duration,
and whose subsequent expirations occur after a specified interval.
Parameters: initialDuration - The number of milliseconds that must elapse before the firsttxtimer expiration notification. Parameters: intervalDuration - The number of milliseconds that must elapse between txtimerexpiration notifications. Expiration notifications arescheduled relative to the time of the first expiration. Ifexpiration is delayed(e.g. due to the interleaving of othermethod calls on the bean) two or more expiration notificationsmay occur in close succession to "catch up". Parameters: info - Application information to be delivered along with the txtimer expirationnotification. This can be null. The newly created Timer. throws: IllegalArgumentException - If initialDuration is negative, or intervalDurationis negative. throws: IllegalStateException - If this method is invoked while the instance is ina state that does not allow access to this method. throws: javax.ejb.EJBException - If this method could not complete due to a system-level failure. |
createTimer | public Timer createTimer(Date expiration, Serializable info) throws IllegalArgumentException, IllegalStateException, EJBException(Code) | | Create a single-action txtimer that expires at a given point in time.
Parameters: expiration - The point in time at which the txtimer must expire. Parameters: info - Application information to be delivered along with the txtimer expirationnotification. This can be null. The newly created Timer. throws: IllegalArgumentException - If expiration is null, or expiration.getTime() is negative. throws: IllegalStateException - If this method is invoked while the instance is ina state that does not allow access to this method. throws: javax.ejb.EJBException - If this method could not complete due to a system-level failure. |
createTimer | public Timer createTimer(Date initialExpiration, long intervalDuration, Serializable info) throws IllegalArgumentException, IllegalStateException, EJBException(Code) | | Create an interval txtimer whose first expiration occurs at a given point in time and
whose subsequent expirations occur after a specified interval.
Parameters: initialExpiration - The point in time at which the first txtimer expiration must occur. Parameters: intervalDuration - The number of milliseconds that must elapse between txtimerexpiration notifications. Expiration notifications arescheduled relative to the time of the first expiration. Ifexpiration is delayed(e.g. due to the interleaving of othermethod calls on the bean) two or more expiration notificationsmay occur in close succession to "catch up". Parameters: info - Application information to be delivered along with the txtimer expirationnotification. This can be null. The newly created Timer. throws: IllegalArgumentException - If initialExpiration is null, or initialExpiration.getTime()is negative, or intervalDuration is negative. throws: IllegalStateException - If this method is invoked while the instance is ina state that does not allow access to this method. throws: javax.ejb.EJBException - If this method could not complete due to a system-level failure. |
getAllTimers | public Collection getAllTimers()(Code) | | Get the list of all registerd timers, both active and inactive
|
getTimedObjectInvoker | public TimedObjectInvoker getTimedObjectInvoker()(Code) | | Get the TimedObjectInvoker associated with this TimerService
|
getTimer | public Timer getTimer(TimerHandle handle)(Code) | | Get the Timer for the given timedObjectId
|
getTimers | public Collection getTimers() throws IllegalStateException, EJBException(Code) | | Get all the active timers associated with this bean.
A collection of javax.ejb.Timer objects. throws: IllegalStateException - If this method is invoked while the instance is ina state that does not allow access to this method. throws: javax.ejb.EJBException - If this method could not complete due to a system-level failure. |
getTransaction | Transaction getTransaction()(Code) | | Get the current transaction
|
removeTimer | void removeTimer(TimerImpl txtimer)(Code) | | Remove a txtimer from the list of active timers
|
shutdown | public void shutdown(boolean keepState)(Code) | | Kill all timers
Parameters: keepState - Whether to maintain or remove timer persistent state |
|
|