Class CompositeCacheConfigurator
java.lang.Object
org.apache.commons.jcs3.engine.control.CompositeCacheConfigurator
This class configures JCS based on a properties object.
This class is based on the log4j class org.apache.log4j.PropertyConfigurator which was made by: "Luke Blanshard" <Luke@quiq.com>"Mark DONSZELMANN" <Mark.Donszelmann@cern.ch>"Anders Kristensen" <akristensen@dynamicsoft.com>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String
.attributesprotected static final String
auxiliary prefixprotected static final String
.cacheattributesprotected static final String
.elementattributesstatic final String
jcs.auxiliary.NAME.keymatcher=CLASSNAMEprotected static final String
normal region prefixprotected static final String
The prefix of relevant system propertiesprotected static final String
system region prefix. might not be used -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for the CompositeCacheConfigurator object -
Method Summary
Modifier and TypeMethodDescriptionprotected <K,
V> CompositeCache<K, V> protected static void
Any property values will be replaced with system property values that match the key.protected <K,
V> AuxiliaryCache<K, V> parseAuxiliary
(Properties props, CompositeCacheManager ccm, String auxName, String regName) Get an aux cache for the listed aux for a region.protected ICompositeCacheAttributes
parseCompositeCacheAttributes
(Properties props, String regName, ICompositeCacheAttributes defaultCCAttr) Get an ICompositeCacheAttributes for the listed region.protected ICompositeCacheAttributes
parseCompositeCacheAttributes
(Properties props, String regName, ICompositeCacheAttributes defaultCCAttr, String regionPrefix) Get the main attributes for a region.protected IElementAttributes
parseElementAttributes
(Properties props, String regName, IElementAttributes defaultEAttr, String regionPrefix) Create the element attributes from the properties object for a cache region.protected <K> IKeyMatcher<K>
parseKeyMatcher
(Properties props, String auxPrefix) Creates a custom key matcher if one is defined.protected <K,
V> CompositeCache<K, V> parseRegion
(Properties props, CompositeCacheManager ccm, String regName, String auxiliaries) Create cache region.protected <K,
V> CompositeCache<K, V> parseRegion
(Properties props, CompositeCacheManager ccm, String regName, String auxiliaries, ICompositeCacheAttributes cca) Get all the properties for a region and configure its cache.protected <K,
V> CompositeCache<K, V> parseRegion
(Properties props, CompositeCacheManager ccm, String regName, String auxiliaries, ICompositeCacheAttributes cca, String regionPrefix) Get all the properties for a region and configure its cache.protected void
parseRegions
(Properties props, CompositeCacheManager ccm) Parse region elements.protected void
parseSystemRegions
(Properties props, CompositeCacheManager ccm) Create caches used internally.
-
Field Details
-
SYSTEM_PROPERTY_KEY_PREFIX
The prefix of relevant system properties- See Also:
-
REGION_PREFIX
normal region prefix- See Also:
-
SYSTEM_REGION_PREFIX
system region prefix. might not be used- See Also:
-
AUXILIARY_PREFIX
auxiliary prefix- See Also:
-
ATTRIBUTE_PREFIX
.attributes- See Also:
-
CACHE_ATTRIBUTE_PREFIX
.cacheattributes- See Also:
-
ELEMENT_ATTRIBUTE_PREFIX
.elementattributes- See Also:
-
KEY_MATCHER_PREFIX
jcs.auxiliary.NAME.keymatcher=CLASSNAMEjcs.auxiliary.NAME.keymatcher.attributes.CUSTOMPROPERTY=VALUE
- See Also:
-
-
Constructor Details
-
CompositeCacheConfigurator
public CompositeCacheConfigurator()Constructor for the CompositeCacheConfigurator object
-
-
Method Details
-
parseSystemRegions
Create caches used internally. System status gives them creation priority.- Parameters:
props
- Configuration propertiesccm
- Cache hub
-
parseRegions
Parse region elements.- Parameters:
props
- Configuration propertiesccm
- Cache hub
-
parseRegion
protected <K,V> CompositeCache<K,V> parseRegion(Properties props, CompositeCacheManager ccm, String regName, String auxiliaries) Create cache region.- Parameters:
props
- Configuration propertiesccm
- Cache hubregName
- Name of the cache regionauxiliaries
- Comma separated list of auxiliaries- Returns:
- CompositeCache
-
parseRegion
protected <K,V> CompositeCache<K,V> parseRegion(Properties props, CompositeCacheManager ccm, String regName, String auxiliaries, ICompositeCacheAttributes cca) Get all the properties for a region and configure its cache.This method tells the other parse method the name of the region prefix.
- Parameters:
props
- Configuration propertiesccm
- Cache hubregName
- Name of the cache regionauxiliaries
- Comma separated list of auxiliariescca
- Cache configuration- Returns:
- CompositeCache
-
parseRegion
protected <K,V> CompositeCache<K,V> parseRegion(Properties props, CompositeCacheManager ccm, String regName, String auxiliaries, ICompositeCacheAttributes cca, String regionPrefix) Get all the properties for a region and configure its cache.- Parameters:
props
- Configuration propertiesccm
- Cache hubregName
- Name of the cache regionauxiliaries
- Comma separated list of auxiliariescca
- Cache configurationregionPrefix
- Prefix for the region- Returns:
- CompositeCache
-
newCache
-
parseCompositeCacheAttributes
protected ICompositeCacheAttributes parseCompositeCacheAttributes(Properties props, String regName, ICompositeCacheAttributes defaultCCAttr) Get an ICompositeCacheAttributes for the listed region.- Parameters:
props
- Configuration propertiesregName
- the region namedefaultCCAttr
- the default cache attributes- Returns:
- ICompositeCacheAttributes
-
parseCompositeCacheAttributes
protected ICompositeCacheAttributes parseCompositeCacheAttributes(Properties props, String regName, ICompositeCacheAttributes defaultCCAttr, String regionPrefix) Get the main attributes for a region.- Parameters:
props
- Configuration propertiesregName
- the region namedefaultCCAttr
- the default cache attributesregionPrefix
- the region prefix- Returns:
- ICompositeCacheAttributes
-
parseElementAttributes
protected IElementAttributes parseElementAttributes(Properties props, String regName, IElementAttributes defaultEAttr, String regionPrefix) Create the element attributes from the properties object for a cache region.- Parameters:
props
- Configuration propertiesregName
- the region namedefaultEAttr
- the default element attributesregionPrefix
- the region prefix- Returns:
- IElementAttributes
-
parseAuxiliary
protected <K,V> AuxiliaryCache<K,V> parseAuxiliary(Properties props, CompositeCacheManager ccm, String auxName, String regName) Get an aux cache for the listed aux for a region.- Parameters:
props
- the configuration propertiesccm
- Cache hubauxName
- the name of the auxiliary cacheregName
- the name of the region.- Returns:
- AuxiliaryCache
-
overrideWithSystemProperties
Any property values will be replaced with system property values that match the key.- Parameters:
props
-
-
parseKeyMatcher
Creates a custom key matcher if one is defined. Else, it uses the default.- Parameters:
props
-auxPrefix
- - ex. AUXILIARY_PREFIX + auxName- Returns:
- IKeyMatcher
-