BeanIO 2.0.4

org.beanio.spring
Class BeanIOStreamFactory

java.lang.Object
  extended by org.beanio.spring.BeanIOStreamFactory
All Implemented Interfaces:
FactoryBean

public class BeanIOStreamFactory
extends Object
implements FactoryBean

A Spring factory bean for creating shared StreamFactory instances for BeanIO item readers and writers. Using a shared StreamFactory can improve performance by preventing mapping files from being loaded more than once when multiple item readers and writers are repeatedly invoked or share the same mapping configuration.

Since:
1.2
Author:
Kevin Seim
See Also:
StreamFactory, BeanIOFlatFileItemReader, BeanIOFlatFileItemWriter

Constructor Summary
BeanIOStreamFactory()
           
 
Method Summary
protected  StreamFactory createStreamFactory()
          Creates a new StreamFactory and loads configured stream mapping resources.
 StreamFactory getObject()
           
 Class<?> getObjectType()
           
 boolean isSingleton()
           
 void setStreamMappings(List<Resource> streamMappings)
          Sets the list of mapping files to load into this stream factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanIOStreamFactory

public BeanIOStreamFactory()
Method Detail

getObject

public StreamFactory getObject()
                        throws Exception
Specified by:
getObject in interface FactoryBean
Throws:
Exception

createStreamFactory

protected StreamFactory createStreamFactory()
                                     throws IOException,
                                            BeanIOConfigurationException
Creates a new StreamFactory and loads configured stream mapping resources.

Returns:
the new StreamFactory
Throws:
BeanIOConfigurationException - if a stream mapping resource does not exist or is invalid
IOException - if an I/O error occurs

getObjectType

public Class<?> getObjectType()
Specified by:
getObjectType in interface FactoryBean

isSingleton

public boolean isSingleton()
Specified by:
isSingleton in interface FactoryBean

setStreamMappings

public void setStreamMappings(List<Resource> streamMappings)
Sets the list of mapping files to load into this stream factory.

Parameters:
streamMappings - the list of mapping files

BeanIO 2.0.4

Copyright © 2010-2013 Kevin Seim