public class RemoteExpireCache<K,V> extends Object implements Cache<K,V>
Modifier and Type | Field and Description |
---|---|
protected org.apache.log4j.Logger |
mLogger |
Constructor and Description |
---|
RemoteExpireCache() |
Modifier and Type | Method and Description |
---|---|
void |
addObject(K object,
V object1)
Add a new object to the cache.
|
void |
expireObject(K object)
Expire an object in the cache.
|
void |
expireObject(K object,
boolean onlyRemote) |
void |
expireObjectFromRemote(int n) |
void |
expireObjectFromRemote(K object) |
void |
flushCache()
This method will flush all objects from the cache.
|
String |
getCacheType() |
Iterable<K> |
getKeys()
Returns all the keys in the cache
|
int |
getMaxSize()
Get the max number of cached objects in this cache.
|
V |
getObject(K object)
Get an object from the cache.
|
RemoteExpireService |
getRemoteExpireService() |
String |
getReport(String type)
Return a report for this status
|
int |
getSize()
Returns the current size of the cache.
|
Number |
getStatistic(String string)
The different statistics metrics of the implementing class.
|
Set<String> |
getStatisticKeys()
The keys that the metrics are available under.
|
int |
getValidSeconds()
Get the validSeconds for this cache.
|
Cache<K,V> |
getWrappedCache() |
boolean |
hasObject(K object)
Check if the cache contains the object while not changing any of
the cache statistics.
|
void |
remove(CacheFilter<K,V> pFilter)
Iterates through all the items in the cache and removes all items that is not accepted by the given filter.
|
void |
reset()
Reset any counters
|
void |
setRemoteExpireService(RemoteExpireService remoteExpireService) |
void |
setWrappedCache(Cache<K,V> pWrappedCache) |
String |
toString() |
public void setRemoteExpireService(RemoteExpireService remoteExpireService)
public RemoteExpireService getRemoteExpireService()
public final V getObject(K object)
Cache
public final int getSize()
Cache
getMaxSize
public final void expireObjectFromRemote(int n)
public final void expireObjectFromRemote(K object)
public final void addObject(K object, V object1)
Cache
public final void expireObject(K object)
Cache
expireObject
in interface Cache<K,V>
object
- The identifier of the object to expire.public final void expireObject(K object, boolean onlyRemote)
public final String getCacheType()
getCacheType
in interface Cache<K,V>
public final Number getStatistic(String string)
StatisticsSource
getStatistic
in interface StatisticsSource
string
- the key of the metric wanted. See StatisticsSource.getStatisticKeys()
for a list of valid keys.StatisticsSource.getStatisticKeys()
public final Set<String> getStatisticKeys()
StatisticsSource
getStatisticKeys
in interface StatisticsSource
Set
of String
keys. It will
contain at least one key.StatisticsSource.getStatistic(String)
public final int getMaxSize()
Cache
getMaxSize
in interface Cache<K,V>
public final int getValidSeconds()
Cache
getValidSeconds
in interface Cache<K,V>
public final boolean hasObject(K object)
Cache
public final void flushCache()
Cache
flushCache
in interface Cache<K,V>
public String getReport(String type)
StatusSource
getReport
in interface StatusSource
public void reset()
StatusSource
reset
in interface StatusSource
public Iterable<K> getKeys()
Cache
public void remove(CacheFilter<K,V> pFilter)
Cache
© 1998- 2018 Stibo DX