Cache.CacheFilter<V>, Cache.CacheListener<V>, Cache.TimeOut
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,
boolean loadEntryIfNotFound)
Marks the entry checked-out, so this entry can not be accessed until
checked-in.
|
void |
destroy()
Destroy the cache.
|
int |
getBulkPassivate() |
int |
getCapacity() |
long |
getFrequency() |
Cache.CacheListener<V> |
getListener()
Gets the listener for cache events.
|
PassivationStrategy |
getPassivator() |
java.util.concurrent.ScheduledExecutorService |
getScheduledExecutorService() |
long |
getTimeOut() |
void |
init()
Initialize the cache.
|
void |
processLRU() |
V |
remove(K key)
Removes the entry from the cache.
|
void |
removeAll(Cache.CacheFilter<V> filter)
Removes all of the entries that match the specified filter.
|
void |
setBulkPassivate(int bulkPassivate) |
void |
setCapacity(int capacity) |
void |
setFrequency(java.lang.String frequency) |
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 |
setScheduledExecutorService(java.util.concurrent.ScheduledExecutorService executor) |
void |
setTimeOut(java.lang.String timeOut) |
public static final Logger logger
public SimpleCache()
public SimpleCache(Cache.CacheListener<V> listener, PassivationStrategy passivator, int capacity, int bulkPassivate, Duration timeOut)
public void init()
Cache
public void destroy()
Cache
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(java.lang.String timeOut)
public void setScheduledExecutorService(java.util.concurrent.ScheduledExecutorService executor)
public java.util.concurrent.ScheduledExecutorService getScheduledExecutorService()
public void setFrequency(java.lang.String frequency)
public long getFrequency()
public void add(K key, V value)
Cache
public V checkOut(K key, boolean loadEntryIfNotFound) 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()