Class TopicMapping
- java.lang.Object
-
- com.tangosol.coherence.config.ResourceMapping
-
- com.tangosol.coherence.config.TopicMapping
-
public class TopicMapping extends ResourceMapping
ATopicMapping
captures configuration information for a pattern-match-based mapping from a proposedNamedTopic
name to a topic scheme.In addition to the mapping between a topic name and a topic scheme, each
TopicMapping
retains aParameterResolver
(representing user-provided parameters) to be used during the realization of the said topic and scheme. (This allows individual mappings to be parameterized)Lastly
TopicMapping
s also provide a mechanism to associate specific strongly typed resources with each mapping at runtime. This provides a flexible and dynamic mechanism to associate further configuration information with topics.Pattern Matching Semantics: The only wildcard permitted for pattern matching with topic names is the "*" and it may only be used at the end of a topic name.
For example, the following topic name patterns are valid:
"*"
andsomething-*
, but*-something
is invalid.- Since:
- Coherence 14.1.1
- Author:
- jk 2015.05.28
-
-
Constructor Summary
Constructors Constructor Description TopicMapping(String sTopicNamePattern, String sCachingSchemeName, Class<? extends TopicScheme> clsScheme)
Construct aTopicMapping
for topics that will use raw types by default.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getConfigElementName()
Obtain the xml element name of this mapping.Collection<SubscriberGroupBuilder>
getSubscriberGroupBuilders()
Get the durableSubscriberGroupBuilder
s for thisTopicMapping
.String
getValueClassName()
Obtains the name of the value class forNamedTopic
s using thisTopicMapping
.void
setSubscriberGroupBuilders(Collection<SubscriberGroupBuilder> colBuilders)
Set the durableSubscriberGroupBuilder
s for thisTopicMapping
.void
setValueClassName(String sElementClassName)
Sets the name of the value class forNamedTopic
s using thisTopicMapping
.boolean
usesRawTypes()
Determines if theTopicMapping
is configured to use raw-types (ie: no type checking or constraints)void
validateScheme(Scheme scheme)
Determine whether the specified schem is valid for this mapping type.-
Methods inherited from class com.tangosol.coherence.config.ResourceMapping
getEventInterceptorBuilders, getNamePattern, getNameUsing, getParameterResolver, getResourceRegistry, getSchemeName, getSubMappings, getValue, getValue, getWildcardMatch, isForName, isInternal, setEventInterceptorBuilders, setInternal, setParameterResolver, usesWildcard
-
-
-
-
Constructor Detail
-
TopicMapping
public TopicMapping(String sTopicNamePattern, String sCachingSchemeName, Class<? extends TopicScheme> clsScheme)
Construct aTopicMapping
for topics that will use raw types by default.- Parameters:
sTopicNamePattern
- the pattern that maps topic names to caching schemessCachingSchemeName
- the name of the caching scheme to which topics matching thisTopicMapping
will be associated
-
-
Method Detail
-
getConfigElementName
public String getConfigElementName()
Description copied from class:ResourceMapping
Obtain the xml element name of this mapping.- Specified by:
getConfigElementName
in classResourceMapping
- Returns:
- the xml element name of this mapping
-
validateScheme
public void validateScheme(Scheme scheme)
Description copied from class:ResourceMapping
Determine whether the specified schem is valid for this mapping type.- Specified by:
validateScheme
in classResourceMapping
- Parameters:
scheme
- the scheme to validate
-
getValueClassName
public String getValueClassName()
Obtains the name of the value class forNamedTopic
s using thisTopicMapping
.- Returns:
- the name of the value class or
null
if rawtypes are being used
-
setValueClassName
@Injectable("value-type") public void setValueClassName(String sElementClassName)
Sets the name of the value class forNamedTopic
s using thisTopicMapping
.- Parameters:
sElementClassName
- the name of the value class ornull
if rawtypes are being used
-
usesRawTypes
public boolean usesRawTypes()
Determines if theTopicMapping
is configured to use raw-types (ie: no type checking or constraints)- Returns:
true
if using raw types,false
otherwise
-
setSubscriberGroupBuilders
@Injectable("subscriber-groups") public void setSubscriberGroupBuilders(Collection<SubscriberGroupBuilder> colBuilders)
Set the durableSubscriberGroupBuilder
s for thisTopicMapping
.- Parameters:
colBuilders
- collection of SubscriberGroupBuilders.
-
getSubscriberGroupBuilders
public Collection<SubscriberGroupBuilder> getSubscriberGroupBuilders()
Get the durableSubscriberGroupBuilder
s for thisTopicMapping
.- Returns:
- collection of SubscriberGroupBuilder(s).
-
-