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, wait
freeElements
protected 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 IMemoryCache
hub
- public abstract java.util.Map createMap()
public abstract boolean remove(java.io.Serializable key) throws java.io.IOException
remove
in interface IMemoryCache
key
- 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 IMemoryCache
key
- 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 IMemoryCache
keys
- java.io.IOException
public ICacheElement getQuiet(java.io.Serializable key) throws java.io.IOException
getQuiet
in interface IMemoryCache
key
- Identifies item to findjava.io.IOException
public abstract void update(ICacheElement ce) throws java.io.IOException
update
in interface IMemoryCache
ce
- Description of the Parameterjava.io.IOException
- Description of the Exceptionpublic abstract java.lang.Object[] getKeyArray()
getKeyArray
in interface IMemoryCache
public void removeAll() throws java.io.IOException
removeAll
in interface IMemoryCache
java.io.IOException
public void dispose() throws java.io.IOException
dispose
in interface IMemoryCache
java.io.IOException
public IStats getStatistics()
IMemoryCache
getStatistics
in interface IMemoryCache
public int getSize()
getSize
in interface IMemoryCache
public int getStatus()
public java.lang.String getCacheName()
public void waterfal(ICacheElement ce) throws java.io.IOException
waterfal
in interface IMemoryCache
ce
- java.io.IOException
public java.util.Iterator getIterator()
getIterator
in interface IMemoryCache
public ICompositeCacheAttributes getCacheAttributes()
getCacheAttributes
in interface IMemoryCache
public void setCacheAttributes(ICompositeCacheAttributes cattr)
setCacheAttributes
in interface IMemoryCache
cattr
- The new CacheAttributes valuepublic CompositeCache getCompositeCache()
getCompositeCache
in interface IMemoryCache
public java.util.Set getGroupKeys(java.lang.String groupName)
IMemoryCache
getGroupKeys
in interface IMemoryCache
groupName
- Copyright © 2002-2013 Apache Software Foundation. All Rights Reserved.