Class ItemWriterAdapter<T>
java.lang.Object
org.springframework.batch.infrastructure.item.adapter.AbstractMethodInvokingDelegator<T>
org.springframework.batch.infrastructure.item.adapter.ItemWriterAdapter<T>
- All Implemented Interfaces:
ItemWriter<T>, org.springframework.beans.factory.InitializingBean
public class ItemWriterAdapter<T>
extends AbstractMethodInvokingDelegator<T>
implements ItemWriter<T>
Delegates item processing to a custom method - passes the item as an argument for the
delegate method.
This adapter is thread-safe as long as the delegate ItemWriter is
thread-safe.
- Author:
- Robert Kasanicky, Mahmoud Ben Hassine
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractMethodInvokingDelegator
AbstractMethodInvokingDelegator.InvocationTargetThrowableWrapper -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ItemWriterAdapter
public ItemWriterAdapter()
-
-
Method Details
-
write
Description copied from interface:ItemWriterProcess the supplied data element. Will not be called with any null items in normal operation but might be called with an empty chunk, for example when all items have been filtered by anItemProcessoror skipped by the fault-tolerant step processing. Implementations are expected to handle empty chunks gracefully.- Specified by:
writein interfaceItemWriter<T>- Parameters:
items- of items to be written. Nevernullbut may be empty.- Throws:
Exception- if there are errors. The framework will catch the exception and convert or rethrow it as appropriate.
-