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 CacheMapping
s 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
-
Constructor Summary
ConstructorDescriptionCacheMapping
(String sCacheNamePattern, String sCachingSchemeName) Construct aCacheMapping
for 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 forNamedCache
s using thisCacheMapping
.Obtains the name of the value class forNamedCache
s using thisCacheMapping
.boolean
Check 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.void
setKeyClassName
(String sKeyClassName) Sets the name of the key class forNamedCache
s using thisCacheMapping
.void
setValueClassName
(String sValueClassName) Sets the name of the value class forNamedCache
s using thisCacheMapping
.boolean
Determines if theCacheMapping
is configured to use raw-types (ie: no type checking or constraints)void
validateScheme
(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 thisCacheMapping
is federated.
-
-
Constructor Details
-
CacheMapping
Construct aCacheMapping
for 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 thisCacheMapping
will be associated
-
-
Method Details
-
getConfigElementName
Description copied from class:ResourceMapping
Obtain the xml element name of this mapping.- Specified by:
getConfigElementName
in classResourceMapping
- Returns:
- the xml element name of this mapping
-
validateScheme
Description copied from class:ResourceMapping
Determine whether the specified schem is valid for this mapping type.- Specified by:
validateScheme
in 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:ResourceMapping
Set the flag to indicate if this mapping is for internal resources used by the service.- Overrides:
setInternal
in 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 forNamedCache
s that match thisCacheMapping
.- Returns:
- the name of the associated caching scheme
-
getKeyClassName
Obtains the name of the key class forNamedCache
s using thisCacheMapping
.- Returns:
- the name of the key class or
null
if rawtypes are being used
-
getValueClassName
Obtains the name of the value class forNamedCache
s using thisCacheMapping
.- Returns:
- the name of the value class or
null
if rawtypes are being used
-
usesRawTypes
public boolean usesRawTypes()Determines if theCacheMapping
is configured to use raw-types (ie: no type checking or constraints)- Returns:
true
if using rawtypes,false
otherwise
-
setKeyClassName
Sets the name of the key class forNamedCache
s using thisCacheMapping
.- Parameters:
sKeyClassName
- the name of the key class ornull
if rawtypes are being used
-
setValueClassName
Sets the name of the value class forNamedCache
s using thisCacheMapping
.- Parameters:
sValueClassName
- the name of the value class ornull
if rawtypes are being used
-
ResourceMapping.getNamePattern()
.