|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jcs.engine.memory.AbstractMemoryCache<K,V>
public abstract class AbstractMemoryCache<K extends Serializable,V extends Serializable>
This base includes some common code for memory caches.
This keeps a static reference to a memory shrinker clock daemon. If this region is configured to use the shrinker, the clock daemon will be setup to run the shrinker on this region.
| Field Summary | |
|---|---|
CompositeCache<K,V> |
cache
The cache region this store is associated with |
ICompositeCacheAttributes |
cacheAttributes
Cache Attributes. |
protected String |
cacheName
The region name. |
protected int |
chunkSize
How many to spool at a time. |
IElementAttributes |
elementAttributes
Region Elemental Attributes, used as a default and copied for each item. |
Map<K,MemoryElementDescriptor<K,V>> |
map
Map where items are stored by key. |
protected CacheStatus |
status
status |
| Constructor Summary | |
|---|---|
AbstractMemoryCache()
|
|
| Method Summary | |
|---|---|
abstract Map<K,MemoryElementDescriptor<K,V>> |
createMap()
Children must implement this method. |
void |
dispose()
Prepares for shutdown. |
void |
dumpMap()
Dump the cache map for debugging. |
abstract ICacheElement<K,V> |
get(K key)
Get an item from the cache |
ICompositeCacheAttributes |
getCacheAttributes()
Returns the CacheAttributes. |
String |
getCacheName()
Returns the cache (aka "region") name. |
CompositeCache<K,V> |
getCompositeCache()
Gets the cache hub / region that the MemoryCache is used by |
Set<K> |
getGroupKeys(String groupName)
Gets the set of keys of objects currently in the group. |
Set<String> |
getGroupNames()
Gets the set of group names in the cache |
Iterator<Map.Entry<K,MemoryElementDescriptor<K,V>>> |
getIterator()
Gets the iterator attribute of the LRUMemoryCache object |
abstract Set<K> |
getKeySet()
Get a set of the keys for all elements in the memory cache |
Map<K,ICacheElement<K,V>> |
getMultiple(Set<K> keys)
Gets multiple items from the cache based on the given set of keys. |
ICacheElement<K,V> |
getQuiet(K key)
Get an item from the cache without affecting its last access time or position. |
int |
getSize()
Returns the current cache size. |
IStats |
getStatistics()
Returns the historical and statistical data for a region's memory cache. |
CacheStatus |
getStatus()
Returns the cache status. |
void |
initialize(CompositeCache<K,V> hub)
For post reflection creation initialization |
abstract boolean |
remove(K key)
Removes an item from the cache |
void |
removeAll()
Removes all cached items from the cache. |
void |
setCacheAttributes(ICompositeCacheAttributes cattr)
Sets the CacheAttributes. |
void |
setScheduledExecutorService(ScheduledExecutorService scheduledExecutor)
Inject an instance of a central ScheduledExecutorService |
abstract void |
update(ICacheElement<K,V> ce)
Puts an item to the cache. |
void |
waterfal(ICacheElement<K,V> ce)
Puts an item to the cache. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.jcs.engine.memory.behavior.IMemoryCache |
|---|
freeElements |
| Field Detail |
|---|
protected String cacheName
public Map<K extends Serializable,MemoryElementDescriptor<K extends Serializable,V extends Serializable>> map
public IElementAttributes elementAttributes
public ICompositeCacheAttributes cacheAttributes
public CompositeCache<K extends Serializable,V extends Serializable> cache
protected CacheStatus status
protected int chunkSize
| Constructor Detail |
|---|
public AbstractMemoryCache()
| Method Detail |
|---|
public void initialize(CompositeCache<K,V> hub)
initialize in interface IMemoryCache<K extends Serializable,V extends Serializable>hub - public void setScheduledExecutorService(ScheduledExecutorService scheduledExecutor)
IRequireScheduler
setScheduledExecutorService in interface IRequireSchedulerIRequireScheduler.setScheduledExecutorService(java.util.concurrent.ScheduledExecutorService)public abstract Map<K,MemoryElementDescriptor<K,V>> createMap()
public abstract boolean remove(K key)
throws IOException
remove in interface IMemoryCache<K extends Serializable,V extends Serializable>key - Identifies item to be removed
IOException - Description of the Exception
public abstract ICacheElement<K,V> get(K key)
throws IOException
get in interface IMemoryCache<K extends Serializable,V extends Serializable>key - Description of the Parameter
IOException - Description of the Exception
public Map<K,ICacheElement<K,V>> getMultiple(Set<K> keys)
throws IOException
getMultiple in interface IMemoryCache<K extends Serializable,V extends Serializable>keys -
IOException
public ICacheElement<K,V> getQuiet(K key)
throws IOException
getQuiet in interface IMemoryCache<K extends Serializable,V extends Serializable>key - Identifies item to find
IOException
public abstract void update(ICacheElement<K,V> ce)
throws IOException
update in interface IMemoryCache<K extends Serializable,V extends Serializable>ce - Description of the Parameter
IOException - Description of the Exceptionpublic abstract Set<K> getKeySet()
getKeySet in interface IMemoryCache<K extends Serializable,V extends Serializable>
public void removeAll()
throws IOException
removeAll in interface IMemoryCache<K extends Serializable,V extends Serializable>IOException
public void dispose()
throws IOException
dispose in interface IMemoryCache<K extends Serializable,V extends Serializable>IOExceptionpublic IStats getStatistics()
IMemoryCache
getStatistics in interface IMemoryCache<K extends Serializable,V extends Serializable>public int getSize()
getSize in interface IMemoryCache<K extends Serializable,V extends Serializable>public CacheStatus getStatus()
public String getCacheName()
public void waterfal(ICacheElement<K,V> ce)
throws IOException
waterfal in interface IMemoryCache<K extends Serializable,V extends Serializable>ce -
IOExceptionpublic Iterator<Map.Entry<K,MemoryElementDescriptor<K,V>>> getIterator()
getIterator in interface IMemoryCache<K extends Serializable,V extends Serializable>public void dumpMap()
public ICompositeCacheAttributes getCacheAttributes()
getCacheAttributes in interface IMemoryCache<K extends Serializable,V extends Serializable>public void setCacheAttributes(ICompositeCacheAttributes cattr)
setCacheAttributes in interface IMemoryCache<K extends Serializable,V extends Serializable>cattr - The new CacheAttributes valuepublic CompositeCache<K,V> getCompositeCache()
getCompositeCache in interface IMemoryCache<K extends Serializable,V extends Serializable>public Set<K> getGroupKeys(String groupName)
IMemoryCache
getGroupKeys in interface IMemoryCache<K extends Serializable,V extends Serializable>groupName -
public Set<String> getGroupNames()
getGroupNames in interface IMemoryCache<K extends Serializable,V extends Serializable>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||