Class JpaPollingChannelAdapter

java.lang.Object
org.springframework.integration.util.AbstractExpressionEvaluator
org.springframework.integration.endpoint.AbstractMessageSource<Object>
org.springframework.integration.jpa.inbound.JpaPollingChannelAdapter
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<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 JpaPollingChannelAdapter extends org.springframework.integration.endpoint.AbstractMessageSource<Object>
Polling message source that produces messages from the result of the provided:
  • entityClass
  • JpQl Select Query
  • Sql Native Query
  • JpQl Named Query
  • Sql Native Named Query
. After the objects have been polled, it also possibly to either:
  • executes an update (per retrieved object or for the entire payload)
  • delete the retrieved object
Since:
2.2
  • 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
    Constructor taking a JpaExecutor that provide all required JPA functionality.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected @Nullable Object
    Use JpaExecutor.poll() to executes the JPA operation.
     
    protected void
    Check for mandatory attributes.

    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, setBeanFactory, setConversionService, setSimpleEvaluationContext

    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, isObserved, registerObservationRegistry

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

    getIntegrationPatternType
  • Constructor Details

    • JpaPollingChannelAdapter

      public JpaPollingChannelAdapter(JpaExecutor jpaExecutor)
      Constructor taking a JpaExecutor that provide all required JPA functionality.
      Parameters:
      jpaExecutor - Must not be null.
  • Method Details

    • onInit

      protected void onInit()
      Check for mandatory attributes.
      Overrides:
      onInit in class org.springframework.integration.util.AbstractExpressionEvaluator
    • doReceive

      protected @Nullable Object doReceive()
      Use JpaExecutor.poll() to executes the JPA operation. Return null if result of JpaExecutor.poll() is ObjectUtils.isEmpty(java.lang.Object[]). The empty collection means there is no data to retrieve from DB at the moment therefore no reason to emit an empty message from this message source.
      Specified by:
      doReceive in class org.springframework.integration.endpoint.AbstractMessageSource<Object>
    • getComponentType

      public String getComponentType()