public class JdbcPollingChannelAdapter extends IntegrationObjectSupport implements MessageSource<Object>
EXPRESSION_PARSER, logger| Constructor and Description |
|---|
JdbcPollingChannelAdapter(DataSource dataSource,
String selectQuery)
Constructor taking
DataSource from which the DB Connection can be
obtained and the select query to execute to retrieve new rows. |
JdbcPollingChannelAdapter(JdbcOperations jdbcOperations,
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 List<?> |
doPoll(SqlParameterSource sqlQueryParameterSource) |
String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
protected void |
onInit()
Subclasses may implement this for initialization logic.
|
Message<Object> |
receive()
Execute 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(RowMapper<?> rowMapper) |
void |
setSelectSqlParameterSource(SqlParameterSource sqlQueryParameterSource)
A source of parameters for the select query used for polling.
|
void |
setUpdatePerRow(boolean updatePerRow) |
void |
setUpdateSql(String updateSql) |
void |
setUpdateSqlParameterSourceFactory(SqlParameterSourceFactory sqlParameterSourceFactory) |
afterPropertiesSet, extractTypeIfPossible, getApplicationContext, getApplicationContextId, getBeanFactory, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringpublic JdbcPollingChannelAdapter(DataSource dataSource, 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(JdbcOperations jdbcOperations, 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(RowMapper<?> rowMapper)
public void setUpdateSql(String updateSql)
public void setUpdatePerRow(boolean updatePerRow)
public void setUpdateSqlParameterSourceFactory(SqlParameterSourceFactory sqlParameterSourceFactory)
public void setSelectSqlParameterSource(SqlParameterSource sqlQueryParameterSource)
sqlQueryParameterSource - the sql query parameter source to setpublic void setMaxRowsPerPoll(int maxRows)
maxRows - the max rows to setprotected void onInit()
throws Exception
IntegrationObjectSupportonInit in class IntegrationObjectSupportException - Any exception.public Message<Object> receive()
null.
#return the Message or null as a result of query.receive in interface MessageSource<Object>protected List<?> doPoll(SqlParameterSource sqlQueryParameterSource)
public String getComponentType()
IntegrationObjectSupportgetComponentType in interface NamedComponentgetComponentType in class IntegrationObjectSupport