Package com.tangosol.coherence.config
Class SchemeMappingRegistry
java.lang.Object
com.tangosol.coherence.config.SchemeMappingRegistry
- All Implemented Interfaces:
ResourceMappingRegistry
,Iterable<ResourceMapping>
A
SchemeMappingRegistry
provides a mechanism to manage a collection
of ResourceMapping
s, together with the ability to search the registry for
said ResourceMapping
s, possibly using wildcards.
SchemeMappingRegistry
s are Iterable
, the order of iteration
being that in which the ResourceMapping
s 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.
- Since:
- Coherence 14.1.1
- Author:
- jk 2015.06.01
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Key class for a scheme mapping. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<M extends ResourceMapping>
MfindMapping
(String sName, Class<M> type) Attempts to find theResourceMapping
that matches the specified name and type.iterator()
void
register
(ResourceMapping mapping) Registers aResourceMapping
with theResourceMappingRegistry
.int
size()
Determines the number ofResourceMapping
s in thisResourceMappingRegistry
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface com.tangosol.coherence.config.ResourceMappingRegistry
findCacheMapping
-
Constructor Details
-
SchemeMappingRegistry
public SchemeMappingRegistry()Construct aSchemeMappingRegistry
.
-
-
Method Details
-
iterator
- Specified by:
iterator
in interfaceIterable<ResourceMapping>
-
register
Description copied from interface:ResourceMappingRegistry
Registers aResourceMapping
with theResourceMappingRegistry
.- Specified by:
register
in interfaceResourceMappingRegistry
- Parameters:
mapping
- theResourceMapping
to register- Throws:
IllegalArgumentException
- if aResourceMapping
with the same pattern has already been registered
-
findMapping
Description copied from interface:ResourceMappingRegistry
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.- Specified by:
findMapping
in interfaceResourceMappingRegistry
- 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
public int size()Description copied from interface:ResourceMappingRegistry
Determines the number ofResourceMapping
s in thisResourceMappingRegistry
.- Specified by:
size
in interfaceResourceMappingRegistry
- Returns:
- the number of
ResourceMapping
s
-