Interface ResourceMappingRegistry
- All Superinterfaces:
Iterable<ResourceMapping>
- All Known Implementing Classes:
SchemeMappingRegistry
SchemeMappingRegistry provides a mechanism manage a collection
of ResourceMappings, together with the ability to search the registry for
said ResourceMappings, possibly using wild-cards.
ResourceMappingRegistrys are Iterable, the order of iteration
being that in which the ResourceMappings where added to the said
ResourceMappingRegistry.
- Since:
- Coherence 14.1.1
- Author:
- jk 2015.06.01
-
Method Summary
Modifier and TypeMethodDescriptiondefault 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 Details
-
register
Registers aResourceMappingwith theResourceMappingRegistry.- Parameters:
mapping- theResourceMappingto register- Throws:
IllegalArgumentException- if aResourceMappingwith the same pattern has already been registered
-
findCacheMapping
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
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
-