| Oracle® Containers for J2EE Enterprise JavaBeans Developer's Guide 10g Release 3 (10.1.3) B14428-01 |
|
![]() Previous |
![]() Next |
This section describes:
You can retrieve information and cancel the timer through the Timer object. The methods available are cancel(), getTimeRemaining(), getNextTimeout(), getHandle(), and getInfo(). To compare for object equality, use the Timer.equals(Object obj) method.
Timers must be able to be persisted so that they can survive the life cycle of the bean (ejbLoad, ejbStore, and so on). You can retrieve a persisted Timer object through its handle. Retrieve the TimerHandle through the Timer.getHandle() method. Then, you can retrieve the persisted Timer object through the TimerHandle.getTimer() method.
The timer is normally created or cancelled within the scope of a transaction. Thus, the bean normally is configured as being within a transaction. Typically this is configured with RequiresNew. If the transaction is rolled back, then the container retries the timeout.
For more information on transactions, see the Oracle Containers for J2EE Services Guide.