public class StoredProcOutboundGateway
extends org.springframework.integration.handler.AbstractReplyProducingMessageHandler
AbstractReplyProducingMessageHandler implementation for performing
RDBMS stored procedures which return results.messagingTemplateEXPRESSION_PARSER, logger| Constructor and Description |
|---|
StoredProcOutboundGateway(StoredProcExecutor storedProcExecutor)
Constructor taking
StoredProcExecutor. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doInit() |
java.lang.String |
getComponentType() |
protected java.lang.Object |
handleRequestMessage(org.springframework.messaging.Message<?> requestMessage) |
void |
setExpectSingleResult(boolean expectSingleResult)
This parameter indicates that only one result object shall be returned from
the Stored Procedure/Function Call.
|
void |
setRequiresReply(boolean requiresReply) |
doInvokeAdvisedRequestHandler, getRequiresReply, handleMessageInternal, hasAdviceChain, onInit, setAdviceChain, setBeanClassLoaderaddNotPropagatedHeaders, createOutputMessage, getNotPropagatedHeaders, getOutputChannel, isAsync, produceOutput, resolveErrorChannel, sendErrorMessage, sendOutput, sendOutputs, setAsync, setNotPropagatedHeaders, setOutputChannel, setOutputChannelName, setSendTimeout, shouldCopyRequestHeaders, shouldSplitOutput, updateNotPropagatedHeadersconfigureMetrics, getActiveCount, getActiveCountLong, getDuration, getErrorCount, getErrorCountLong, getHandleCount, getHandleCountLong, getManagedName, getManagedType, getMaxDuration, getMeanDuration, getMinDuration, getOrder, getOverrides, getStandardDeviationDuration, handleMessage, isCountsEnabled, isLoggingEnabled, isStatsEnabled, onComplete, onError, onNext, onSubscribe, registerMetricsCaptor, reset, setCountsEnabled, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, setStatsEnabledafterPropertiesSet, extractTypeIfPossible, getApplicationContext, getApplicationContextId, getBeanFactory, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic StoredProcOutboundGateway(StoredProcExecutor storedProcExecutor)
StoredProcExecutor.storedProcExecutor - Must not be null.public void setRequiresReply(boolean requiresReply)
setRequiresReply in class org.springframework.integration.handler.AbstractReplyProducingMessageHandlerpublic void setExpectSingleResult(boolean expectSingleResult)
true, a resultMap that contains
only 1 element, will have that 1 element extracted and returned as payload.
If the resultMap contains more than 1 element and expectSingleResult == true,
then a MessagingException is thrown.
Otherwise the complete resultMap is returned as the Message payload.
Important Note: Several databases such as H2 are not fully supported.
The H2 database, for example, does not fully support the CallableStatement
semantics and when executing function calls against H2, a result list is
returned rather than a single value.
Therefore, even if you set expectSingleResult = true, you may end up with
a collection being returned.
When set to true, a setRequiresReply(boolean) is called
with true as well, indicating that exactly single result is expected
and null isn't appropriate value.
A ReplyRequiredException is thrown
in case of null result.
expectSingleResult - true if a single result is expected.public java.lang.String getComponentType()
getComponentType in interface org.springframework.integration.support.context.NamedComponentgetComponentType in class org.springframework.integration.handler.AbstractMessageHandlerprotected void doInit()
doInit in class org.springframework.integration.handler.AbstractReplyProducingMessageHandlerprotected java.lang.Object handleRequestMessage(org.springframework.messaging.Message<?> requestMessage)
handleRequestMessage in class org.springframework.integration.handler.AbstractReplyProducingMessageHandler