public class JdbcPollingChannelAdapter extends IntegrationObjectSupport implements MessageSource<java.lang.Object>
logger
Constructor and Description |
---|
JdbcPollingChannelAdapter(javax.sql.DataSource dataSource,
java.lang.String selectQuery)
Constructor taking
DataSource from which the DB Connection can be
obtained and the select query to execute to retrieve new rows. |
JdbcPollingChannelAdapter(org.springframework.jdbc.core.JdbcOperations jdbcOperations,
java.lang.String selectQuery)
Constructor taking
JdbcOperations instance to use for query
execution and the select query to execute to retrieve new rows. |
Modifier and Type | Method and Description |
---|---|
protected java.util.List<?> |
doPoll(org.springframework.jdbc.core.namedparam.SqlParameterSource sqlQueryParameterSource) |
java.lang.String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
protected void |
onInit()
Subclasses may implement this for initialization logic.
|
Message<java.lang.Object> |
receive()
Executes the query.
|
void |
setMaxRowsPerPoll(int maxRows)
The maximum number of rows to pull out of the query results per poll (if
greater than zero, otherwise all rows will be packed into the outgoing
message).
|
void |
setRowMapper(org.springframework.jdbc.core.RowMapper<?> rowMapper) |
void |
setSelectSqlParameterSource(org.springframework.jdbc.core.namedparam.SqlParameterSource sqlQueryParameterSource)
A source of parameters for the select query used for polling.
|
void |
setUpdatePerRow(boolean updatePerRow) |
void |
setUpdateSql(java.lang.String updateSql) |
void |
setUpdateSqlParameterSourceFactory(SqlParameterSourceFactory sqlParameterSourceFactory) |
afterPropertiesSet, getApplicationContextId, getBeanFactory, getComponentName, getConversionService, getIntegrationProperties, getIntegrationProperty, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setComponentName, setConversionService, setTaskScheduler, toString
public JdbcPollingChannelAdapter(javax.sql.DataSource dataSource, java.lang.String selectQuery)
DataSource
from which the DB Connection can be
obtained and the select query to execute to retrieve new rows.dataSource
- Must not be nullselectQuery
- query to executepublic JdbcPollingChannelAdapter(org.springframework.jdbc.core.JdbcOperations jdbcOperations, java.lang.String selectQuery)
JdbcOperations
instance to use for query
execution and the select query to execute to retrieve new rows.jdbcOperations
- instance to use for query executionselectQuery
- query to executepublic void setRowMapper(org.springframework.jdbc.core.RowMapper<?> rowMapper)
public void setUpdateSql(java.lang.String updateSql)
public void setUpdatePerRow(boolean updatePerRow)
public void setUpdateSqlParameterSourceFactory(SqlParameterSourceFactory sqlParameterSourceFactory)
public void setSelectSqlParameterSource(org.springframework.jdbc.core.namedparam.SqlParameterSource sqlQueryParameterSource)
sqlQueryParameterSource
- the sql query parameter source to setpublic void setMaxRowsPerPoll(int maxRows)
maxRows
- the max rows to setprotected void onInit() throws java.lang.Exception
IntegrationObjectSupport
onInit
in class IntegrationObjectSupport
java.lang.Exception
public Message<java.lang.Object> receive()
null
.receive
in interface MessageSource<java.lang.Object>
protected java.util.List<?> doPoll(org.springframework.jdbc.core.namedparam.SqlParameterSource sqlQueryParameterSource)
public java.lang.String getComponentType()
IntegrationObjectSupport
getComponentType
in interface NamedComponent
getComponentType
in class IntegrationObjectSupport