public class ExpiringMap.Expirer
extends java.lang.Object
implements java.lang.Runnable
ExpiringMap
and will remove
elements that have passed the threshold.构造器和说明 |
---|
ExpiringMap.Expirer()
Creates a new instance of Expirer.
|
限定符和类型 | 方法和说明 |
---|---|
int |
getExpirationInterval()
Get the interval in which an object will live in the map before
it is removed.
|
int |
getTimeToLive() |
boolean |
isRunning()
Checks to see if the thread is running
|
void |
run() |
void |
setExpirationInterval(long expirationInterval)
Set the interval in which an object will live in the map before
it is removed.
|
void |
setTimeToLive(long timeToLive)
Update the value for the time-to-live
|
void |
startExpiring()
Kick off this thread which will look for old objects and remove them.
|
void |
startExpiringIfNotStarted()
If this thread has not started, then start it.
|
void |
stopExpiring()
Stop the thread from monitoring the map.
|
public void run()
run
在接口中 java.lang.Runnable
public void startExpiring()
public void startExpiringIfNotStarted()
public void stopExpiring()
public boolean isRunning()
public int getTimeToLive()
public void setTimeToLive(long timeToLive)
timeToLive
- The time-to-live (seconds)public int getExpirationInterval()
public void setExpirationInterval(long expirationInterval)
expirationInterval
- The time in seconds