@@ -229,6 +229,12 @@ protected RootBeanDefinition parseProcessTask(Element element, ParserContext par
229
229
bd .getPropertyValues ().addPropertyValue ("itemWriter" , writerRef );
230
230
}
231
231
232
+ String taskExecutorBeanId = element .getAttribute ("task-executor" );
233
+ if (StringUtils .hasText (taskExecutorBeanId )) {
234
+ RuntimeBeanReference taskExecutorRef = new RuntimeBeanReference (taskExecutorBeanId );
235
+ bd .getPropertyValues ().addPropertyValue ("taskExecutor" , taskExecutorRef );
236
+ }
237
+
232
238
String jobRepository = element .getAttribute ("job-repository" );
233
239
RuntimeBeanReference jobRepositoryRef = new RuntimeBeanReference (jobRepository );
234
240
bd .getPropertyValues ().addPropertyValue ("jobRepository" , jobRepositoryRef );
@@ -245,19 +251,43 @@ protected RootBeanDefinition parseProcessTask(Element element, ParserContext par
245
251
String skipLimit = element .getAttribute ("skip-limit" );
246
252
if (StringUtils .hasText (skipLimit )) {
247
253
if (!isFaultTolerant ) {
248
- throw new BeanCreationException ("skip-limit can only be specified if fault-tolerant is set to ' true' " );
254
+ throw new BeanCreationException ("skip-limit can only be specified if fault-tolerant is set to \" true\" " );
249
255
}
250
256
bd .getPropertyValues ().addPropertyValue ("skipLimit" , skipLimit );
251
257
}
252
258
253
259
String retryLimit = element .getAttribute ("retry-limit" );
254
260
if (StringUtils .hasText (retryLimit )) {
255
261
if (!isFaultTolerant ) {
256
- throw new BeanCreationException ("retry-limit can only be specified if fault-tolerant is set to ' true' " );
262
+ throw new BeanCreationException ("retry-limit can only be specified if fault-tolerant is set to \" true\" " );
257
263
}
258
264
bd .getPropertyValues ().addPropertyValue ("retryLimit" , retryLimit );
259
265
}
260
266
267
+ String cacheCapacity = element .getAttribute ("cache-capacity" );
268
+ if (StringUtils .hasText (cacheCapacity )) {
269
+ if (!isFaultTolerant ) {
270
+ throw new BeanCreationException ("cache-capacity can only be specified if fault-tolerant is set to \" true\" " );
271
+ }
272
+ bd .getPropertyValues ().addPropertyValue ("cacheCapacity" , cacheCapacity );
273
+ }
274
+
275
+ String transactionAttribute = element .getAttribute ("transaction-attribute" );
276
+ if (StringUtils .hasText (transactionAttribute )) {
277
+ handleTransactionAttributesElement (element , bd );
278
+ bd .getPropertyValues ().addPropertyValue ("transactionAttribute" , transactionAttribute );
279
+ }
280
+
281
+ String isReaderTransactionalQueue = element .getAttribute ("is-reader-transactional-queue" );
282
+ if (StringUtils .hasText (isReaderTransactionalQueue )) {
283
+ if (!isFaultTolerant && "true" .equals (isReaderTransactionalQueue )) {
284
+ throw new BeanCreationException ("is-reader-transactional-queue=\" true\" can only be specified if fault-tolerant is set to \" true\" " );
285
+ }
286
+ if (isFaultTolerant ) {
287
+ bd .getPropertyValues ().addPropertyValue ("isReaderTransactionalQueue" , isReaderTransactionalQueue );
288
+ }
289
+ }
290
+
261
291
handleExceptionElement (element , bd , "skippable-exception-classes" , "skippableExceptionClasses" , isFaultTolerant );
262
292
263
293
handleExceptionElement (element , bd , "retryable-exception-classes" , "retryableExceptionClasses" ,isFaultTolerant );
@@ -279,13 +309,16 @@ protected RootBeanDefinition parseProcessTask(Element element, ParserContext par
279
309
280
310
}
281
311
312
+ private void handleTransactionAttributesElement (Element element , RootBeanDefinition bd ) {
313
+ }
314
+
282
315
private void handleExceptionElement (Element element , RootBeanDefinition bd ,
283
316
String attributeName , String propertyName , boolean isFaultTolerant ) {
284
317
String exceptions =
285
318
DomUtils .getChildElementValueByTagName (element , attributeName );
286
319
if (StringUtils .hasLength (exceptions )) {
287
320
if (!isFaultTolerant ) {
288
- throw new BeanCreationException (attributeName + " can only be specified if fault-tolerant is set to ' true' " );
321
+ throw new BeanCreationException (attributeName + " can only be specified if fault-tolerant is set to \" true\" " );
289
322
}
290
323
String [] exceptionArray = StringUtils .tokenizeToStringArray (
291
324
StringUtils .delete (exceptions , "," ), "\n " );
0 commit comments