public interface TimeoutMap<K,V> extends Runnable
Modifier and Type | Method and Description |
---|---|
V |
get(K key)
Looks up the value in the map by the given key.
|
Object[] |
getKeys()
Returns a copy of the keys in the map
|
boolean |
onEviction(K key,
V value)
Callback when the value has been evicted
|
void |
purge()
Purges any old entries from the map
|
V |
put(K key,
V value,
long timeoutMillis)
Adds the key value pair into the map such that some time after the given
timeout the entry will be evicted
|
V |
putIfAbsent(K key,
V value,
long timeoutMillis)
Adds the key value pair into the map if the specified key is not already associated with a value
such that some time after the given timeout the entry will be evicted
|
V |
remove(K key)
Removes the object with the given key
|
int |
size()
Returns the size of the map
|
V get(K key)
key
- the key of the value to search forint size()
V put(K key, V value, long timeoutMillis)
key
- the keyvalue
- the valuetimeoutMillis
- timeout in millisV putIfAbsent(K key, V value, long timeoutMillis)
key
- the keyvalue
- the valuetimeoutMillis
- timeout in millisboolean onEviction(K key, V value)
key
- the keyvalue
- the valueV remove(K key)
key
- key for the object to removevoid purge()
Apache Camel