Package com.tangosol.coherence.config
Class SchemeMappingRegistry
- java.lang.Object
-
- com.tangosol.coherence.config.SchemeMappingRegistry
-
- All Implemented Interfaces:
ResourceMappingRegistry
,Iterable<ResourceMapping>
public class SchemeMappingRegistry extends Object implements ResourceMappingRegistry
ASchemeMappingRegistry
provides a mechanism to manage a collection ofResourceMapping
s, together with the ability to search the registry for saidResourceMapping
s, possibly using wildcards.SchemeMappingRegistry
s areIterable
, the order of iteration being that in which theResourceMapping
s where added to the saidSchemeMappingRegistry
.There is a separate namespace for
CacheMapping
andTopicMapping
, allowing for a cache and a topic with exactly same name.- Since:
- Coherence 14.1.1
- Author:
- jk 2015.06.01
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SchemeMappingRegistry.SchemeMappingKey
Key class for a scheme mapping.
-
Constructor Summary
Constructors Constructor Description SchemeMappingRegistry()
Construct aSchemeMappingRegistry
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <M extends ResourceMapping>
MfindMapping(String sName, Class<M> type)
Attempts to find theResourceMapping
that matches the specified name and type.Iterator<ResourceMapping>
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 Detail
-
SchemeMappingRegistry
public SchemeMappingRegistry()
Construct aSchemeMappingRegistry
.
-
-
Method Detail
-
iterator
public Iterator<ResourceMapping> iterator()
- Specified by:
iterator
in interfaceIterable<ResourceMapping>
-
register
public void register(ResourceMapping mapping) throws IllegalArgumentException
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
public <M extends ResourceMapping> M findMapping(String sName, Class<M> type)
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
-
-