|
Oracle® Coherence Java API Reference Release 12.1.2.0.3 E26043-02 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
com.tangosol.coherence.config.CacheMapping
public class CacheMapping
A 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.
| Constructor Summary | |
|---|---|
CacheMapping(java.lang.String sCacheNamePattern, java.lang.String sCachingSchemeName)Construct a CacheMapping. |
|
| Method Summary | |
|---|---|
java.lang.String |
getCacheNamePattern()Obtains the pattern used to match cache names to this CacheMapping. |
java.lang.String |
getCacheNameUsing(java.lang.String sWildCardValue)Determines the name of a cache given a value for the wildcard (assuming the cache name pattern for the mapping is using a wildcard). |
java.lang.String |
getCachingSchemeName()Obtains the name of the caching scheme to be used for NamedCaches that match this CacheMapping. |
java.util.List |
getEventInterceptorBuilders()Obtains the List of NamedEventInterceptorBuilders for this CacheMapping. |
com.tangosol.config.expression.ParameterResolver |
getParameterResolver()Obtains the ParameterResolver that is to be used to resolve Parameters associated with this CacheMapping. |
ResourceRegistry |
getResourceRegistry()Obtains the ResourceRegistry that holds resources associated with the CacheMapping. |
java.lang.String |
getWildcardMatch(java.lang.String sCacheName)Determines the value the wildcard * declared in the cache name pattern for the CacheMapping matches. |
boolean |
isForCacheName(java.lang.String sCacheName)Determines if the CacheMapping is for (matches) the specified cache name. |
void |
setEventInterceptorBuilders(java.util.List listBuilders)Sets the List of NamedEventInterceptorBuilders for the CacheMapping. |
void |
setParameterResolver(com.tangosol.config.expression.ParameterResolver resolver)Sets the ParameterResolver that is used to resolve Parameters associated with the CacheMapping. |
boolean |
usesWildcard()Determines if the CacheMapping pattern contains a * wildcard. |
| Constructor Detail |
|---|
public CacheMapping(java.lang.String sCacheNamePattern,
java.lang.String sCachingSchemeName)
CacheMapping.
sCacheNamePattern - the pattern that maps cache names to caching schemessCachingSchemeName - the name of the caching scheme to which caches matching this CacheMapping will be associated| Method Detail |
|---|
public java.lang.String getCacheNamePattern()
CacheMapping.public java.lang.String getCachingSchemeName()
NamedCaches that match this CacheMapping.public ResourceRegistry getResourceRegistry()
ResourceRegistry that holds resources associated with the CacheMapping.ResourceRegistrypublic com.tangosol.config.expression.ParameterResolver getParameterResolver()
ParameterResolver that is to be used to resolve Parameters associated with this CacheMapping.ParameterResolver
@Injectable(value="init-params")
public void setParameterResolver(com.tangosol.config.expression.ParameterResolver resolver)
ParameterResolver that is used to resolve Parameters associated with the CacheMapping.resolver - the ParameterResolverpublic java.util.List getEventInterceptorBuilders()
List of NamedEventInterceptorBuilders for this CacheMapping.List over NamedEventInterceptorBuilders or null if none are defined
@Injectable(value="interceptors")
public void setEventInterceptorBuilders(java.util.List listBuilders)
List of NamedEventInterceptorBuilders for the CacheMapping.listBuilders - the List of NamedEventInterceptorBuilderspublic boolean isForCacheName(java.lang.String sCacheName)
CacheMapping is for (matches) the specified cache name.sCacheName - the cacheName to check for a matchtrue if the CacheMapping is for the specified cache name, false otherwisepublic boolean usesWildcard()
CacheMapping pattern contains a * wildcard.true if the pattern contains a * wildcard, false otherwisepublic java.lang.String getWildcardMatch(java.lang.String sCacheName)
CacheMapping matches. If the pattern does not contain a wildcard * or the cache name does not match the mapping, null is returned.
Examples:
1. Calling cacheMapping.getWildcardMatch("dist-test") on a CacheMapping with the cache name pattern "dist-*" will return "test".
2. Calling cacheMapping.getWildcardMatch("dist-*") on a CacheMapping with the cache name pattern "dist-*" will return "*".
3. Calling cacheMapping.getWildcardMatch("dist-fred") on a CacheMapping with the cache name pattern "dist-fred" will return null.
4. Calling cacheMapping.getWildcardMatch("dist-fred") on a CacheMapping with the cache name pattern "repl-*" will return null.
5. Calling cacheMapping.getWildcardMatch("dist-fred") on a CacheMapping with the cache name pattern "*" will return "dist-fred".
sCacheName - the cache name to matchpublic java.lang.String getCacheNameUsing(java.lang.String sWildCardValue)
null will be returned.
Examples:
1. Calling cacheMapping.getCacheNameUsing("test") on a CacheMapping with the cache name pattern "dist-*" will return "dist-test".
2. Calling cacheMapping.getCacheNameUsing("*") on a CacheMapping with the cache name pattern "dist-*" will return "dist-*".
3. Calling cacheMapping.getCacheNameUsing("fred") on a CacheMapping with the cache name pattern "dist-fred" will return null.
4. Calling cacheMapping.getCacheNameUsing("dist-fred") on a CacheMapping with the cache name pattern "*" will return "dist-fred".
sWildCardValue - the value to replace the wildcard * with
|
Oracle® Coherence Java API Reference Release 12.1.2.0.3 E26043-02 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||