|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jcs.engine.control.CompositeCache
This is the primary hub for a single cache/region. It controls the flow of items through the cache. The auxiliary and memory caches are plugged in here.
This is the core of a JCS region.
Field Summary | |
IElementAttributes |
attr
Region Elemental Attributes, default |
ICompositeCacheAttributes |
cacheAttr
Cache Attributes, for hub and memory auxiliary |
static IElementEventQueue |
elementEventQ
EventQueue for handling element events. |
Fields inherited from interface org.apache.jcs.engine.behavior.ICacheType |
CACHE_HUB, DISK_CACHE, LATERAL_CACHE, REMOTE_CACHE |
Constructor Summary | |
CompositeCache(java.lang.String cacheName,
ICompositeCacheAttributes cattr,
IElementAttributes attr)
Constructor for the Cache object |
Method Summary | |
void |
addElementEvent(IElementEventHandler hand,
IElementEvent event)
Adds an ElementEvent to be handled |
void |
dispose()
Flushes all cache items from memory to auxilliary caches and close the auxilliary caches. |
protected void |
dispose(boolean fromRemote)
invoked only by CacheManager. |
ICacheElement |
get(java.io.Serializable key)
Gets an item from the cache. |
protected ICacheElement |
get(java.io.Serializable key,
boolean localOnly)
Look in memory, then disk, remote, or laterally for this item. |
ICompositeCacheAttributes |
getCacheAttributes()
Gets the ICompositeCacheAttributes attribute of the Cache object |
java.lang.String |
getCacheName()
Gets the cacheName attribute of the Cache object. |
int |
getCacheType()
Gets the cacheType attribute of the Cache object |
IElementAttributes |
getElementAttributes()
Gets the default element attribute of the Cache object Should this return a copy? |
IElementAttributes |
getElementAttributes(java.io.Serializable key)
Gets the elementAttributes attribute of the Cache object |
java.util.Set |
getGroupKeys(java.lang.String group)
Gets the set of keys of objects currently in the group |
int |
getHitCountAux()
Number of times a requested item was found in and auxiliary cache. |
int |
getHitCountRam()
Number of times a requested item was found in the memory cache. |
MemoryCache |
getMemoryCache()
Access to the memory cache for instrumentation. |
int |
getMissCountExpired()
Number of times a requested element was found but was expired. |
int |
getMissCountNotFound()
Number of times a requested element was not found. |
int |
getSize()
Gets the size attribute of the Cache object. |
ICacheStats |
getStatistics()
This returns data gathered for this region and all the auxiliaries it currently uses. |
java.lang.String |
getStats()
Gets stats for debugging. |
int |
getStatus()
Gets the status attribute of the Cache object |
ICacheElement |
localGet(java.io.Serializable key)
Do not try to go remote or laterally for this get. |
boolean |
localRemove(java.io.Serializable key)
Do not propogate removeall laterally or remotely. |
void |
localRemoveAll()
|
void |
localUpdate(ICacheElement ce)
Standard update method |
boolean |
remove(java.io.Serializable key)
Removes an item from the cache. |
protected boolean |
remove(java.io.Serializable key,
boolean localOnly)
fromRemote: If a remove call was made on a cache with both, then the remote should have been called. |
void |
removeAll()
Removes all cached items from the cache. |
protected void |
removeAll(boolean localOnly)
Removes all cached items. |
void |
save()
Though this put is extremely fast, this could bog the cache and should be avoided. |
void |
setAuxCaches(AuxiliaryCache[] auxCaches)
This sets the list of auxiliary caches for this region. |
void |
setCacheAttributes(ICompositeCacheAttributes cattr)
Sets the ICompositeCacheAttributes attribute of the Cache object |
void |
setElementAttributes(IElementAttributes attr)
Sets the default element attribute of the Cache object |
void |
spoolToDisk(ICacheElement ce)
Writes the specified element to any disk auxilliaries Might want to rename this "overflow" incase the hub wants to do something else. |
void |
update(ICacheElement ce)
Standard update method |
protected void |
update(ICacheElement ce,
boolean localOnly)
Put an item into the cache. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static IElementEventQueue elementEventQ
public IElementAttributes attr
public ICompositeCacheAttributes cacheAttr
Constructor Detail |
public CompositeCache(java.lang.String cacheName, ICompositeCacheAttributes cattr, IElementAttributes attr)
cacheName
- The name of the regioncattr
- The cache attributeattr
- The default element attributesMethod Detail |
public void setAuxCaches(AuxiliaryCache[] auxCaches)
auxCaches
- public void update(ICacheElement ce) throws java.io.IOException
update
in interface ICache
ce
-
java.io.IOException
public void localUpdate(ICacheElement ce) throws java.io.IOException
ce
-
java.io.IOException
protected void update(ICacheElement ce, boolean localOnly) throws java.io.IOException
java.io.IOException
public void spoolToDisk(ICacheElement ce)
ce
- The CacheElementpublic ICacheElement get(java.io.Serializable key)
ICache
get
in interface ICache
public ICacheElement localGet(java.io.Serializable key)
key
-
protected ICacheElement get(java.io.Serializable key, boolean localOnly)
Do not try to go remote or laterally for this get if it is localOnly. Otherwise try to go remote or lateral if such an auxiliary is configured for this region.
key
- localOnly
-
public java.util.Set getGroupKeys(java.lang.String group)
group
-
public boolean remove(java.io.Serializable key)
ICache
remove
in interface ICache
public boolean localRemove(java.io.Serializable key)
key
-
protected boolean remove(java.io.Serializable key, boolean localOnly)
key
- localOnly
-
public void removeAll() throws java.io.IOException
ICache
removeAll
in interface ICache
java.io.IOException
public void localRemoveAll() throws java.io.IOException
java.io.IOException
protected void removeAll(boolean localOnly) throws java.io.IOException
localOnly
-
java.io.IOException
public void dispose()
dispose
in interface ICache
protected void dispose(boolean fromRemote)
fromRemote
- public void save()
public int getSize()
getSize
in interface ICache
public int getCacheType()
getCacheType
in interface ICacheType
public int getStatus()
getStatus
in interface ICache
public java.lang.String getStats()
getStats
in interface ICache
public ICacheStats getStatistics()
public java.lang.String getCacheName()
getCacheName
in interface ICache
public IElementAttributes getElementAttributes()
public void setElementAttributes(IElementAttributes attr)
attr
- public ICompositeCacheAttributes getCacheAttributes()
public void setCacheAttributes(ICompositeCacheAttributes cattr)
cattr
- The new ICompositeCacheAttributes valuepublic IElementAttributes getElementAttributes(java.io.Serializable key) throws CacheException, java.io.IOException
key
-
CacheException
java.io.IOException
public MemoryCache getMemoryCache()
public int getHitCountRam()
public int getHitCountAux()
public int getMissCountNotFound()
public int getMissCountExpired()
public void addElementEvent(IElementEventHandler hand, IElementEvent event) throws java.io.IOException
hand
- The IElementEventHandlerevent
- The IElementEventHandler IElementEvent event
java.io.IOException
- Description of the Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |