|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.batch.integration.file.FileToMessagesJobFactoryBean
public class FileToMessagesJobFactoryBean
A FactoryBean for a Job
with a single step which just pumps messages
from a file into a channel. The channel has to be a
DirectChannel
to ensure that failures propagate up to the step
and fail the job execution. Normally this job will be used in conjunction
with a JobLaunchingMessageHandler
and a
ResourcePayloadAsJobParameterStrategy
, so that the user can just
send a message to a request channel listing the files to be processed, and
everything else just happens by magic. After a failure the job will be
restarted just by sending it the same message.
Constructor Summary | |
---|---|
FileToMessagesJobFactoryBean()
|
Method Summary | |
---|---|
Object |
getObject()
Creates a Job that can process a flat file or XML file into
messages. |
Class<?> |
getObjectType()
Always returns Job . |
boolean |
isSingleton()
Always true. |
void |
setBeanName(String name)
|
void |
setChannel(org.springframework.integration.channel.MessageChannel channel)
Public setter for the channel. |
void |
setItemReader(ItemReader itemReader)
Public setter for the ItemReader . |
void |
setJobRepository(JobRepository jobRepository)
Public setter for the JobRepository . |
void |
setTransactionManager(PlatformTransactionManager transactionManager)
Public setter for the PlatformTransactionManager . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileToMessagesJobFactoryBean()
Method Detail |
---|
public void setBeanName(String name)
setBeanName
in interface BeanNameAware
public void setItemReader(ItemReader itemReader)
ItemReader
. Must be either a
FlatFileItemReader
or a StaxEventItemReader
. In either
case there is no need to set the resource property as it will be set by
this factory.
itemReader
- the itemReader to setpublic void setChannel(org.springframework.integration.channel.MessageChannel channel)
channel
- the channel to setpublic void setJobRepository(JobRepository jobRepository)
JobRepository
.
jobRepository
- the job repository to setpublic void setTransactionManager(PlatformTransactionManager transactionManager)
PlatformTransactionManager
.
transactionManager
- the transaction manager to setpublic Object getObject() throws Exception
Job
that can process a flat file or XML file into
messages. To launch the job will require only a JobParameters
instance with a resource location as a URL.
getObject
in interface FactoryBean
Exception
FactoryBean.getObject()
public Class<?> getObjectType()
Job
.
getObjectType
in interface FactoryBean
FactoryBean.getObjectType()
public boolean isSingleton()
isSingleton
in interface FactoryBean
FactoryBean.isSingleton()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |