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>
features
protected java.lang.String
scope
protected java.util.concurrent.ConcurrentMap<java.lang.String,FeatureProvider>
scopes
-
Constructor Summary
Constructors Modifier Constructor Description protected
CacheableFeatureProvider(java.lang.String scope)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description T
getFeature(java.lang.String name)
Return the feature with given name.protected abstract T
makeFeature(java.lang.String featureName)
protected java.lang.String
makeName(java.lang.String name)
protected abstract FeatureProvider
makeProvider(java.lang.String fullScopeName)
FeatureProvider
scope(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:FeatureProvider
Return the feature with given name.- Specified by:
getFeature
in 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:FeatureProvider
Provide the feature provider under scope name.- Specified by:
scope
in interfaceFeatureProvider
- Parameters:
name
- scope name.- Returns:
- feature provider under scope name
-
makeProvider
protected abstract FeatureProvider makeProvider(java.lang.String fullScopeName)
-
-