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:
- Aware,- BeanFactoryAware,- BeanNameAware,- DisposableBean,- InitializingBean,- MessageSource<Object>,- IntegrationPattern,- NamedComponent,- IntegrationInboundManagement,- IntegrationManagement
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
- executes an update (per retrieved object or for the entire payload)
- delete the retrieved object
- Since:
- 2.2
- Author:
- Amol Nayak, Gunnar Hillert, Artem Bilan, Gary Russell
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagementIntegrationManagement.ManagementOverrides
- 
Field SummaryFields inherited from class org.springframework.integration.util.AbstractExpressionEvaluatorEXPRESSION_PARSER, loggerFields inherited from interface org.springframework.integration.support.management.IntegrationManagementMETER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
- 
Constructor SummaryConstructorsConstructorDescriptionJpaPollingChannelAdapter(JpaExecutor jpaExecutor) Constructor taking aJpaExecutorthat provide all required JPA functionality.
- 
Method SummaryModifier and TypeMethodDescriptionprotected ObjectUseJpaExecutor.poll()to executes the JPA operation.protected voidonInit()Check for mandatory attributes.Methods inherited from class org.springframework.integration.endpoint.AbstractMessageSourcebuildMessage, destroy, getBeanName, getComponentName, getManagedName, getManagedType, getOverrides, isLoggingEnabled, receive, registerMetricsCaptor, setBeanName, setHeaderExpressions, setLoggingEnabled, setManagedName, setManagedTypeMethods inherited from class org.springframework.integration.util.AbstractExpressionEvaluatorafterPropertiesSet, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, getBeanFactory, getEvaluationContext, getEvaluationContext, getMessageBuilderFactory, setBeanFactory, setConversionService, setSimpleEvaluationContextMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.integration.support.management.IntegrationManagementgetThisAs, isObserved, registerObservationRegistryMethods inherited from interface org.springframework.integration.core.MessageSourcegetIntegrationPatternType
- 
Constructor Details- 
JpaPollingChannelAdapterConstructor taking aJpaExecutorthat provide all required JPA functionality.- Parameters:
- jpaExecutor- Must not be null.
 
 
- 
- 
Method Details- 
onInitprotected void onInit()Check for mandatory attributes.- Overrides:
- onInitin class- AbstractExpressionEvaluator
 
- 
doReceiveUseJpaExecutor.poll()to executes the JPA operation. Returnnullif result ofJpaExecutor.poll()isObjectUtils.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:
- doReceivein class- AbstractMessageSource<Object>
- Returns:
- The value returned.
 
- 
getComponentType
 
-