Class CacheMapping
- java.lang.Object
-
- com.tangosol.coherence.config.ResourceMapping
-
- com.tangosol.coherence.config.CacheMapping
-
- Direct Known Subclasses:
RegExCacheMapping
public class CacheMapping extends ResourceMapping
ACacheMappingcaptures configuration information for a pattern-match-based mapping from a proposedNamedCachename to a caching scheme.In addition to the mapping between a cache name and a caching scheme, each
CacheMappingretains aParameterResolver(representing user-provided parameters) to be during the realization of the said cache and scheme. (This allows individual mappings to be parameterized)Lastly
CacheMappings also provide a mechanism to associate specific strongly typed resources with each mapping at runtime. This provides a flexible and dynamic mechanism to associate further configuration information with caches.Pattern Matching Semantics: The only wildcard permitted for pattern matching with cache names is the "*" and it may only be used at the end of a cache name.
For example, the following cache name patterns are valid:
"*"andsomething-*, but*-somethingis invalid.- Since:
- Coherence 12.1.2
- Author:
- bo 2011.06.25
-
-
Field Summary
Fields Modifier and Type Field Description booleanm_fFederatedThe flag to indicate if thisCacheMappingis federated.
-
Constructor Summary
Constructors Constructor Description CacheMapping(String sCacheNamePattern, String sCachingSchemeName)Construct aCacheMappingfor caches that will use rawtypes by default.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description StringgetCacheNamePattern()Deprecated.As of Coherence 14.1.1, useResourceMapping.getNamePattern().StringgetCachingSchemeName()Deprecated.As of Coherence 14.1.1, useResourceMapping.getSchemeName().StringgetConfigElementName()Obtain the xml element name of this mapping.StringgetKeyClassName()Obtains the name of the key class forNamedCaches using thisCacheMapping.StringgetValueClassName()Obtains the name of the value class forNamedCaches using thisCacheMapping.booleanisFederated()Check if this CacheMapping is federated.CacheMappingsetFederated(boolean fIsFederated)Set true if this cache mapping is for federated caches.CacheMappingsetInternal(boolean fIsInternal)Set the flag to indicate if this mapping is for internal resources used by the service.voidsetKeyClassName(String sKeyClassName)Sets the name of the key class forNamedCaches using thisCacheMapping.voidsetValueClassName(String sValueClassName)Sets the name of the value class forNamedCaches using thisCacheMapping.booleanusesRawTypes()Determines if theCacheMappingis configured to use raw-types (ie: no type checking or constraints)voidvalidateScheme(Scheme scheme)Determine whether the specified schem is valid for this mapping type.-
Methods inherited from class com.tangosol.coherence.config.ResourceMapping
getEventInterceptorBuilders, getNamePattern, getNameUsing, getParameterResolver, getResourceRegistry, getSchemeName, getSubMappings, getValue, getValue, getWildcardMatch, isForName, isInternal, setEventInterceptorBuilders, setParameterResolver, usesWildcard
-
-
-
-
Field Detail
-
m_fFederated
public boolean m_fFederated
The flag to indicate if thisCacheMappingis federated.
-
-
Constructor Detail
-
CacheMapping
public CacheMapping(String sCacheNamePattern, String sCachingSchemeName)
Construct aCacheMappingfor caches that will use rawtypes by default.- Parameters:
sCacheNamePattern- the pattern that maps cache names to caching schemessCachingSchemeName- the name of the caching scheme to which caches matching thisCacheMappingwill be associated
-
-
Method Detail
-
getConfigElementName
public String getConfigElementName()
Description copied from class:ResourceMappingObtain the xml element name of this mapping.- Specified by:
getConfigElementNamein classResourceMapping- Returns:
- the xml element name of this mapping
-
validateScheme
public void validateScheme(Scheme scheme)
Description copied from class:ResourceMappingDetermine whether the specified schem is valid for this mapping type.- Specified by:
validateSchemein classResourceMapping- Parameters:
scheme- the scheme to validate
-
setFederated
@Injectable("federated") public CacheMapping setFederated(boolean fIsFederated)
Set true if this cache mapping is for federated caches. This has no effect for non-federated caches.- Parameters:
fIsFederated- true if this cache is to be federated- Returns:
- this CacheMapping object
-
isFederated
public boolean isFederated()
Check if this CacheMapping is federated.- Returns:
- true if this CacheMapping is federated
-
setInternal
public CacheMapping setInternal(boolean fIsInternal)
Description copied from class:ResourceMappingSet the flag to indicate if this mapping is for internal resources used by the service.- Overrides:
setInternalin classResourceMapping- Parameters:
fIsInternal- true if this is for internal resource- Returns:
- this ResourceMapping object
-
getCacheNamePattern
public String getCacheNamePattern()
Deprecated.As of Coherence 14.1.1, useResourceMapping.getNamePattern().Obtains the pattern used to match cache names to thisCacheMapping.- Returns:
- the pattern
-
getCachingSchemeName
public String getCachingSchemeName()
Deprecated.As of Coherence 14.1.1, useResourceMapping.getSchemeName().Obtains the name of the caching scheme to be used forNamedCaches that match thisCacheMapping.- Returns:
- the name of the associated caching scheme
-
getKeyClassName
public String getKeyClassName()
Obtains the name of the key class forNamedCaches using thisCacheMapping.- Returns:
- the name of the key class or
nullif rawtypes are being used
-
getValueClassName
public String getValueClassName()
Obtains the name of the value class forNamedCaches using thisCacheMapping.- Returns:
- the name of the value class or
nullif rawtypes are being used
-
usesRawTypes
public boolean usesRawTypes()
Determines if theCacheMappingis configured to use raw-types (ie: no type checking or constraints)- Returns:
trueif using rawtypes,falseotherwise
-
setKeyClassName
@Injectable("key-type") public void setKeyClassName(String sKeyClassName)
Sets the name of the key class forNamedCaches using thisCacheMapping.- Parameters:
sKeyClassName- the name of the key class ornullif rawtypes are being used
-
setValueClassName
@Injectable("value-type") public void setValueClassName(String sValueClassName)
Sets the name of the value class forNamedCaches using thisCacheMapping.- Parameters:
sValueClassName- the name of the value class ornullif rawtypes are being used
-
-