Interface ResourceMappingRegistry
-
- All Superinterfaces:
Iterable<ResourceMapping>
- All Known Implementing Classes:
SchemeMappingRegistry
public interface ResourceMappingRegistry extends Iterable<ResourceMapping>
ASchemeMappingRegistryprovides a mechanism manage a collection ofResourceMappings, together with the ability to search the registry for saidResourceMappings, possibly using wild-cards.ResourceMappingRegistrys areIterable, the order of iteration being that in which theResourceMappings 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 CacheMappingfindCacheMapping(String sName)Attempts to find theCacheMappingthat matches the specified name and type.<M extends ResourceMapping>
MfindMapping(String sName, Class<M> type)Attempts to find theResourceMappingthat matches the specified name and type.voidregister(ResourceMapping mapping)Registers aResourceMappingwith theResourceMappingRegistry.intsize()Determines the number ofResourceMappings in thisResourceMappingRegistry.-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
-
-
-
Method Detail
-
register
void register(ResourceMapping mapping) throws IllegalArgumentException
Registers aResourceMappingwith theResourceMappingRegistry.- Parameters:
mapping- theResourceMappingto register- Throws:
IllegalArgumentException- if aResourceMappingwith the same pattern has already been registered
-
findCacheMapping
default CacheMapping findCacheMapping(String sName)
Attempts to find theCacheMappingthat matches the specified name and type.The matching algorithm first attempts to find an exact match of a
CacheMappingwith the provided name. Should that fail, all of the currently registered wild-cardedCacheMappings 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:
nullif 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 theResourceMappingthat matches the specified name and type.The matching algorithm first attempts to find an exact match of a
ResourceMappingwith the provided name. Should that fail, all of the currently registered wild-cardedResourceMappings 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:
nullif a mapping could not be located for the specified name and type
-
size
int size()
Determines the number ofResourceMappings in thisResourceMappingRegistry.- Returns:
- the number of
ResourceMappings
-
-