public class StoredProcOutboundGateway extends AbstractReplyProducingMessageHandler
AbstractReplyProducingMessageHandler implementation for performing
RDBMS stored procedures which return results.AbstractReplyProducingMessageHandler.RequestHandlerIntegrationManagement.ManagementOverridesmessagingTemplateEXPRESSION_PARSER, loggerMETER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE| Constructor and Description |
|---|
StoredProcOutboundGateway(StoredProcExecutor storedProcExecutor)
Constructor taking
StoredProcExecutor. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doInit() |
String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
protected Object |
handleRequestMessage(Message<?> requestMessage)
Subclasses must implement this method to handle the request Message.
|
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)
Flag whether a reply is required.
|
doInvokeAdvisedRequestHandler, getBeanClassLoader, getRequiresReply, handleMessageInternal, hasAdviceChain, onInit, setAdviceChain, setBeanClassLoaderaddNotPropagatedHeaders, createOutputMessage, getNotPropagatedHeaders, getOutputChannel, isAsync, messageBuilderForReply, produceOutput, resolveErrorChannel, sendErrorMessage, sendOutput, sendOutputs, setAsync, setNotPropagatedHeaders, setOutputChannel, setOutputChannelName, setSendTimeout, shouldCopyRequestHeaders, shouldSplitOutput, updateNotPropagatedHeadersconfigureMetrics, destroy, getActiveCount, getActiveCountLong, getDuration, getErrorCount, getErrorCountLong, getHandleCount, getHandleCountLong, getManagedName, getManagedType, getMaxDuration, getMeanDuration, getMetricsCaptor, getMinDuration, getOrder, getOverrides, getStandardDeviationDuration, handleMessage, isCountsEnabled, isLoggingEnabled, isStatsEnabled, onComplete, onError, onNext, onSubscribe, registerMetricsCaptor, reset, setCountsEnabled, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, setStatsEnabledafterPropertiesSet, 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, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waiterrorCount, handleCountgetBeanName, getComponentNamepublic StoredProcOutboundGateway(StoredProcExecutor storedProcExecutor)
StoredProcExecutor.storedProcExecutor - Must not be null.public void setRequiresReply(boolean requiresReply)
AbstractReplyProducingMessageHandlersetRequiresReply in class AbstractReplyProducingMessageHandlerrequiresReply - true if a reply is required.public 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 String getComponentType()
IntegrationObjectSupportgetComponentType in interface NamedComponentgetComponentType in class AbstractMessageHandlerprotected void doInit()
doInit in class AbstractReplyProducingMessageHandlerprotected Object handleRequestMessage(Message<?> requestMessage)
AbstractReplyProducingMessageHandlerhandleRequestMessage in class AbstractReplyProducingMessageHandlerrequestMessage - The request message.null.