| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface TimerService
Allows SIP servlet applications to set timers in order to receive notifications on timer expiration. Applications receive such notifications through an implementation of the TimerListener interface. Applications using timers must implement this interface and declare it as listener in the SIP deployment descriptor.
SIP servlet containers are requried to make a TimerService instance available to applications through a ServletContext attribute with name javax.servlet.sip.TimerService.
TimerListener, SipApplicationSession.getTimers()| Method Summary | |
|---|---|
|  ServletTimer | createTimer(SipApplicationSession appSession, long delay, boolean isPersistent, java.io.Serializable info)Creates a one-time ServletTimerand schedules it to expire after the specified delay. | 
|  ServletTimer | createTimer(SipApplicationSession appSession, long delay, long period, boolean fixedDelay, boolean isPersistent, java.io.Serializable info)Creates a repeating ServletTimerand schedules it to expire after the specified delay and then again at approximately regular intervals. | 
| Method Detail | 
|---|
ServletTimer createTimer(SipApplicationSession appSession,
                         long delay,
                         boolean isPersistent,
                         java.io.Serializable info)
ServletTimer and schedules it to expire after the specified delay.appSession - the application session with which the new ServletTimer is to be associateddelay - delay in milliseconds before timer is to expireisPersistent - if true, the ServletTimer will be reinstated after a shutdown be it due to complete failure or operator shutdowninfo - application information to be delivered along with the timer expiration notification. This may be null.ServletTimerjava.lang.IllegalStateException - if the application session is invalid
ServletTimer createTimer(SipApplicationSession appSession,
                         long delay,
                         long period,
                         boolean fixedDelay,
                         boolean isPersistent,
                         java.io.Serializable info)
ServletTimer and schedules it to expire after the specified delay and then again at approximately regular intervals.
The ServletTimer is rescheduled to expire in either a fixed-delay or fixed-rate manner as specified by the fixedDelay argument.
The semantics are the same as for Timer:
In fixed-delay execution, each execution is scheduled relative to the actual execution time of the previous execution. If an execution is delayed for any reason (such as garbage collection or other background activity), subsequent executions will be delayed as well. In the long run, the frequency of execution will generally be slightly lower than the reciprocal of the specified period (assuming the system clock underlyingObject.wait(long)is accurate).In fixed-rate execution, each execution is scheduled relative to the scheduled execution time of the initial execution. If an execution is delayed for any reason (such as garbage collection or other background activity), two or more executions will occur in rapid succession to "catch up." In the long run, the frequency of execution will be exactly the reciprocal of the specified period (assuming the system clock underlying
Object.wait(long)is accurate).
appSession - the application session with which the new ServletTimer is to be associateddelay - delay in milliseconds before timer is to expireperiod - time in milliseconds between successive timer expirationsfixedDelay - if true, the repeating timer is scheduled in a fixed-delay mode, otherwise in a fixed-rate modeisPersistent - if true, the ServletTimer will be reinstated after a shutdown be it due to complete failure or operator shutdowninfo - application information to be delivered along with the timer expiration notification. This may be null.ServletTimerjava.lang.IllegalStateException - if the application session is invalid| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
 Copyright 1996, 2010, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
Java SIP Servlet API 1.1 Reference
Part Number E17883-01