public abstract class AbstractMappingMessageRouter extends AbstractMessageRouter implements MappingMessageRouterManagement
loggerHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE| Constructor and Description |
|---|
AbstractMappingMessageRouter() |
| Modifier and Type | Method and Description |
|---|---|
protected Collection<MessageChannel> |
determineTargetChannels(Message<?> message)
Subclasses must implement this method to return a Collection of zero or more
MessageChannels to which the given Message should be routed.
|
protected abstract List<Object> |
getChannelKeys(Message<?> message)
Subclasses must implement this method to return the channel keys.
|
Map<String,String> |
getChannelMappings()
Returns an unmodifiable version of the channel mappings.
|
void |
onInit()
Subclasses may implement this for initialization logic.
|
void |
removeChannelMapping(String key)
Remove a channel mapping for the given key if present.
|
void |
replaceChannelMappings(Properties channelMappings)
Convenience method allowing conversion of a list
of mappings in a control-bus message.
|
void |
setChannelMapping(String key,
String channelName)
Add a channel mapping from the provided key to channel name.
|
void |
setChannelMappings(Map<String,String> channelMappings)
Provide mappings from channel keys to channel names.
|
void |
setChannelResolver(DestinationResolver<MessageChannel> channelResolver)
Specify the
DestinationResolver strategy to use. |
void |
setPrefix(String prefix)
Specify a prefix to be added to each channel name prior to resolution.
|
void |
setResolutionRequired(boolean resolutionRequired)
Specify whether this router should ignore any failure to resolve a channel name to
an actual MessageChannel instance when delegating to the ChannelResolver strategy.
|
void |
setSuffix(String suffix)
Specify a suffix to be added to each channel name prior to resolution.
|
getComponentType, getMessagingTemplate, getRequiredConversionService, handleMessageInternal, setApplySequence, setDefaultOutputChannel, setDefaultOutputChannelName, setIgnoreSendFailures, setTimeoutgetOrder, handleMessage, setOrder, setShouldTrackafterPropertiesSet, getApplicationContextId, getBeanFactory, getComponentName, getConversionService, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setComponentName, setConversionService, setMessageBuilderFactory, setTaskScheduler, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetComponentName@ManagedAttribute public void setChannelMappings(Map<String,String> channelMappings)
DestinationResolver.setChannelMappings in interface MappingMessageRouterManagementchannelMappings - The channel mappings.public void setChannelResolver(DestinationResolver<MessageChannel> channelResolver)
DestinationResolver strategy to use.
The default is a BeanFactoryChannelResolver.
This is considered an infrastructural configuration option and
as of 2.1 has been deprecated as a configuration-driven attribute.channelResolver - The channel resolver.public void setPrefix(String prefix)
prefix - The prefix.public void setSuffix(String suffix)
suffix - The suffix.public void setResolutionRequired(boolean resolutionRequired)
resolutionRequired - true if resolution is required.@ManagedAttribute public Map<String,String> getChannelMappings()
getChannelMappings in interface MappingMessageRouterManagement@ManagedOperation public void setChannelMapping(String key, String channelName)
setChannelMapping in interface MappingMessageRouterManagementkey - The key.channelName - The channel name.@ManagedOperation public void removeChannelMapping(String key)
removeChannelMapping in interface MappingMessageRouterManagementkey - The key.public void onInit()
IntegrationObjectSupportonInit in class AbstractMessageRouterprotected abstract List<Object> getChannelKeys(Message<?> message)
message - The message.protected Collection<MessageChannel> determineTargetChannels(Message<?> message)
AbstractMessageRouterdetermineTargetChannels in class AbstractMessageRoutermessage - The message.@ManagedOperation public void replaceChannelMappings(Properties channelMappings)
This is intended to be called via a control-bus; keys and values that are not Strings will be ignored.
Mappings must be delimited with newlines, for example:
"@'myRouter.handler'.replaceChannelMappings('foo=qux \n baz=bar')".
replaceChannelMappings in interface MappingMessageRouterManagementchannelMappings - The channel mappings.