public class SchemeMappingRegistry extends Object implements ResourceMappingRegistry
SchemeMappingRegistry provides a mechanism to manage a collection
of ResourceMappings, together with the ability to search the registry for
said ResourceMappings, possibly using wildcards.
SchemeMappingRegistrys are Iterable, the order of iteration
being that in which the ResourceMappings where added to the said
SchemeMappingRegistry.
There is a separate namespace for CacheMapping and TopicMapping, allowing
for a cache and a topic with exactly same name.
| Modifier and Type | Class and Description |
|---|---|
static class |
SchemeMappingRegistry.SchemeMappingKey
Key class for a scheme mapping.
|
| Constructor and Description |
|---|
SchemeMappingRegistry()
Construct a
SchemeMappingRegistry. |
| Modifier and Type | Method and Description |
|---|---|
<M extends ResourceMapping> |
findMapping(String sName,
Class<M> type)
Attempts to find the
ResourceMapping that matches the specified
name and type. |
Iterator<ResourceMapping> |
iterator() |
void |
register(ResourceMapping mapping)
Registers a
ResourceMapping with the ResourceMappingRegistry. |
int |
size()
Determines the number of
ResourceMappings in this ResourceMappingRegistry. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfindCacheMappingforEach, spliteratorpublic SchemeMappingRegistry()
SchemeMappingRegistry.public Iterator<ResourceMapping> iterator()
iterator in interface Iterable<ResourceMapping>public void register(ResourceMapping mapping) throws IllegalArgumentException
ResourceMappingRegistryResourceMapping with the ResourceMappingRegistry.register in interface ResourceMappingRegistrymapping - the ResourceMapping to registerIllegalArgumentException - if a ResourceMapping with the same
pattern has already been registeredpublic <M extends ResourceMapping> M findMapping(String sName, Class<M> type)
ResourceMappingRegistryResourceMapping 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-carded ResourceMappings 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.
findMapping in interface ResourceMappingRegistrysName - the nametype - the type of the mapping to locatenull if a mapping could not be located
for the specified name and typepublic int size()
ResourceMappingRegistryResourceMappings in this ResourceMappingRegistry.size in interface ResourceMappingRegistryResourceMappings