K
- the type of keys maintained by the mapV
- the type of mapped valuespublic interface EvictionScheduler<K,V>
ConcurrentMapWithTimedEvictionDecorator
to automatically evict entries upon expiration. It provides methods for
scheduling the eviction of newly added entries as well as canceling the
eviction of entries that have been removed form the map.
Note that one eviction scheduler instance can be reused by more than one map.
Modifier and Type | Method and Description |
---|---|
void |
cancelEviction(EvictibleEntry<K,V> e)
Cancels the eviction of the specified entry from its map.
|
void |
scheduleEviction(EvictibleEntry<K,V> e)
Schedules the eviction of the specified entry from its map.
|
void |
shutdown()
Immediately shuts down the scheduler and cancels all pending evictions.
|
void scheduleEviction(EvictibleEntry<K,V> e)
ConcurrentMapWithTimedEvictionDecorator
just after a new entry
has been added. The entry is not guaranteed to be evictible, it may also
be a permanent entry. Therefore, the implementation should check if this
entry is evictible before doing any scheduling.e
- the entry for which the eviction should be scheduled, if
evictible; it must have been already added to its mapNullPointerException
- if the entry is null
void cancelEviction(EvictibleEntry<K,V> e)
ConcurrentMapWithTimedEvictionDecorator
just after an entry has
been removed. The entry is not guaranteed to be evictible, it may also be
a permanent entry. Therefore, the implementation should check if this
entry is evictible before doing any cancellation.e
- the entry for which the eviction should be cancelled, if
evictible; it must have been already removed from its mapNullPointerException
- if the entry is null
void shutdown()
ConcurrentMapWithTimedEvictionDecorator
. Instead, it is intended
to be called by the client that has created the scheduler to properly
shut it down when it's not needed any more.Copyright © 2012–2016. All rights reserved.