Interface ResourceMappingRegistry
-
- All Superinterfaces:
Iterable<ResourceMapping>
- All Known Implementing Classes:
SchemeMappingRegistry
public interface ResourceMappingRegistry extends Iterable<ResourceMapping>
ASchemeMappingRegistry
provides a mechanism manage a collection ofResourceMapping
s, together with the ability to search the registry for saidResourceMapping
s, possibly using wild-cards.ResourceMappingRegistry
s areIterable
, the order of iteration being that in which theResourceMapping
s where added to the saidResourceMappingRegistry
.- Since:
- Coherence 14.1.1
- Author:
- jk 2015.06.01
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default CacheMapping
findCacheMapping(String sName)
Attempts to find theCacheMapping
that matches the specified name and type.<M extends ResourceMapping>
MfindMapping(String sName, Class<M> type)
Attempts to find theResourceMapping
that matches the specified name and type.void
register(ResourceMapping mapping)
Registers aResourceMapping
with theResourceMappingRegistry
.int
size()
Determines the number ofResourceMapping
s in thisResourceMappingRegistry
.-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
-
-
-
Method Detail
-
register
void register(ResourceMapping mapping) throws IllegalArgumentException
Registers aResourceMapping
with theResourceMappingRegistry
.- Parameters:
mapping
- theResourceMapping
to register- Throws:
IllegalArgumentException
- if aResourceMapping
with the same pattern has already been registered
-
findCacheMapping
default CacheMapping findCacheMapping(String sName)
Attempts to find theCacheMapping
that matches the specified name and type.The matching algorithm first attempts to find an exact match of a
CacheMapping
with the provided name. Should that fail, all of the currently registered wild-cardedCacheMapping
s are searched to find a match (in the order in which they were registered), with the most specific (longest match) being returned if there are multiple matches.- Parameters:
sName
- the name- Returns:
null
if a mapping could not be located for the specified name and type
-
findMapping
<M extends ResourceMapping> M findMapping(String sName, Class<M> type)
Attempts to find theResourceMapping
that matches the specified name and type.The matching algorithm first attempts to find an exact match of a
ResourceMapping
with the provided name. Should that fail, all of the currently registered wild-cardedResourceMapping
s are searched to find a match (in the order in which they were registered), with the most specific (longest match) being returned if there are multiple matches.- Parameters:
sName
- the nametype
- the type of the mapping to locate- Returns:
null
if a mapping could not be located for the specified name and type
-
size
int size()
Determines the number ofResourceMapping
s in thisResourceMappingRegistry
.- Returns:
- the number of
ResourceMapping
s
-
-