5252import org .springframework .integration .support .converter .AllowListDeserializingConverter ;
5353import org .springframework .integration .util .UUIDConverter ;
5454import org .springframework .jdbc .core .JdbcTemplate ;
55+ import org .springframework .jdbc .core .RowMapper ;
5556import org .springframework .jdbc .core .namedparam .MapSqlParameterSource ;
5657import org .springframework .jdbc .core .namedparam .NamedParameterJdbcTemplate ;
5758import org .springframework .jmx .export .annotation .ManagedAttribute ;
8990 * @author Trung Pham
9091 * @author Johannes Edmeier
9192 * @author Ngoc Nhan
93+ * @author Yoobin Yoon
9294 *
9395 * @since 2.2
9496 */
@@ -109,7 +111,7 @@ public class JdbcChannelMessageStore implements PriorityCapableChannelMessageSto
109111 */
110112 public static final String DEFAULT_TABLE_PREFIX = "INT_" ;
111113
112- private enum Query {
114+ protected enum Query {
113115 CREATE_MESSAGE ,
114116 COUNT_GROUPS ,
115117 GROUP_SIZE ,
@@ -148,7 +150,7 @@ private enum Query {
148150 private SerializingConverter serializer ;
149151
150152 @ SuppressWarnings ("NullAway.Init" )
151- private MessageRowMapper messageRowMapper ;
153+ private RowMapper < Message <?>> messageRowMapper ;
152154
153155 @ SuppressWarnings ("NullAway.Init" )
154156 private ChannelMessageStorePreparedStatementSetter preparedStatementSetter ;
@@ -208,7 +210,7 @@ public void setDeserializer(Deserializer<? extends Message<?>> deserializer) {
208210
209211 /**
210212 * Add patterns for packages/classes that are allowed to be deserialized. A class can
211- * be fully qualified or a wildcard '*' is allowed at the beginning or end of the
213+ * be fully qualified, or a wildcard '*' is allowed at the beginning or end of the
212214 * class name. Examples: {@code com.foo.*}, {@code *.MyClass}.
213215 * @param patterns the patterns.
214216 * @since 5.4
@@ -232,18 +234,18 @@ public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
232234 }
233235
234236 /**
235- * Allow for passing in a custom {@link MessageRowMapper}. The {@link MessageRowMapper}
236- * is used to convert the selected database row representing the persisted
237- * message into the actual {@link Message} object.
237+ * Allow for passing in a custom {@link RowMapper} for {@link Message}.
238+ * The {@link RowMapper} is used to convert the selected database row
239+ * representing the persisted message into the actual {@link Message} object.
238240 * @param messageRowMapper Must not be null
239241 */
240- public void setMessageRowMapper (MessageRowMapper messageRowMapper ) {
241- Assert .notNull (messageRowMapper , "The provided MessageRowMapper must not be null." );
242+ public void setMessageRowMapper (RowMapper < Message <?>> messageRowMapper ) {
243+ Assert .notNull (messageRowMapper , "The provided RowMapper must not be null." );
242244 this .messageRowMapper = messageRowMapper ;
243245 }
244246
245247 /**
246- * Set a {@link ChannelMessageStorePreparedStatementSetter} to insert message into the database.
248+ * Set a {@link ChannelMessageStorePreparedStatementSetter} to insert a message into the database.
247249 * @param preparedStatementSetter {@link ChannelMessageStorePreparedStatementSetter} to use.
248250 * Must not be null
249251 * @since 5.0
@@ -259,7 +261,7 @@ public void setPreparedStatementSetter(ChannelMessageStorePreparedStatementSette
259261 * The {@link JdbcChannelMessageStore} provides the SQL queries to retrieve messages from
260262 * the database. See the JavaDocs {@link ChannelMessageStoreQueryProvider} (all known
261263 * implementing classes) to see those implementations provided by the framework.
262- * <p> You can provide your own query implementations, if you need to support additional
264+ * <p> You can provide your own query implementations if you need to support additional
263265 * databases and/or need to fine-tune the queries for your requirements.
264266 * @param channelMessageStoreQueryProvider Must not be null.
265267 */
@@ -313,7 +315,7 @@ public void setTablePrefix(String tablePrefix) {
313315 * using a task executor.</p>
314316 * <p>The issue is that the {@link #pollMessageFromGroup(Object)} looks for the
315317 * oldest entry for a giving channel (groupKey) and region ({@link #setRegion(String)}).
316- * If you do that with multiple threads and you are using transactions, other
318+ * If you do that with multiple threads, and you are using transactions, other
317319 * threads may be waiting for that same locked row.</p>
318320 * <p>If using the provided
319321 * {@link org.springframework.integration.jdbc.store.channel.OracleChannelMessageStoreQueryProvider},
@@ -323,7 +325,7 @@ public void setTablePrefix(String tablePrefix) {
323325 * message id in an in-memory collection for the duration of processing. With
324326 * that, any polling threads will explicitly exclude those messages from
325327 * being polled.</p>
326- * <p>For this to work, you must setup the corresponding
328+ * <p>For this to work, you must set up the corresponding
327329 * {@link org.springframework.integration.transaction.TransactionSynchronizationFactory}:</p>
328330 * <pre class="code">
329331 * {@code
@@ -388,7 +390,7 @@ protected MessageGroupFactory getMessageGroupFactory() {
388390 * Check mandatory properties ({@link DataSource} and
389391 * {@link #setChannelMessageStoreQueryProvider(ChannelMessageStoreQueryProvider)}). If no {@link MessageRowMapper}
390392 * and {@link ChannelMessageStorePreparedStatementSetter} was explicitly set using
391- * {@link #setMessageRowMapper(MessageRowMapper )} and
393+ * {@link #setMessageRowMapper(RowMapper )} and
392394 * {@link #setPreparedStatementSetter(ChannelMessageStorePreparedStatementSetter)} respectively, the default
393395 * {@link MessageRowMapper} and {@link ChannelMessageStorePreparedStatementSetter} will be instantiated using the
394396 * specified {@link #deserializer}.
@@ -493,7 +495,7 @@ public MessageGroup getMessageGroup(Object groupId) {
493495 }
494496
495497 /**
496- * Return the number of message groups in the store for configured region.
498+ * Return the number of message groups in the store for a configured region.
497499 * @return The message group count.
498500 */
499501 @ ManagedAttribute
@@ -564,8 +566,8 @@ private boolean isSingleStatementForPoll() {
564566 * This method executes a call to the DB to get the oldest Message in the
565567 * MessageGroup which in the context of the {@link JdbcChannelMessageStore}
566568 * means the channel identifier.
567- * @param groupIdKey String representation of message group (Channel) ID
568- * @return a message; could be null if query produced no Messages
569+ * @param groupIdKey String representation of a message group (Channel) ID
570+ * @return a message; could be null if a query produced no Messages
569571 */
570572 protected @ Nullable Message <?> doPollForMessage (String groupIdKey ) {
571573 NamedParameterJdbcTemplate namedParameterJdbcTemplate = new NamedParameterJdbcTemplate (this .jdbcTemplate );
0 commit comments