Added documentation to communicate limitations of when using the

AsyncItemProcessor.

BATCH-2371
This commit is contained in:
Michael Minella
2015-05-14 23:15:12 -05:00
parent bfaaf200a1
commit 9059a9e83e

View File

@@ -33,11 +33,19 @@ import org.springframework.util.Assert;
* background. To allow for background processing the return value from the
* processor is a {@link Future} which needs to be unpacked before the item can
* be used by a client.
*
* Because the {@link Future} is typically unwrapped in the {@link ItemWriter},
* there are lifecycle and stats limitations (since the framework doesn't know
* what the result of the processor is). While not an exhaustive list, things like
* {@link StepExecution#filterCount} will not reflect the number of filtered items
* and {@link org.springframework.batch.core.ItemProcessListener#onProcessError(Object, Exception)}
* will not be called.
*
* @author Dave Syer
*
* @param <I> the input object type
* @param <O> the output object type (will be wrapped in a Future)
* @see AsyncItemWriter
*/
public class AsyncItemProcessor<I, O> implements ItemProcessor<I, Future<O>>, InitializingBean {