Cache.CacheFilter<V>, Cache.CacheListener<V>
Constructor and Description |
---|
SimpleCache() |
SimpleCache(Cache.CacheListener<V> listener,
PassivationStrategy passivator,
int capacity,
int bulkPassivate,
Duration timeOut) |
Modifier and Type | Method and Description |
---|---|
void |
add(K key,
V value)
Add a new entry to the cache.
|
void |
checkIn(K key)
Marks the entry available, so it can be accessed again.
|
V |
checkOut(K key)
Marks the entry checked-out, so this entry can not be accessed until
checked-in.
|
int |
getBulkPassivate() |
int |
getCapacity() |
Cache.CacheListener<V> |
getListener()
Gets the listener for cache events.
|
PassivationStrategy |
getPassivator() |
long |
getTimeOut() |
void |
processLRU() |
V |
remove(K key)
Removes the entry from the cache.
|
void |
removeAll(Cache.CacheFilter<V> filter)
Removes all of th entries that match the specified filter.
|
void |
setBulkPassivate(int bulkPassivate) |
void |
setCapacity(int capacity) |
void |
setListener(Cache.CacheListener<V> listener)
Sets the listener for cache events.
|
void |
setPassivator(java.lang.Class<? extends PassivationStrategy> passivatorClass) |
void |
setPassivator(PassivationStrategy passivator) |
void |
setPoolSize(int capacity) |
void |
setTimeOut(long timeOut) |
public static final Logger logger
public SimpleCache()
public SimpleCache(Cache.CacheListener<V> listener, PassivationStrategy passivator, int capacity, int bulkPassivate, Duration timeOut)
public Cache.CacheListener<V> getListener()
Cache
getListener
in interface Cache<K,V>
public void setListener(Cache.CacheListener<V> listener)
Cache
setListener
in interface Cache<K,V>
public PassivationStrategy getPassivator()
public void setPassivator(PassivationStrategy passivator)
public void setPassivator(java.lang.Class<? extends PassivationStrategy> passivatorClass) throws java.lang.Exception
java.lang.Exception
public int getCapacity()
public void setCapacity(int capacity)
public void setPoolSize(int capacity)
public int getBulkPassivate()
public void setBulkPassivate(int bulkPassivate)
public long getTimeOut()
public void setTimeOut(long timeOut)
public void add(K key, V value)
Cache
public V checkOut(K key) throws java.lang.Exception
Cache
public void checkIn(K key)
Cache
public V remove(K key)
Cache
public void removeAll(Cache.CacheFilter<V> filter)
Cache
public void processLRU()