public class CacheImpl extends Object implements ICache
Constructor and Description |
---|
CacheImpl(IAggregator aggregator,
Object control,
ICache oldCache) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Help out the GC by clearing out the cache maps.
|
void |
dump(Writer writer,
Pattern filter)
Outputs a string representation of this cache object.
|
IGenericCache |
getCache(String key)
Returns the named generic cache.
|
Object |
getControlObj() |
long |
getCreated()
Returns the date and time that this cache object was created.
|
IGzipCache |
getGzipCache()
Returns the cache of gzipped modules
|
ILayerCache |
getLayers()
Returns the cache of layer build cache entries.
|
IModuleCache |
getModules()
Returns the cache of module build cache entries
|
IGenericCache |
putIfAbsent(String key,
IGenericCache cache)
Adds the named cache object to the Aggregator cache.
|
boolean |
remove(String key)
Removes the named cache object with the specified key.
|
void |
setAggregator(IAggregator aggregator)
Called for newly created (or de-serialized) caches to set the aggregator
instance for the cache.
|
public CacheImpl(IAggregator aggregator, Object control, ICache oldCache)
public ILayerCache getLayers()
ICache
public IModuleCache getModules()
ICache
getModules
in interface ICache
public IGzipCache getGzipCache()
ICache
getGzipCache
in interface ICache
public IGenericCache getCache(String key)
ICache
ICache.putIfAbsent(String, IGenericCache)
.public IGenericCache putIfAbsent(String key, IGenericCache cache)
ICache
ConcurrentMap.putIfAbsent(Object, Object)
. Once a generic cache object is added, it
persists across server restarts. When the Aggregator cache is cleared, the
IGenericCache.newInstance()
method is called to create a new cache object for the
updated cache.putIfAbsent
in interface ICache
key
- the cache namecache
- the new cache objectpublic boolean remove(String key)
ICache
public long getCreated()
ICache
getCreated
in interface ICache
public Object getControlObj()
public void clear()
public void dump(Writer writer, Pattern filter) throws IOException
ICache
dump
in interface ICache
writer
- The writer object to output the cache dump tofilter
- A regular expression to filter the output. Passed along to the
module and layer cache object toString() methods.IOException
public void setAggregator(IAggregator aggregator)
ICache
IAggregator.getConfig()
may return null if called
from within this method.setAggregator
in interface ICache
aggregator
- The aggregator instance for this cache objectCopyright © 2011-2015 IBM. All Rights Reserved.