Package org.apache.bookkeeper.feature
Class CacheableFeatureProvider<T extends Feature>
- java.lang.Object
-
- org.apache.bookkeeper.feature.CacheableFeatureProvider<T>
-
- All Implemented Interfaces:
FeatureProvider
- Direct Known Subclasses:
SettableFeatureProvider
public abstract class CacheableFeatureProvider<T extends Feature> extends java.lang.Object implements FeatureProvider
Cacheable Feature Provider.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.concurrent.ConcurrentMap<java.lang.String,T>featuresprotected java.lang.Stringscopeprotected java.util.concurrent.ConcurrentMap<java.lang.String,FeatureProvider>scopes
-
Constructor Summary
Constructors Modifier Constructor Description protectedCacheableFeatureProvider(java.lang.String scope)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description TgetFeature(java.lang.String name)Return the feature with given name.protected abstract TmakeFeature(java.lang.String featureName)protected java.lang.StringmakeName(java.lang.String name)protected abstract FeatureProvidermakeProvider(java.lang.String fullScopeName)FeatureProviderscope(java.lang.String name)Provide the feature provider under scope name.
-
-
-
Field Detail
-
scope
protected final java.lang.String scope
-
scopes
protected final java.util.concurrent.ConcurrentMap<java.lang.String,FeatureProvider> scopes
-
-
Method Detail
-
makeName
protected java.lang.String makeName(java.lang.String name)
-
getFeature
public T getFeature(java.lang.String name)
Description copied from interface:FeatureProviderReturn the feature with given name.- Specified by:
getFeaturein interfaceFeatureProvider- Parameters:
name- feature name- Returns:
- feature instance
-
makeFeature
protected abstract T makeFeature(java.lang.String featureName)
-
scope
public FeatureProvider scope(java.lang.String name)
Description copied from interface:FeatureProviderProvide the feature provider under scope name.- Specified by:
scopein interfaceFeatureProvider- Parameters:
name- scope name.- Returns:
- feature provider under scope name
-
makeProvider
protected abstract FeatureProvider makeProvider(java.lang.String fullScopeName)
-
-