Class GatewayMessageHandler
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.MessageHandlerSupport
org.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.handler.AbstractMessageProducingHandler
org.springframework.integration.handler.AbstractReplyProducingMessageHandler
org.springframework.integration.gateway.GatewayMessageHandler
- All Implemented Interfaces:
org.reactivestreams.Subscriber<org.springframework.messaging.Message<?>>,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanClassLoaderAware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware,org.springframework.context.Lifecycle,org.springframework.core.Ordered,ExpressionCapable,Orderable,MessageProducer,HeaderPropagationAware,IntegrationPattern,NamedComponent,IntegrationManagement,ManageableLifecycle,TrackableComponent,org.springframework.messaging.MessageHandler,reactor.core.CoreSubscriber<org.springframework.messaging.Message<?>>
public class GatewayMessageHandler extends AbstractReplyProducingMessageHandler implements ManageableLifecycle
The
AbstractReplyProducingMessageHandler implementation for mid-flow Gateway.- Since:
- 5.0
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.integration.handler.AbstractReplyProducingMessageHandler
AbstractReplyProducingMessageHandler.RequestHandlerNested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagement
IntegrationManagement.ManagementOverrides -
Field Summary
Fields inherited from class org.springframework.integration.handler.AbstractMessageProducingHandler
messagingTemplateFields inherited from class org.springframework.integration.context.IntegrationObjectSupport
EXPRESSION_PARSER, loggerFields inherited from interface org.springframework.integration.support.management.IntegrationManagement
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME -
Constructor Summary
Constructors Constructor Description GatewayMessageHandler() -
Method Summary
Modifier and Type Method Description protected java.lang.ObjecthandleRequestMessage(org.springframework.messaging.Message<?> requestMessage)Subclasses must implement this method to handle the request Message.booleanisRunning()voidsetErrorChannel(org.springframework.messaging.MessageChannel errorChannel)voidsetErrorChannelName(java.lang.String errorChannel)voidsetReplyChannel(org.springframework.messaging.MessageChannel replyChannel)voidsetReplyChannelName(java.lang.String replyChannel)voidsetReplyTimeout(java.lang.Long replyTimeout)voidsetRequestChannel(org.springframework.messaging.MessageChannel requestChannel)voidsetRequestChannelName(java.lang.String requestChannel)voidsetRequestTimeout(java.lang.Long requestTimeout)voidstart()voidstop()Methods inherited from class org.springframework.integration.handler.AbstractReplyProducingMessageHandler
doInit, doInvokeAdvisedRequestHandler, getBeanClassLoader, getIntegrationPatternType, getRequiresReply, handleMessageInternal, hasAdviceChain, onInit, setAdviceChain, setBeanClassLoader, setRequiresReplyMethods inherited from class org.springframework.integration.handler.AbstractMessageProducingHandler
addNotPropagatedHeaders, createOutputMessage, getNotPropagatedHeaders, getOutputChannel, isAsync, messageBuilderForReply, produceOutput, resolveErrorChannel, sendErrorMessage, sendOutput, sendOutputs, setAsync, setNotPropagatedHeaders, setOutputChannel, setOutputChannelName, setSendTimeout, shouldCopyRequestHeaders, shouldSplitOutput, updateNotPropagatedHeadersMethods inherited from class org.springframework.integration.handler.AbstractMessageHandler
handleMessage, onComplete, onError, onNext, onSubscribeMethods inherited from class org.springframework.integration.handler.MessageHandlerSupport
buildSendTimer, destroy, getComponentType, getManagedName, getManagedType, getMetricsCaptor, getOrder, getOverrides, isLoggingEnabled, registerMetricsCaptor, sendTimer, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, shouldTrackMethods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.integration.support.management.IntegrationManagement
getThisAsMethods inherited from interface org.springframework.integration.support.context.NamedComponent
getBeanName, getComponentName
-
Constructor Details
-
GatewayMessageHandler
public GatewayMessageHandler()
-
-
Method Details
-
setRequestChannel
public void setRequestChannel(org.springframework.messaging.MessageChannel requestChannel) -
setRequestChannelName
public void setRequestChannelName(java.lang.String requestChannel) -
setReplyChannel
public void setReplyChannel(org.springframework.messaging.MessageChannel replyChannel) -
setReplyChannelName
public void setReplyChannelName(java.lang.String replyChannel) -
setErrorChannel
public void setErrorChannel(org.springframework.messaging.MessageChannel errorChannel) -
setErrorChannelName
public void setErrorChannelName(java.lang.String errorChannel) -
setRequestTimeout
public void setRequestTimeout(java.lang.Long requestTimeout) -
setReplyTimeout
public void setReplyTimeout(java.lang.Long replyTimeout) -
handleRequestMessage
protected java.lang.Object handleRequestMessage(org.springframework.messaging.Message<?> requestMessage)Description copied from class:AbstractReplyProducingMessageHandlerSubclasses must implement this method to handle the request Message. The return value may be a Message, a MessageBuilder, or any plain Object. The base class will handle the final creation of a reply Message from any of those starting points. If the return value is null, the Message flow will end here.- Specified by:
handleRequestMessagein classAbstractReplyProducingMessageHandler- Parameters:
requestMessage- The request message.- Returns:
- The result of handling the message, or
null.
-
start
public void start()- Specified by:
startin interfaceorg.springframework.context.Lifecycle- Specified by:
startin interfaceManageableLifecycle
-
stop
public void stop()- Specified by:
stopin interfaceorg.springframework.context.Lifecycle- Specified by:
stopin interfaceManageableLifecycle
-
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceorg.springframework.context.Lifecycle- Specified by:
isRunningin interfaceManageableLifecycle
-