I have a composite item processor like below.
<bean id="myProcessors"
class="org.springframework.batch.item.support.CompositeItemProcessor"
scope="step">
<property name="delegates">
<util:list>
<ref bean="processor1" />
<ref bean="processor2" />
<ref bean="processor3" />
<ref bean="processor4" />
</util:list>
</property>
</bean>
How do i register listener to it which gets execute after all the processors are complete and before writer gettes called? I want to transform the result object of processor4 to another object which writer can use to persist it.
Please help.
如果使用CompositeItemProcessor
,则应该能够正常注册ItemProcessListener
并且由于该框架不了解底层委托人,因此它将在整个复合材料上执行一次。
I want to transform the result object of processor4 to another object which writer can use to persist it.
Why don't you simply add another processor to your composite that does this transformation? I don't believe you can modify the result object type with an ItemProcessListener
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.