|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.batch.integration.async.AsyncItemProcessor<I,O>
I - the input object typeO - the output object type (will be wrapped in a Future)public class AsyncItemProcessor<I,O>
An ItemProcessor that delegates to a nested processor and in the
background. To allow for background processing the return value from the
processor is a Future which needs to be unpacked before the item can
be used by a client.
| Constructor Summary | |
|---|---|
AsyncItemProcessor()
|
|
| Method Summary | |
|---|---|
void |
afterPropertiesSet()
Check mandatory properties (the setDelegate(ItemProcessor)). |
java.util.concurrent.Future<O> |
process(I item)
Transform the input by delegating to the provided item processor. |
void |
setDelegate(org.springframework.batch.item.ItemProcessor<I,O> delegate)
The ItemProcessor to use to delegate processing to in a
background thread. |
void |
setTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)
The TaskExecutor to use to allow the item processing to proceed
in the background. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AsyncItemProcessor()
| Method Detail |
|---|
public void afterPropertiesSet()
throws java.lang.Exception
setDelegate(ItemProcessor)).
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.ExceptionInitializingBean.afterPropertiesSet()public void setDelegate(org.springframework.batch.item.ItemProcessor<I,O> delegate)
ItemProcessor to use to delegate processing to in a
background thread.
delegate - the ItemProcessor to use as a delegatepublic void setTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)
TaskExecutor to use to allow the item processing to proceed
in the background. Defaults to a SyncTaskExecutor so no threads
are created unless this is overridden.
taskExecutor - a TaskExecutor
public java.util.concurrent.Future<O> process(I item)
throws java.lang.Exception
Future so that clients can unpack it
later.
process in interface org.springframework.batch.item.ItemProcessor<I,java.util.concurrent.Future<O>>java.lang.ExceptionItemProcessor.process(Object)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||