Spring Integration

org.springframework.integration.jpa.inbound
Class JpaPollingChannelAdapter

java.lang.Object
  extended by org.springframework.integration.context.IntegrationObjectSupport
      extended by 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.InitializingBean, NamedComponent, MessageSource<java.lang.Object>

public class JpaPollingChannelAdapter
extends IntegrationObjectSupport
implements MessageSource<java.lang.Object>

Polling message source that produces messages from the result of the provided:

After the objects have been polled, it also possibly to either: executes an update after the select possibly to updated the state of selected records

Since:
2.2
Author:
Amol Nayak, Gunnar Hillert

Field Summary
 
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport
logger
 
Constructor Summary
JpaPollingChannelAdapter(JpaExecutor jpaExecutor)
          Constructor taking a JpaExecutor that provide all required JPA functionality.
 
Method Summary
 java.lang.String getComponentType()
          Subclasses may implement this method to provide component type information.
protected  void onInit()
          Check for mandatory attributes
 Message<java.lang.Object> receive()
          Uses JpaExecutor.poll() to executes the JPA operation.
 
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, getBeanFactory, getComponentName, getConversionService, getTaskScheduler, setBeanFactory, setBeanName, setComponentName, setConversionService, setTaskScheduler, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JpaPollingChannelAdapter

public JpaPollingChannelAdapter(JpaExecutor jpaExecutor)
Constructor taking a JpaExecutor that provide all required JPA functionality.

Parameters:
jpaExecutor - Must not be null.
Method Detail

onInit

protected void onInit()
               throws java.lang.Exception
Check for mandatory attributes

Overrides:
onInit in class IntegrationObjectSupport
Throws:
java.lang.Exception

receive

public Message<java.lang.Object> receive()
Uses JpaExecutor.poll() to executes the JPA operation. If JpaExecutor.poll() returns null, this method will return null. Otherwise, a new Message is constructed and returned.

Specified by:
receive in interface MessageSource<java.lang.Object>

getComponentType

public java.lang.String getComponentType()
Description copied from class: IntegrationObjectSupport
Subclasses may implement this method to provide component type information.

Specified by:
getComponentType in interface NamedComponent
Overrides:
getComponentType in class IntegrationObjectSupport

Spring Integration