Class ResourceMapping
- Direct Known Subclasses:
CacheMapping
,TopicMapping
- Since:
- Coherence 14.1.1
- Author:
- jk 2015.05.21
-
Constructor Summary
ConstructorDescriptionResourceMapping
(String sNamePattern, String sSchemeName) Construct aResourceMapping
for resources that will use raw types by default. -
Method Summary
Modifier and TypeMethodDescriptionabstract String
Obtain the xml element name of this mapping.Obtains the pattern used to match resource names to thisResourceMapping
.getNameUsing
(String sWildCardValue) Determines the name of a resource given a value for the wildcard (assuming the resource name pattern for the mapping is using a wildcard).Obtains theParameterResolver
that is to be used to resolveParameter
s associated with thisResourceMapping
.Obtains theResourceRegistry
that holds resources associated with theResourceMapping
.Obtains the name of the caching scheme to be used that match thisResourceMapping
.Obtain the list of sub-mappings that this mapping containsGet value ofsParamName
associated with thisCacheMapping
<T> T
Get value ofsParamName
associated with thisCacheMapping
getWildcardMatch
(String sName) Determines the value the wildcard * declared in the resource name pattern for theResourceMapping
matches.boolean
Determines if theResourceMapping
is for (matches) the specified resource name.boolean
Check if this ResourceMapping is for internal resources.void
setEventInterceptorBuilders
(List<NamedEventInterceptorBuilder> listBuilders) setInternal
(boolean fInternal) Set the flag to indicate if this mapping is for internal resources used by the service.void
setParameterResolver
(ParameterResolver resolver) boolean
Determines if theResourceMapping
pattern contains a * wildcard.abstract void
validateScheme
(Scheme scheme) Determine whether the specified schem is valid for this mapping type.
-
Constructor Details
-
ResourceMapping
Construct aResourceMapping
for resources that will use raw types by default.- Parameters:
sNamePattern
- the pattern that maps resource names to caching schemessSchemeName
- the name of the caching scheme to which a resource matching thisResourceMapping
will be associated
-
-
Method Details
-
getConfigElementName
Obtain the xml element name of this mapping.- Returns:
- the xml element name of this mapping
-
validateScheme
Determine whether the specified schem is valid for this mapping type.- Parameters:
scheme
- the scheme to validate- Throws:
IllegalStateException
- if the scheme is not valid
-
setInternal
Set the flag to indicate if this mapping is for internal resources used by the service.- Parameters:
fInternal
- true if this is for internal resource- Returns:
- this ResourceMapping object
-
isInternal
public boolean isInternal()Check if this ResourceMapping is for internal resources.- Returns:
- true if this is for internal resources
-
getNamePattern
Obtains the pattern used to match resource names to thisResourceMapping
.- Returns:
- the pattern
-
getSchemeName
Obtains the name of the caching scheme to be used that match thisResourceMapping
.- Returns:
- the name of the associated caching scheme
-
getResourceRegistry
Obtains theResourceRegistry
that holds resources associated with theResourceMapping
.- Returns:
- the
ResourceRegistry
-
getParameterResolver
Obtains theParameterResolver
that is to be used to resolveParameter
s associated with thisResourceMapping
.- Returns:
- the
ParameterResolver
-
setParameterResolver
- Parameters:
resolver
- theParameterResolver
-
getEventInterceptorBuilders
- Returns:
- an
List
overNamedEventInterceptorBuilder
s ornull
if none are defined
-
setEventInterceptorBuilders
@Injectable("interceptors") public void setEventInterceptorBuilders(List<NamedEventInterceptorBuilder> listBuilders) - Parameters:
listBuilders
- theList
ofNamedEventInterceptorBuilder
s
-
isForName
Determines if theResourceMapping
is for (matches) the specified resource name.- Parameters:
sName
- the resource name to check for a match- Returns:
true
if theResourceMapping
is for the specified resource name,false
otherwise
-
usesWildcard
public boolean usesWildcard()Determines if theResourceMapping
pattern contains a * wildcard.- Returns:
true
if the pattern contains a * wildcard,false
otherwise
-
getWildcardMatch
Determines the value the wildcard * declared in the resource name pattern for theResourceMapping
matches. If the pattern does not contain a wildcard * or the resource name does not match the mapping,null
is returned.Examples:
1. Calling mapping.getWildcardMatch("dist-test") on a ResourceMapping with the resource name pattern "dist-*" will return "test".
2. Calling mapping.getWildcardMatch("dist-*") on a ResourceMapping with the resource name pattern "dist-*" will return "*".
3. Calling mapping.getWildcardMatch("dist-fred") on a ResourceMapping with the resource name pattern "dist-fred" will return
null
.4. Calling mapping.getWildcardMatch("dist-fred") on a ResourceMapping with the resource name pattern "repl-*" will return
null
.5. Calling mapping.getWildcardMatch("dist-fred") on a ResourceMapping with the resource name pattern "*" will return "dist-fred".
- Parameters:
sName
- the resource name to match- Returns:
- the resource name string that matches the wildcard.
-
getValue
Get value ofsParamName
associated with thisCacheMapping
- Type Parameters:
T
- parameter value type- Parameters:
sParamName
- parameter name to look upparamValueType
- parameter value type- Returns:
- parameter value as an instance of paramValueType or null if parameter is not defined
-
getValue
Get value ofsParamName
associated with thisCacheMapping
- Parameters:
sParamName
- parameter name to look up- Returns:
- parameter value or null if parameter is not found
-
getNameUsing
Determines the name of a resource given a value for the wildcard (assuming the resource name pattern for the mapping is using a wildcard). If the pattern does not contain a wildcard *,null
will be returned.Examples:
1. Calling mapping.getNameUsing("test") on a ResourceMapping with the resource name pattern "dist-*" will return "dist-test".
2. Calling mapping.getNameUsing("*") on a ResourceMapping with the resource name pattern "dist-*" will return "dist-*".
3. Calling mapping.getNameUsing("fred") on a ResourceMapping with the resource name pattern "dist-fred" will return
null
.4. Calling mapping.getNameUsing("dist-fred") on a ResourceMapping with the resource name pattern "*" will return "dist-fred".
- Parameters:
sWildCardValue
- the value to replace the wildcard * with- Returns:
- the resource name with the wildcard replaced with the specified value
-
getSubMappings
Obtain the list of sub-mappings that this mapping contains- Returns:
- the list of sub-mappings that this mapping contains.
-