public class InMemoryCacheManager extends Object implements FF4JCacheManager
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_CACHENAME
cache name if several caches within memory.
|
| Constructor and Description |
|---|
InMemoryCacheManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
clearFeatures()
Remove everything present within feature cache.
|
void |
clearProperties()
Remove everything present within properties cache.
|
void |
evictFeature(String featureId)
Remove a feature from cache by its identifier.
|
void |
evictProperty(String propertyName)
Remove a property from cache by its identifier.
|
String |
getCacheProviderName()
Get name of expected cache.
|
Feature |
getFeature(String featureId)
Return
Feature stored in cache. |
Object |
getFeatureNativeCache()
Access to embedded implementation of cache for Features.
|
Map<String,InMemoryCacheEntry<Feature>> |
getFeaturesCache()
Getter accessor for attribute 'featuresCache'.
|
Property<?> |
getProperty(String pName)
Return
PropertyString stored in cache. |
Map<String,InMemoryCacheEntry<Property<?>>> |
getPropertyCache()
Getter accessor for attribute 'propertyCache'.
|
Object |
getPropertyNativeCache()
Access to embedded implementation of cach for Properties
|
Set<String> |
listCachedFeatureNames()
List feature names in cache.
|
Set<String> |
listCachedPropertyNames()
List property names in cache.
|
void |
putFeature(Feature feat)
Add feature to cache.
|
void |
putFeature(Feature feat,
long timeToLive) |
void |
putProperty(Property<?> prop)
Add property to cache.
|
void |
putProperty(Property<?> prop,
long timeToLive) |
public static final String DEFAULT_CACHENAME
public String getCacheProviderName()
getCacheProviderName in interface FF4JCacheManagerpublic Set<String> listCachedFeatureNames()
listCachedFeatureNames in interface FF4JCacheManagerpublic void clearFeatures()
clearFeatures in interface FF4JCacheManagerpublic void clearProperties()
clearProperties in interface FF4JCacheManagerpublic void evictFeature(String featureId)
evictFeature in interface FF4JCacheManagerfeatureId - feature identifierpublic void evictProperty(String propertyName)
evictProperty in interface FF4JCacheManagerpropertyName - property unique identifierpublic void putFeature(Feature feat)
putFeature in interface FF4JCacheManagerfeat - target feature to be cachedpublic void putFeature(Feature feat, long timeToLive)
public void putProperty(Property<?> prop)
putProperty in interface FF4JCacheManagerprop - target property to be cachedpublic void putProperty(Property<?> prop, long timeToLive)
public Feature getFeature(String featureId)
Feature stored in cache.getFeature in interface FF4JCacheManagerfeatureId - target feature identifierFeatureNotFoundException as FeatureStore).public Property<?> getProperty(String pName)
PropertyString stored in cache.getProperty in interface FF4JCacheManagerpName - target feature identifierFeatureNotFoundException as FeatureStore).public Set<String> listCachedPropertyNames()
listCachedPropertyNames in interface FF4JCacheManagerpublic Object getFeatureNativeCache()
getFeatureNativeCache in interface FF4JCacheManagerpublic Object getPropertyNativeCache()
getPropertyNativeCache in interface FF4JCacheManagerpublic Map<String,InMemoryCacheEntry<Feature>> getFeaturesCache()
public Map<String,InMemoryCacheEntry<Property<?>>> getPropertyCache()
Copyright © 2013–2017 FF4J. All rights reserved.