|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.batch.integration.chunk.RemoteChunkHandlerFactoryBean<T>
public class RemoteChunkHandlerFactoryBean<T>
Convenient factory bean for a chunk handler that also converts an existing chunk-oriented step into a remote chunk master. The idea is to lift the existing chunk processor out of a Step that works locally, and replace it with a one that writes chunks into a message channel. The existing step hands its business chunk processing responsibility over to the handler produced by the factory, which then needs to be set up as a worker on the other end of the channel the chunks are being sent to. Once this chunk handler is installed the application is playing the role of both the master and the slave listeners in the Remote Chunking pattern for the Step in question.
| Constructor Summary | |
|---|---|
RemoteChunkHandlerFactoryBean()
|
|
| Method Summary | |
|---|---|
ChunkHandler<T> |
getObject()
Builds a ChunkHandler from the ChunkProcessor extracted from the step provided. |
Class<?> |
getObjectType()
The type of object created by this factory. |
boolean |
isSingleton()
Optimization for the bean facctory (always returns true). |
void |
setChunkWriter(ItemWriter<T> chunkWriter)
The item writer to be injected into the step. |
void |
setStep(TaskletStep step)
The local step that is to be converted to a remote chunk master. |
void |
setStepContributionSource(StepContributionSource stepContributionSource)
A source of StepContribution instances coming back from remote workers. |
protected void |
updateStepContribution(StepContribution contribution,
StepContributionSource stepContributionSource)
Update a StepContribution with all the data from a StepContributionSource. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RemoteChunkHandlerFactoryBean()
| Method Detail |
|---|
public void setStep(TaskletStep step)
step - the step to setpublic void setChunkWriter(ItemWriter<T> chunkWriter)
ChunkMessageChannelItemWriter.
chunkWriter - the chunk writer to setpublic void setStepContributionSource(StepContributionSource stepContributionSource)
StepContribution instances coming back from remote workers.
stepContributionSource - the step contribution source to set (defaults to the chunk writer)public Class<?> getObjectType()
ChunkHandler class.
getObjectType in interface FactoryBean<ChunkHandler<T>>FactoryBean.getObjectType()public boolean isSingleton()
isSingleton in interface FactoryBean<ChunkHandler<T>>FactoryBean.isSingleton()
public ChunkHandler<T> getObject()
throws Exception
ChunkHandler from the ChunkProcessor extracted from the step provided. Also modifies the step to send chunks to the chunk handler via the
chunk writer.
getObject in interface FactoryBean<ChunkHandler<T>>ExceptionFactoryBean.getObject()
protected void updateStepContribution(StepContribution contribution,
StepContributionSource stepContributionSource)
contribution - the current contributionstepContributionSource - a source of StepContributions
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||