Class StoredProcPollingChannelAdapter

java.lang.Object
org.springframework.integration.util.AbstractExpressionEvaluator
org.springframework.integration.endpoint.AbstractMessageSource<java.lang.Object>
org.springframework.integration.jdbc.StoredProcPollingChannelAdapter
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.integration.core.MessageSource<java.lang.Object>, org.springframework.integration.IntegrationPattern, org.springframework.integration.support.context.NamedComponent, org.springframework.integration.support.management.IntegrationInboundManagement, org.springframework.integration.support.management.IntegrationManagement

public class StoredProcPollingChannelAdapter
extends org.springframework.integration.endpoint.AbstractMessageSource<java.lang.Object>
A polling channel adapter that creates messages from the payload returned by executing a stored procedure or Sql function. Optionally an update can be executed after the execution of the Stored Procedure or Function in order to update processed rows.
Since:
2.1
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagement

    org.springframework.integration.support.management.IntegrationManagement.ManagementOverrides
  • Field Summary

    Fields inherited from class org.springframework.integration.util.AbstractExpressionEvaluator

    EXPRESSION_PARSER, logger

    Fields inherited from interface org.springframework.integration.support.management.IntegrationManagement

    METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
  • Constructor Summary

    Constructors 
    Constructor Description
    StoredProcPollingChannelAdapter​(StoredProcExecutor storedProcExecutor)
    Constructor taking StoredProcExecutor.
  • Method Summary

    Modifier and Type Method Description
    protected java.lang.Object doReceive()
    Execute the select query and the update query if provided.
    java.lang.String getComponentType()  
    void setExpectSingleResult​(boolean expectSingleResult)
    This parameter indicates that only one result object shall be returned from the Stored Procedure/Function Call.

    Methods inherited from class org.springframework.integration.endpoint.AbstractMessageSource

    buildMessage, destroy, getBeanName, getComponentName, getManagedName, getManagedType, getOverrides, isLoggingEnabled, receive, registerMetricsCaptor, setBeanName, setHeaderExpressions, setLoggingEnabled, setManagedName, setManagedType

    Methods inherited from class org.springframework.integration.util.AbstractExpressionEvaluator

    afterPropertiesSet, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, getBeanFactory, getEvaluationContext, getEvaluationContext, getMessageBuilderFactory, onInit, setBeanFactory, setConversionService

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.integration.support.management.IntegrationManagement

    getThisAs

    Methods inherited from interface org.springframework.integration.core.MessageSource

    getIntegrationPatternType
  • Constructor Details

  • Method Details

    • setExpectSingleResult

      public void setExpectSingleResult​(boolean expectSingleResult)
      This parameter indicates that only one result object shall be returned from the Stored Procedure/Function Call. If set to 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 is 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.
      Parameters:
      expectSingleResult - true if a single result is expected.
    • doReceive

      protected java.lang.Object doReceive()
      Execute the select query and the update query if provided. Returns the rows returned by the select query. If a RowMapper has been provided, the mapped results are returned.
      Specified by:
      doReceive in class org.springframework.integration.endpoint.AbstractMessageSource<java.lang.Object>
    • getComponentType

      public java.lang.String getComponentType()