| Oracle® Containers for J2EE Enterprise JavaBeans Developer's Guide 10g (10.1.3.5.0) Part Number E13981-01 |
|
|
View PDF |
This section describes the following:
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.
Note:
Timers and their handles are local objects; therefore, try not to pass them through the bean remote interface.You usually create and cancel a timer within the scope of a transaction. Thus, you usually configure the bean as being within a transaction by using 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.