public abstract class AbstractMemoryCache extends java.lang.Object implements MemoryCache, java.io.Serializable
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.
| Modifier and Type | Field and Description |
|---|---|
IElementAttributes |
attr
Region Elemental Attributes, used as a default.
|
protected CompositeCache |
cache
The cache region this store is associated with
|
protected java.lang.String |
cacheName
The region name.
|
ICompositeCacheAttributes |
cattr
Cache Attributes
|
protected int |
chunkSize
How many to spool at a time.
|
protected java.util.Map |
map
Map where items are stored by key
|
protected int |
status
status
|
| Constructor and Description |
|---|
AbstractMemoryCache() |
| Modifier and Type | Method and Description |
|---|---|
abstract java.util.Map |
createMap()
Children must implement this method.
|
void |
dispose()
Prepares for shutdown.
|
abstract ICacheElement |
get(java.io.Serializable key)
Get an item from the cache
|
ICompositeCacheAttributes |
getCacheAttributes()
Returns the CacheAttributes.
|
java.lang.String |
getCacheName()
Returns the cache name.
|
CompositeCache |
getCompositeCache()
Gets the cache hub / region that the MemoryCache is used by
|
java.util.Set |
getGroupKeys(java.lang.String groupName)
Gets the set of keys of objects currently in the group.
|
java.util.Iterator |
getIterator()
Gets the iterator attribute of the LRUMemoryCache object
|
abstract java.lang.Object[] |
getKeyArray()
Get an Array of the keys for all elements in the memory cache
|
java.util.Map |
getMultiple(java.util.Set keys)
Gets multiple items from the cache based on the given set of keys.
|
ICacheElement |
getQuiet(java.io.Serializable 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.
|
int |
getStatus()
Returns the cache status.
|
void |
initialize(CompositeCache hub)
For post reflection creation initialization
|
abstract boolean |
remove(java.io.Serializable key)
Removes an item from the cache
|
void |
removeAll()
Removes all cached items from the cache.
|
void |
setCacheAttributes(ICompositeCacheAttributes cattr)
Sets the CacheAttributes.
|
abstract void |
update(ICacheElement ce)
Puts an item to the cache.
|
void |
waterfal(ICacheElement ce)
Puts an item to the cache.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfreeElementsprotected java.lang.String cacheName
protected java.util.Map map
public IElementAttributes attr
public ICompositeCacheAttributes cattr
protected CompositeCache cache
protected int status
protected int chunkSize
public void initialize(CompositeCache hub)
initialize in interface IMemoryCachehub - public abstract java.util.Map createMap()
public abstract boolean remove(java.io.Serializable key)
throws java.io.IOException
remove in interface IMemoryCachekey - Identifies item to be removedjava.io.IOException - Description of the Exceptionpublic abstract ICacheElement get(java.io.Serializable key) throws java.io.IOException
get in interface IMemoryCachekey - Description of the Parameterjava.io.IOException - Description of the Exceptionpublic java.util.Map getMultiple(java.util.Set keys)
throws java.io.IOException
getMultiple in interface IMemoryCachekeys - java.io.IOExceptionpublic ICacheElement getQuiet(java.io.Serializable key) throws java.io.IOException
getQuiet in interface IMemoryCachekey - Identifies item to findjava.io.IOExceptionpublic abstract void update(ICacheElement ce) throws java.io.IOException
update in interface IMemoryCachece - Description of the Parameterjava.io.IOException - Description of the Exceptionpublic abstract java.lang.Object[] getKeyArray()
getKeyArray in interface IMemoryCachepublic void removeAll()
throws java.io.IOException
removeAll in interface IMemoryCachejava.io.IOExceptionpublic void dispose()
throws java.io.IOException
dispose in interface IMemoryCachejava.io.IOExceptionpublic IStats getStatistics()
IMemoryCachegetStatistics in interface IMemoryCachepublic int getSize()
getSize in interface IMemoryCachepublic int getStatus()
public java.lang.String getCacheName()
public void waterfal(ICacheElement ce) throws java.io.IOException
waterfal in interface IMemoryCachece - java.io.IOExceptionpublic java.util.Iterator getIterator()
getIterator in interface IMemoryCachepublic ICompositeCacheAttributes getCacheAttributes()
getCacheAttributes in interface IMemoryCachepublic void setCacheAttributes(ICompositeCacheAttributes cattr)
setCacheAttributes in interface IMemoryCachecattr - The new CacheAttributes valuepublic CompositeCache getCompositeCache()
getCompositeCache in interface IMemoryCachepublic java.util.Set getGroupKeys(java.lang.String groupName)
IMemoryCachegetGroupKeys in interface IMemoryCachegroupName - Copyright © 2002-2013 Apache Software Foundation. All Rights Reserved.