Class JpaPollingChannelAdapter
java.lang.Object
org.springframework.integration.util.AbstractExpressionEvaluator
org.springframework.integration.endpoint.AbstractMessageSource<java.lang.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<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 JpaPollingChannelAdapter
extends org.springframework.integration.endpoint.AbstractMessageSource<java.lang.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
- executes an update (per retrieved object or for the entire payload)
- delete the retrieved object
- Since:
- 2.2
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
Constructors Constructor Description JpaPollingChannelAdapter(JpaExecutor jpaExecutor)Constructor taking aJpaExecutorthat provide all required JPA functionality. -
Method Summary
Modifier and Type Method Description protected java.lang.ObjectdoReceive()UseJpaExecutor.poll()to executes the JPA operation.java.lang.StringgetComponentType()protected voidonInit()Check for mandatory attributesMethods inherited from class org.springframework.integration.endpoint.AbstractMessageSource
buildMessage, destroy, getBeanName, getComponentName, getManagedName, getManagedType, getOverrides, isLoggingEnabled, receive, registerMetricsCaptor, setBeanName, setHeaderExpressions, setLoggingEnabled, setManagedName, setManagedTypeMethods inherited from class org.springframework.integration.util.AbstractExpressionEvaluator
afterPropertiesSet, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, getBeanFactory, getEvaluationContext, getEvaluationContext, getMessageBuilderFactory, setBeanFactory, setConversionServiceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
JpaPollingChannelAdapter
Constructor taking aJpaExecutorthat provide all required JPA functionality.- Parameters:
jpaExecutor- Must not be null.
-
-
Method Details
-
onInit
protected void onInit()Check for mandatory attributes- Overrides:
onInitin classorg.springframework.integration.util.AbstractExpressionEvaluator
-
doReceive
protected java.lang.Object doReceive()UseJpaExecutor.poll()to executes the JPA operation. IfJpaExecutor.poll()returns null, this method will returnnull. Otherwise, a newMessageis constructed and returned.- Specified by:
doReceivein classorg.springframework.integration.endpoint.AbstractMessageSource<java.lang.Object>
-
getComponentType
public java.lang.String getComponentType()
-