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() |
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(String frequency) |
void |
setListener(Cache.CacheListener<V> listener)
Sets the listener for cache events.
|
void |
setPassivator(Class<? extends PassivationStrategy> passivatorClass) |
void |
setPassivator(PassivationStrategy passivator) |
void |
setPoolSize(int capacity) |
void |
setScheduledExecutorService(ScheduledExecutorService executor) |
void |
setTimeOut(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(Class<? extends PassivationStrategy> passivatorClass) throws Exception
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(String timeOut)
public void setScheduledExecutorService(ScheduledExecutorService executor)
public ScheduledExecutorService getScheduledExecutorService()
public void setFrequency(String frequency)
public long getFrequency()
public void add(K key, V value)
Cachepublic V checkOut(K key, boolean loadEntryIfNotFound) throws Exception
Cachepublic void checkIn(K key)
Cachepublic V remove(K key)
Cachepublic void removeAll(Cache.CacheFilter<V> filter)
Cachepublic void processLRU()
Copyright © 1999–2014 The Apache Software Foundation. All rights reserved.