public abstract class GenericCacheImpl<T> extends Object implements IGenericCache, Serializable
Modifier and Type | Field and Description |
---|---|
protected ConcurrentMap<String,T> |
cacheMap |
Modifier | Constructor and Description |
---|---|
|
GenericCacheImpl() |
protected |
GenericCacheImpl(GenericCacheImpl<T> other) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Remove all entries in the cache
|
boolean |
contains(String key)
Returns true if the entry with the specified key is in the
cache
|
void |
dump(Writer writer,
Pattern filter)
Output the cache info to the specified Writer
|
T |
get(String key)
Returns the cache entry with the specified key, or null if the
cache entry with the specified key is not in the cache
|
Set<String> |
getKeys()
Returns the set of keys associated with entries in the cache
|
IGenericCache |
newInstance()
Returns a new, empty, instance of this cache object.
|
void |
setAggregator(IAggregator aggregator)
Called for newly created (or de-serialized) caches to set the
aggregator instance for this cache.
|
int |
size()
Returns the number of entries in the layer cache
|
protected ConcurrentMap<String,T> cacheMap
public GenericCacheImpl()
protected GenericCacheImpl(GenericCacheImpl<T> other)
public T get(String key)
key
- the entry keypublic int size()
IGenericCache
size
in interface IGenericCache
public boolean contains(String key)
IGenericCache
contains
in interface IGenericCache
key
- the entry keypublic Set<String> getKeys()
IGenericCache
getKeys
in interface IGenericCache
public void clear()
IGenericCache
clear
in interface IGenericCache
public void setAggregator(IAggregator aggregator)
IGenericCache
IAggregator.getConfig()
may return null if called
from within this method.setAggregator
in interface IGenericCache
aggregator
- The aggregator instance for the cachepublic void dump(Writer writer, Pattern filter) throws IOException
IGenericCache
dump
in interface IGenericCache
writer
- the target Writerfilter
- Optional filter argumentIOException
public IGenericCache newInstance()
IGenericCache
newInstance
in interface IGenericCache
Copyright © 2011-2015 IBM. All Rights Reserved.