public class TopicMapping extends ResourceMapping
TopicMapping
captures configuration information for a pattern-match-based mapping from a proposed
NamedTopic
name to a topic scheme.
In addition to the mapping between a topic name and a topic scheme, each TopicMapping
retains a
ParameterResolver
(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:
"*"
and something-*
, but *-something
is invalid.
Constructor and Description |
---|
TopicMapping(String sTopicNamePattern,
String sCachingSchemeName,
Class<? extends TopicScheme> clsScheme)
Construct a
TopicMapping for topics that will use raw types by default. |
Modifier and Type | Method and Description |
---|---|
String |
getConfigElementName()
Obtain the xml element name of this mapping.
|
Collection<SubscriberGroupBuilder> |
getSubscriberGroupBuilders()
Get the durable
SubscriberGroupBuilder s for this TopicMapping . |
String |
getValueClassName()
Obtains the name of the value class for
NamedTopic s using this TopicMapping . |
void |
setSubscriberGroupBuilders(Collection<SubscriberGroupBuilder> colBuilders)
Set the durable
SubscriberGroupBuilder s for this TopicMapping . |
void |
setValueClassName(String sElementClassName)
Sets the name of the value class for
NamedTopic s using this TopicMapping . |
boolean |
usesRawTypes()
Determines if the
TopicMapping 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.
|
getEventInterceptorBuilders, getNamePattern, getNameUsing, getParameterResolver, getResourceRegistry, getSchemeName, getSubMappings, getValue, getValue, getWildcardMatch, isForName, isInternal, setEventInterceptorBuilders, setInternal, setParameterResolver, usesWildcard
public TopicMapping(String sTopicNamePattern, String sCachingSchemeName, Class<? extends TopicScheme> clsScheme)
TopicMapping
for topics that will use raw types by default.sTopicNamePattern
- the pattern that maps topic names to caching schemessCachingSchemeName
- the name of the caching scheme to which topics matching this
TopicMapping
will be associatedpublic String getConfigElementName()
ResourceMapping
getConfigElementName
in class ResourceMapping
public void validateScheme(Scheme scheme)
ResourceMapping
validateScheme
in class ResourceMapping
scheme
- the scheme to validatepublic String getValueClassName()
NamedTopic
s using this TopicMapping
.null
if rawtypes are being used@Injectable(value="value-type") public void setValueClassName(String sElementClassName)
NamedTopic
s using this TopicMapping
.sElementClassName
- the name of the value class or null
if rawtypes are being usedpublic boolean usesRawTypes()
TopicMapping
is configured to use raw-types
(ie: no type checking or constraints)true
if using raw types, false
otherwise@Injectable(value="subscriber-groups") public void setSubscriberGroupBuilders(Collection<SubscriberGroupBuilder> colBuilders)
SubscriberGroupBuilder
s for this TopicMapping
.colBuilders
- collection of SubscriberGroupBuilders.public Collection<SubscriberGroupBuilder> getSubscriberGroupBuilders()
SubscriberGroupBuilder
s for this TopicMapping
.