|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.camel.util.DefaultTimeoutMap
public class DefaultTimeoutMap
Default implementation of the TimeoutMap
.
Constructor Summary | |
---|---|
DefaultTimeoutMap()
|
|
DefaultTimeoutMap(ScheduledExecutorService executor,
long requestMapPollTimeMillis)
|
Method Summary | |
---|---|
protected long |
currentTime()
|
Object |
get(Object key)
Looks up the value in the map by the given key. |
ScheduledExecutorService |
getExecutor()
|
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(Object key,
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(Object id)
Removes the object with the given key |
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(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 |
int |
size()
Returns the size of the map |
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(ScheduledExecutorService executor, long requestMapPollTimeMillis)
Method Detail |
---|
public Object get(Object key)
TimeoutMap
get
in interface TimeoutMap
key
- the key of the value to search for
public void put(Object key, Object value, long timeoutMillis)
TimeoutMap
put
in interface TimeoutMap
public void remove(Object id)
TimeoutMap
remove
in interface TimeoutMap
id
- key for the object to removepublic Object[] getKeys()
TimeoutMap
getKeys
in interface TimeoutMap
public int size()
TimeoutMap
size
in interface TimeoutMap
public void run()
run
in interface Runnable
public void purge()
TimeoutMap
purge
in interface TimeoutMap
public long getPurgePollTime()
public void setPurgePollTime(long purgePollTime)
public ScheduledExecutorService getExecutor()
public void setExecutor(ScheduledExecutorService executor)
protected void schedulePoll()
protected boolean isValidForEviction(TimeoutMapEntry 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 |