|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.router.AbstractMessageRouter
@ManagedResource public abstract class AbstractMessageRouter
Base class for all Message Routers.
Field Summary | |
---|---|
protected java.util.Map<java.lang.String,java.lang.String> |
channelIdentifierMap
|
Fields inherited from class org.springframework.integration.handler.AbstractMessageHandler |
---|
logger |
Fields inherited from interface org.springframework.core.Ordered |
---|
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
Constructor Summary | |
---|---|
AbstractMessageRouter()
|
Method Summary | |
---|---|
protected abstract java.util.List<java.lang.Object> |
getChannelIdentifiers(Message<?> message)
Subclasses must implement this method to return the channel identifiers. |
java.lang.String |
getComponentType()
Subclasses may implement this method to provide component type information. |
protected MessagingTemplate |
getMessagingTemplate()
Provides MessagingTemplate access for subclasses. |
protected ConversionService |
getRequiredConversionService()
|
protected void |
handleMessageInternal(Message<?> message)
|
void |
onInit()
Subclasses may implement this for initialization logic. |
void |
removeChannelMapping(java.lang.String channelIdentifier)
Removes channel mapping for a give channel identifier |
void |
setApplySequence(boolean applySequence)
Specify whether to apply the sequence number and size headers to the messages prior to sending to the recipient channels. |
void |
setChannelIdentifierMap(java.util.Map<java.lang.String,java.lang.String> channelIdentifierMap)
Allows you to set the map which will map channel identifiers to channel names. |
void |
setChannelMapping(java.lang.String channelIdentifier,
java.lang.String channelName)
|
void |
setChannelResolver(ChannelResolver channelResolver)
Specify the ChannelResolver strategy to use. |
void |
setDefaultOutputChannel(MessageChannel defaultOutputChannel)
Set the default channel where Messages should be sent if channel resolution fails to return any channels. |
void |
setIgnoreChannelNameResolutionFailures(boolean ignoreChannelNameResolutionFailures)
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 |
setIgnoreSendFailures(boolean ignoreSendFailures)
Specify whether send failures for one or more of the recipients should be ignored. |
void |
setPrefix(java.lang.String prefix)
Specify a prefix to be added to each channel name prior to resolution. |
void |
setResolutionRequired(boolean resolutionRequired)
Set whether this router should always be required to resolve at least one channel. |
void |
setSuffix(java.lang.String suffix)
Specify a suffix to be added to each channel name prior to resolution. |
void |
setTimeout(long timeout)
Set the timeout for sending a message to the resolved channel. |
Methods inherited from class org.springframework.integration.handler.AbstractMessageHandler |
---|
getOrder, handleMessage, setOrder, setShouldTrack |
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport |
---|
afterPropertiesSet, getBeanFactory, getComponentName, getConversionService, getTaskScheduler, setBeanFactory, setBeanName, setComponentName, setConversionService, setTaskScheduler, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.springframework.integration.context.NamedComponent |
---|
getComponentName |
Field Detail |
---|
protected volatile java.util.Map<java.lang.String,java.lang.String> channelIdentifierMap
Constructor Detail |
---|
public AbstractMessageRouter()
Method Detail |
---|
public void setChannelResolver(ChannelResolver channelResolver)
ChannelResolver
strategy to use.
The default is a BeanFactoryChannelResolver.
public void setPrefix(java.lang.String prefix)
public void setSuffix(java.lang.String suffix)
public void setChannelIdentifierMap(java.util.Map<java.lang.String,java.lang.String> channelIdentifierMap)
ChannelResolver
channelIdentifierMap
- @ManagedOperation public void setChannelMapping(java.lang.String channelIdentifier, java.lang.String channelName)
@ManagedOperation public void removeChannelMapping(java.lang.String channelIdentifier)
channelIdentifier
- public void setDefaultOutputChannel(MessageChannel defaultOutputChannel)
resolutionRequired
.
public void setTimeout(long timeout)
public void setResolutionRequired(boolean resolutionRequired)
public void setIgnoreChannelNameResolutionFailures(boolean ignoreChannelNameResolutionFailures)
public void setIgnoreSendFailures(boolean ignoreSendFailures)
false
meaning that an Exception will be thrown whenever a send fails. To override this and suppress
Exceptions, set the value to true
.
public void setApplySequence(boolean applySequence)
false
meaning that sequence headers will not be
applied. If planning to use an Aggregator downstream with the default correlation and completion strategies, you
should set this flag to true
.
public java.lang.String getComponentType()
IntegrationObjectSupport
getComponentType
in interface NamedComponent
getComponentType
in class AbstractMessageHandler
protected MessagingTemplate getMessagingTemplate()
MessagingTemplate
access for subclasses.
public void onInit()
IntegrationObjectSupport
onInit
in class IntegrationObjectSupport
protected ConversionService getRequiredConversionService()
protected abstract java.util.List<java.lang.Object> getChannelIdentifiers(Message<?> message)
protected void handleMessageInternal(Message<?> message)
handleMessageInternal
in class AbstractMessageHandler
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |