public class ServletTimerImpl extends Object implements MobicentsServletTimer, Runnable
| Constructor and Description |
|---|
ServletTimerImpl(Serializable info,
long delay,
boolean fixedDelay,
long period,
TimerListener listener,
MobicentsSipApplicationSession appSession)
Constructor for repeating times
|
ServletTimerImpl(Serializable info,
long delay,
TimerListener listener,
MobicentsSipApplicationSession appSession)
Constructor for non-repeating timer.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cancel() |
void |
cancel(boolean mayInterruptIfRunning,
boolean updateAppSessionReadyToInvalidateState)
Cancel this timer, possibly by also interrupting the thread (from the
thread pool) running the task.
|
boolean |
canRun() |
MobicentsSipApplicationSession |
getApplicationSession() |
long |
getDelay()
Getter for delay property.
|
String |
getId() |
Serializable |
getInfo() |
long |
getPeriod()
Getter for period property
|
long |
getTimeRemaining() |
boolean |
isCanceled() |
void |
run()
Method that actually
|
long |
scheduledExecutionTime() |
void |
setApplicationSession(MobicentsSipApplicationSession sipApplicationSession) |
void |
setFuture(ScheduledFuture<?> f) |
String |
toString() |
public ServletTimerImpl(Serializable info, long delay, TimerListener listener, MobicentsSipApplicationSession appSession)
info - Information about the timerdelay - Delay until executionlistener - Listener that will get timeout events.public ServletTimerImpl(Serializable info, long delay, boolean fixedDelay, long period, TimerListener listener, MobicentsSipApplicationSession appSession)
info - Information about the timerdelay - Delay until first executionfixedDelay - Whether fixed delay mode should be usedperiod - Period between executionlistener - Listener that will get timeout events.public void cancel()
cancel in interface ServletTimerpublic void cancel(boolean mayInterruptIfRunning,
boolean updateAppSessionReadyToInvalidateState)
cancel in interface MobicentsServletTimermayInterruptIfRunning - updateAppSessionReadyToInvalidateState - boolean to update or not the readyToInvalidateState upon removing a servlet Timer,
this is useful when we process a remoteInvalidation to make sure we don't load and update the sip session from the cachepublic long getDelay()
public long getPeriod()
public MobicentsSipApplicationSession getApplicationSession()
getApplicationSession in interface ServletTimerpublic void setApplicationSession(MobicentsSipApplicationSession sipApplicationSession)
public Serializable getInfo()
getInfo in interface ServletTimerpublic long scheduledExecutionTime()
scheduledExecutionTime in interface ServletTimerpublic void setFuture(ScheduledFuture<?> f)
public boolean canRun()
public String getId()
getId in interface ServletTimerpublic long getTimeRemaining()
getTimeRemaining in interface ServletTimerpublic boolean isCanceled()
Copyright © 2015. All Rights Reserved.