public abstract class ResourceMapping extends Object
Constructor and Description |
---|
ResourceMapping(String sNamePattern,
String sSchemeName)
Construct a
ResourceMapping for resources that will use raw types by default. |
Modifier and Type | Method and Description |
---|---|
abstract String |
getConfigElementName()
Obtain the xml element name of this mapping.
|
List<NamedEventInterceptorBuilder> |
getEventInterceptorBuilders()
|
String |
getNamePattern()
Obtains the pattern used to match resource names
to this
ResourceMapping . |
String |
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).
|
com.tangosol.config.expression.ParameterResolver |
getParameterResolver()
Obtains the
ParameterResolver that is to be used to
resolve Parameter s associated with this ResourceMapping . |
ResourceRegistry |
getResourceRegistry()
Obtains the
ResourceRegistry that holds resources
associated with the ResourceMapping . |
String |
getSchemeName()
Obtains the name of the caching scheme to be used
that match this
ResourceMapping . |
List<ResourceMapping> |
getSubMappings()
Obtain the list of sub-mappings that this mapping contains
|
Object |
getValue(String sParamName)
Get value of
sParamName associated with this CacheMapping |
<T> T |
getValue(String sParamName,
Class<T> paramValueType)
Get value of
sParamName associated with this CacheMapping |
String |
getWildcardMatch(String sName)
Determines the value the wildcard * declared in the resource name
pattern for the
ResourceMapping matches. |
boolean |
isForName(String sName)
Determines if the
ResourceMapping is for (matches) the specified resource name. |
boolean |
isInternal()
Check if this ResourceMapping is for internal resources.
|
void |
setEventInterceptorBuilders(List<NamedEventInterceptorBuilder> listBuilders)
|
ResourceMapping |
setInternal(boolean fInternal)
Set the flag to indicate if this mapping is for internal resources
used by the service.
|
void |
setParameterResolver(com.tangosol.config.expression.ParameterResolver resolver)
|
boolean |
usesWildcard()
Determines if the
ResourceMapping pattern contains a * wildcard. |
abstract void |
validateScheme(Scheme scheme)
Determine whether the specified schem is valid
for this mapping type.
|
public ResourceMapping(String sNamePattern, String sSchemeName)
ResourceMapping
for resources that will use raw types by default.sNamePattern
- the pattern that maps resource names to caching schemessSchemeName
- the name of the caching scheme to which a resource matching
this ResourceMapping
will be associatedpublic abstract String getConfigElementName()
public abstract void validateScheme(Scheme scheme)
scheme
- the scheme to validateIllegalStateException
- if the scheme is not validpublic ResourceMapping setInternal(boolean fInternal)
fInternal
- true if this is for internal resourcepublic boolean isInternal()
public String getNamePattern()
ResourceMapping
.public String getSchemeName()
ResourceMapping
.public ResourceRegistry getResourceRegistry()
ResourceRegistry
that holds resources
associated with the ResourceMapping
.ResourceRegistry
public com.tangosol.config.expression.ParameterResolver getParameterResolver()
ParameterResolver
that is to be used to
resolve Parameter
s associated with this ResourceMapping
.ParameterResolver
@Injectable(value="init-params") public void setParameterResolver(com.tangosol.config.expression.ParameterResolver resolver)
resolver
- the ParameterResolver
public List<NamedEventInterceptorBuilder> getEventInterceptorBuilders()
List
over NamedEventInterceptorBuilder
s
or null
if none are defined@Injectable(value="interceptors") public void setEventInterceptorBuilders(List<NamedEventInterceptorBuilder> listBuilders)
listBuilders
- the List
of NamedEventInterceptorBuilder
spublic boolean isForName(String sName)
ResourceMapping
is for (matches) the specified resource name.sName
- the resource name to check for a matchtrue
if the ResourceMapping
is for the specified resource name,
false
otherwisepublic boolean usesWildcard()
ResourceMapping
pattern contains a * wildcard.true
if the pattern contains a * wildcard,
false
otherwisepublic String getWildcardMatch(String sName)
ResourceMapping
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".
sName
- the resource name to matchpublic <T> T getValue(String sParamName, Class<T> paramValueType)
sParamName
associated with this CacheMapping
T
- parameter value typesParamName
- parameter name to look upparamValueType
- parameter value typepublic Object getValue(String sParamName)
sParamName
associated with this CacheMapping
sParamName
- parameter name to look uppublic String getNameUsing(String sWildCardValue)
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".
sWildCardValue
- the value to replace the wildcard * withpublic List<ResourceMapping> getSubMappings()