Class CacheMapping
- Direct Known Subclasses:
RegExCacheMapping
CacheMapping captures configuration information for a pattern-match-based mapping from a proposed
NamedCache name to a caching scheme.
In addition to the mapping between a cache name and a caching scheme, each CacheMapping retains a
ParameterResolver (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:
"*" and something-*, but *-something is invalid.
- Since:
- Coherence 12.1.2
- Author:
- bo 2011.06.25
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCacheMapping(String sCacheNamePattern, String sCachingSchemeName) Construct aCacheMappingfor caches that will use rawtypes by default. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Deprecated.As of Coherence 14.1.1, useResourceMapping.getSchemeName().Obtain the xml element name of this mapping.Obtains the name of the key class forNamedCaches using thisCacheMapping.Obtains the name of the value class forNamedCaches using thisCacheMapping.booleanCheck if this CacheMapping is federated.setFederated(boolean fIsFederated) Set true if this cache mapping is for federated caches.setInternal(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.booleanDetermines 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 Details
-
m_fFederated
public boolean m_fFederatedThe flag to indicate if thisCacheMappingis federated.
-
-
Constructor Details
-
CacheMapping
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 Details
-
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
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
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
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
Deprecated.As of Coherence 14.1.1, useResourceMapping.getNamePattern().Obtains the pattern used to match cache names to thisCacheMapping.- Returns:
- the pattern
-
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
Obtains the name of the key class forNamedCaches using thisCacheMapping.- Returns:
- the name of the key class or
nullif rawtypes are being used
-
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
Sets the name of the key class forNamedCaches using thisCacheMapping.- Parameters:
sKeyClassName- the name of the key class ornullif rawtypes are being used
-
setValueClassName
Sets the name of the value class forNamedCaches using thisCacheMapping.- Parameters:
sValueClassName- the name of the value class ornullif rawtypes are being used
-
ResourceMapping.getNamePattern().