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()
Cachepublic void destroy()
Cachepublic Cache.CacheListener<V> getListener()
CachegetListener in interface Cache<K,V>public void setListener(Cache.CacheListener<V> listener)
CachesetListener 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.Exceptionpublic 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)
Cachepublic V checkOut(K key, boolean loadEntryIfNotFound) throws java.lang.Exception
Cachepublic void checkIn(K key)
Cachepublic V remove(K key)
Cachepublic void removeAll(Cache.CacheFilter<V> filter)
Cachepublic void processLRU()