|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.logicblaze.lingo.util.DefaultTimeoutMap
public class DefaultTimeoutMap
| Constructor Summary | |
|---|---|
DefaultTimeoutMap()
|
|
DefaultTimeoutMap(edu.emory.mathcs.backport.java.util.concurrent.ScheduledExecutorService executor,
long requestMapPollTimeMillis)
|
|
| Method Summary | |
|---|---|
protected long |
currentTime()
|
java.lang.Object |
get(java.lang.Object key)
Looks up the value in the map by the given key. |
edu.emory.mathcs.backport.java.util.concurrent.ScheduledExecutorService |
getExecutor()
|
java.lang.Object[] |
getKeys()
Returns a copy of the keys in the map |
long |
getPurgePollTime()
|
protected boolean |
isValidForEviction(TimeoutMapEntry entry)
A hook to allow derivations to avoid evicting the current entry |
void |
purge()
Purges any old entries from the map |
void |
put(java.lang.Object key,
java.lang.Object value,
long timeoutMillis)
Adds the key value pair into the map such that some time after the given timeout the entry will be evicted |
void |
remove(java.lang.Object id)
|
void |
run()
The timer task which purges old requests and schedules another poll |
protected void |
schedulePoll()
lets schedule each time to allow folks to change the time at runtime |
void |
setExecutor(edu.emory.mathcs.backport.java.util.concurrent.ScheduledExecutorService executor)
Sets the executor used to schedule purge events of inactive requests |
void |
setPurgePollTime(long purgePollTime)
Sets the next purge poll time in milliseconds |
protected void |
updateExpireTime(TimeoutMapEntry entry)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultTimeoutMap()
public DefaultTimeoutMap(edu.emory.mathcs.backport.java.util.concurrent.ScheduledExecutorService executor,
long requestMapPollTimeMillis)
| Method Detail |
|---|
public java.lang.Object get(java.lang.Object key)
TimeoutMap
get in interface TimeoutMapkey - the key of the value to search for
public void put(java.lang.Object key,
java.lang.Object value,
long timeoutMillis)
TimeoutMap
put in interface TimeoutMappublic void remove(java.lang.Object id)
remove in interface TimeoutMappublic java.lang.Object[] getKeys()
getKeys in interface TimeoutMappublic void run()
run in interface java.lang.Runnablepublic void purge()
purge in interface TimeoutMappublic long getPurgePollTime()
public void setPurgePollTime(long purgePollTime)
public edu.emory.mathcs.backport.java.util.concurrent.ScheduledExecutorService getExecutor()
public void setExecutor(edu.emory.mathcs.backport.java.util.concurrent.ScheduledExecutorService executor)
protected void schedulePoll()
protected boolean isValidForEviction(TimeoutMapEntry entry)
entry -
protected void updateExpireTime(TimeoutMapEntry entry)
protected long currentTime()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||