Thanks Dave. Thanks for the clue.
One questions is how to retrive the instance of Factory bean itself?
I tried following as said in the docs, but this throws an exception.
Code:
<bean id="rapidCompositeFileItemWriter" class="com.....writer.RapidFileCompositeItemWriter">
<property name="jobContext" ref="jobContextRef"/>
<property name="sessionWriters" ref="sessionWritersRef"/>
<property name="writerFactory" ref="&inboundOutboundWriterFactoryBean"></property>
</bean>
<util:list id="sessionWritersRef">
<ref local="inboundOutboundWriterFactoryBean"/>
<ref local="inboundOutboundWriterFactoryBean"/>
.
.
</util:list>
<bean id="inboundOutboundWriterFactoryBean" class="com.......writer.InboundOutboundWriterFactory" p:inboundOutboundWriter-ref="inboundOutBoundWriterRef"/>
<bean id="inboundOutBoundWriterRef" class="com.....writer.InboundOutBoundWriter" scope="prototype">
<constructor-arg ref="flatFileWriterRef"></constructor-arg>
<constructor-arg ref="flatFileWriterRef"></constructor-arg>
</bean>