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
ASchemeMappingRegistryprovides a mechanism to manage a collection ofResourceMappings, together with the ability to search the registry for saidResourceMappings, possibly using wildcards.SchemeMappingRegistrys areIterable, the order of iteration being that in which theResourceMappings where added to the saidSchemeMappingRegistry.There is a separate namespace for
CacheMappingandTopicMapping, 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 classSchemeMappingRegistry.SchemeMappingKeyKey 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 theResourceMappingthat matches the specified name and type.Iterator<ResourceMapping>iterator()voidregister(ResourceMapping mapping)Registers aResourceMappingwith theResourceMappingRegistry.intsize()Determines the number ofResourceMappings 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:
iteratorin interfaceIterable<ResourceMapping>
-
register
public void register(ResourceMapping mapping) throws IllegalArgumentException
Description copied from interface:ResourceMappingRegistryRegisters aResourceMappingwith theResourceMappingRegistry.- Specified by:
registerin interfaceResourceMappingRegistry- Parameters:
mapping- theResourceMappingto register- Throws:
IllegalArgumentException- if aResourceMappingwith the same pattern has already been registered
-
findMapping
public <M extends ResourceMapping> M findMapping(String sName, Class<M> type)
Description copied from interface:ResourceMappingRegistryAttempts 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.- Specified by:
findMappingin interfaceResourceMappingRegistry- 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
public int size()
Description copied from interface:ResourceMappingRegistryDetermines the number ofResourceMappings in thisResourceMappingRegistry.- Specified by:
sizein interfaceResourceMappingRegistry- Returns:
- the number of
ResourceMappings
-
-