public class CacheMapping extends ResourceMapping
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.
Modifier and Type | Field and Description |
---|---|
boolean |
m_fFederated
The flag to indicate if this
CacheMapping is federated. |
Constructor and Description |
---|
CacheMapping(String sCacheNamePattern,
String sCachingSchemeName)
Construct a
CacheMapping for caches that will use rawtypes by default. |
Modifier and Type | Method and Description |
---|---|
String |
getCacheNamePattern()
Deprecated.
As of Coherence 14.1.1, use
ResourceMapping.getNamePattern() . |
String |
getCachingSchemeName()
Deprecated.
As of Coherence 14.1.1, use
ResourceMapping.getSchemeName() . |
String |
getConfigElementName()
Obtain the xml element name of this mapping.
|
String |
getKeyClassName()
Obtains the name of the key class for
NamedCache s using this CacheMapping . |
String |
getValueClassName()
Obtains the name of the value class for
NamedCache s using this CacheMapping . |
boolean |
isFederated()
Check if this CacheMapping is federated.
|
CacheMapping |
setFederated(boolean fIsFederated)
Set true if this cache mapping is for federated caches.
|
CacheMapping |
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 for
NamedCache s using this CacheMapping . |
void |
setValueClassName(String sValueClassName)
Sets the name of the value class for
NamedCache s using this CacheMapping . |
boolean |
usesRawTypes()
Determines if the
CacheMapping 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.
|
getEventInterceptorBuilders, getNamePattern, getNameUsing, getParameterResolver, getResourceRegistry, getSchemeName, getSubMappings, getValue, getValue, getWildcardMatch, isForName, isInternal, setEventInterceptorBuilders, setParameterResolver, usesWildcard
public boolean m_fFederated
CacheMapping
is federated.public CacheMapping(String sCacheNamePattern, String sCachingSchemeName)
CacheMapping
for caches that will use rawtypes by default.sCacheNamePattern
- the pattern that maps cache names to caching schemessCachingSchemeName
- the name of the caching scheme to which caches matching this
CacheMapping
will be associatedpublic String getConfigElementName()
ResourceMapping
getConfigElementName
in class ResourceMapping
public void validateScheme(Scheme scheme)
ResourceMapping
validateScheme
in class ResourceMapping
scheme
- the scheme to validate@Injectable(value="federated") public CacheMapping setFederated(boolean fIsFederated)
fIsFederated
- true if this cache is to be federatedpublic boolean isFederated()
public CacheMapping setInternal(boolean fIsInternal)
ResourceMapping
setInternal
in class ResourceMapping
fIsInternal
- true if this is for internal resourcepublic String getCacheNamePattern()
ResourceMapping.getNamePattern()
.CacheMapping
.public String getCachingSchemeName()
ResourceMapping.getSchemeName()
.NamedCache
s that match this CacheMapping
.public String getKeyClassName()
NamedCache
s using this CacheMapping
.null
if rawtypes are being usedpublic String getValueClassName()
NamedCache
s using this CacheMapping
.null
if rawtypes are being usedpublic boolean usesRawTypes()
CacheMapping
is configured to use raw-types
(ie: no type checking or constraints)true
if using rawtypes, false
otherwise@Injectable(value="key-type") public void setKeyClassName(String sKeyClassName)
NamedCache
s using this CacheMapping
.sKeyClassName
- the name of the key class or null
if rawtypes are being used@Injectable(value="value-type") public void setValueClassName(String sValueClassName)
NamedCache
s using this CacheMapping
.sValueClassName
- the name of the value class or null
if rawtypes are being used