|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.batch.core.step.item.SimpleStepFactoryBean<T,S>
public class SimpleStepFactoryBean<T,S>
Most common configuration options for simple steps should be found here. Use
this factory bean instead of creating a Step
implementation manually.
This factory does not support configuration of fault-tolerant behavior, use
appropriate subclass of this factory bean to configure skip or retry.
FaultTolerantStepFactoryBean
Field Summary | |
---|---|
protected Log |
logger
|
Constructor Summary | |
---|---|
SimpleStepFactoryBean()
Default constructor for SimpleStepFactoryBean . |
Method Summary | |
---|---|
protected void |
applyConfiguration(TaskletStep step)
|
protected SimpleChunkProcessor<T,S> |
configureChunkProcessor()
Extension point for creating appropriate ChunkProcessor . |
protected SimpleChunkProvider<T> |
configureChunkProvider()
Extension point for creating appropriate ChunkProvider . |
protected RepeatOperations |
getChunkOperations()
Protected getter for the chunk operations to make them available in subclasses. |
protected ExceptionHandler |
getExceptionHandler()
Protected getter for the ExceptionHandler . |
protected ItemProcessor<? super T,? extends S> |
getItemProcessor()
Protected getter for the ItemProcessor for subclasses to use |
protected ItemReader<? extends T> |
getItemReader()
Protected getter for the ItemReader for subclasses to use. |
protected ItemWriter<? super S> |
getItemWriter()
Protected getter for the ItemWriter for subclasses to use |
protected StepListener[] |
getListeners()
Protected getter for the StepListener s. |
String |
getName()
Public getter for the name of the step. |
Object |
getObject()
Create a Step from the configuration provided. |
Class<TaskletStep> |
getObjectType()
|
protected RepeatOperations |
getStepOperations()
Protected getter for the step operations to make them available in subclasses. |
protected TaskExecutor |
getTaskExecutor()
Mkae the TaskExecutor available to subclasses |
protected TransactionAttribute |
getTransactionAttribute()
Getter for the TransactionAttribute for subclasses only. |
protected boolean |
isReaderTransactionalQueue()
Convenience method for subclasses. |
boolean |
isSingleton()
Returns true by default, but in most cases a Step should not be
treated as thread safe. |
protected void |
registerStreams(TaskletStep step,
ItemStream[] streams)
Register the streams with the step. |
void |
setAllowStartIfComplete(boolean allowStartIfComplete)
Public setter for the flag to indicate that the step should be replayed on a restart, even if successful the first time. |
void |
setBeanName(String name)
Set the bean name property, which will become the name of the Step when it is created. |
void |
setChunkCompletionPolicy(CompletionPolicy chunkCompletionPolicy)
Public setter for the CompletionPolicy applying to the chunk
level. |
void |
setChunkOperations(RepeatOperations chunkOperations)
Public setter for the chunkOperations. |
void |
setCommitInterval(int commitInterval)
Set the commit interval. |
void |
setExceptionHandler(ExceptionHandler exceptionHandler)
Public setter for the ExceptionHandler . |
void |
setIsolation(Isolation isolation)
|
void |
setIsReaderTransactionalQueue(boolean isReaderTransactionalQueue)
Flag to signal that the reader is transactional (usually a JMS consumer) so that items are re-presented after a rollback. |
void |
setItemProcessor(ItemProcessor<? super T,? extends S> itemProcessor)
|
void |
setItemReader(ItemReader<? extends T> itemReader)
|
void |
setItemWriter(ItemWriter<? super S> itemWriter)
|
void |
setJobRepository(JobRepository jobRepository)
Public setter for JobRepository . |
void |
setListeners(StepListener[] listeners)
The listeners to inject into the Step . |
void |
setPropagation(Propagation propagation)
|
void |
setSingleton(boolean singleton)
Public setter for the singleton flag. |
void |
setStartLimit(int startLimit)
Public setter for the start limit for the step. |
void |
setStepOperations(RepeatOperations stepOperations)
Public setter for the stepOperations. |
void |
setStreams(ItemStream[] streams)
The streams to inject into the Step . |
void |
setTaskExecutor(TaskExecutor taskExecutor)
Public setter for the TaskExecutor . |
void |
setThrottleLimit(int throttleLimit)
Public setter for the throttle limit. |
void |
setTransactionManager(PlatformTransactionManager transactionManager)
Public setter for the PlatformTransactionManager . |
void |
setTransactionTimeout(int transactionTimeout)
The timeout for an individual transaction in the step. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Log logger
Constructor Detail |
---|
public SimpleStepFactoryBean()
SimpleStepFactoryBean
.
Method Detail |
---|
public void setIsReaderTransactionalQueue(boolean isReaderTransactionalQueue)
isReaderTransactionalQueue
- the value of the flagprotected boolean isReaderTransactionalQueue()
public void setBeanName(String name)
Step
when it is created.
setBeanName
in interface BeanNameAware
BeanNameAware.setBeanName(java.lang.String)
public String getName()
public void setTransactionTimeout(int transactionTimeout)
transactionTimeout
- the transaction timeout to set, defaults to
infinitepublic void setPropagation(Propagation propagation)
propagation
- the propagation to set for business transactionspublic void setIsolation(Isolation isolation)
isolation
- the isolation to set for business transactionspublic void setStartLimit(int startLimit)
startLimit
- the startLimit to setpublic void setAllowStartIfComplete(boolean allowStartIfComplete)
allowStartIfComplete
- the shouldAllowStartIfComplete to setpublic void setItemReader(ItemReader<? extends T> itemReader)
itemReader
- the ItemReader
to setpublic void setItemWriter(ItemWriter<? super S> itemWriter)
itemWriter
- the ItemWriter
to setpublic void setItemProcessor(ItemProcessor<? super T,? extends S> itemProcessor)
itemProcessor
- the ItemProcessor
to setpublic void setStreams(ItemStream[] streams)
Step
. Any instance of
ItemStream
can be used, and will then receive callbacks at the
appropriate stage in the step.
streams
- an array of listenerspublic void setListeners(StepListener[] listeners)
Step
. Any instance of
StepListener
can be used, and will then receive callbacks at the
appropriate stage in the step.
listeners
- an array of listenersprotected StepListener[] getListeners()
StepListener
s.
protected ItemReader<? extends T> getItemReader()
ItemReader
for subclasses to use.
protected ItemWriter<? super S> getItemWriter()
ItemWriter
for subclasses to use
protected ItemProcessor<? super T,? extends S> getItemProcessor()
ItemProcessor
for subclasses to use
public void setJobRepository(JobRepository jobRepository)
JobRepository
.
jobRepository
- is a mandatory dependence (no default).public void setTransactionManager(PlatformTransactionManager transactionManager)
PlatformTransactionManager
.
transactionManager
- the transaction manager to setprotected TransactionAttribute getTransactionAttribute()
TransactionAttribute
for subclasses only.
public final Object getObject() throws Exception
Step
from the configuration provided.
getObject
in interface FactoryBean
Exception
FactoryBean.getObject()
public Class<TaskletStep> getObjectType()
getObjectType
in interface FactoryBean
public boolean isSingleton()
Step
should not be
treated as thread safe. Clients are recommended to create a new step for
each job execution.
isSingleton
in interface FactoryBean
FactoryBean.isSingleton()
public void setSingleton(boolean singleton)
singleton
- the value to set. Defaults to true.public void setCommitInterval(int commitInterval)
commitInterval
- 1 by defaultpublic void setChunkCompletionPolicy(CompletionPolicy chunkCompletionPolicy)
CompletionPolicy
applying to the chunk
level. A transaction will be committed when this policy decides to
complete. Defaults to a SimpleCompletionPolicy
with chunk size
equal to the commitInterval property.
chunkCompletionPolicy
- the chunkCompletionPolicy to setprotected RepeatOperations getStepOperations()
public void setStepOperations(RepeatOperations stepOperations)
stepOperations
- the stepOperations to setpublic void setChunkOperations(RepeatOperations chunkOperations)
chunkOperations
- the chunkOperations to setprotected RepeatOperations getChunkOperations()
public void setExceptionHandler(ExceptionHandler exceptionHandler)
ExceptionHandler
.
exceptionHandler
- the exceptionHandler to setprotected ExceptionHandler getExceptionHandler()
ExceptionHandler
.
ExceptionHandler
public void setTaskExecutor(TaskExecutor taskExecutor)
TaskExecutor
. If this is set, then it will
be used to execute the chunk processing inside the Step
.
taskExecutor
- the taskExecutor to setprotected TaskExecutor getTaskExecutor()
TaskExecutor
available to subclasses
public void setThrottleLimit(int throttleLimit)
TaskExecutorRepeatTemplate.DEFAULT_THROTTLE_LIMIT
.
throttleLimit
- the throttle limit to set.protected void applyConfiguration(TaskletStep step)
step
- protected void registerStreams(TaskletStep step, ItemStream[] streams)
step
- the TaskletStep
streams
- the streams to registerprotected SimpleChunkProvider<T> configureChunkProvider()
ChunkProvider
. Return
value must subclass SimpleChunkProvider
due to listener
registration.
protected SimpleChunkProcessor<T,S> configureChunkProcessor()
ChunkProcessor
. Return
value must subclass SimpleChunkProcessor
due to listener
registration.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |