|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.batch.retry.callback.ItemWriterRetryCallback
public class ItemWriterRetryCallback
A RetryCallback
that knows about and caches an item, and attempts to
process it using an ItemWriter
. Used by the
ItemWriterRetryPolicy
to enable external retry of the item
processing.
ItemWriterRetryPolicy
,
RetryPolicy.handleRetryExhausted(RetryContext)
Constructor Summary | |
---|---|
ItemWriterRetryCallback(Object item,
ItemWriter writer)
Constructor with mandatory properties. |
Method Summary | |
---|---|
Object |
doWithRetry(RetryContext context)
Execute an operation with retry semantics. |
FailedItemIdentifier |
getFailedItemIdentifier()
Accessor for the FailedItemIdentifier . |
Object |
getItem()
|
ItemKeyGenerator |
getKeyGenerator()
Accessor for the ItemRecoverer . |
ItemRecoverer |
getRecoverer()
Accessor for the ItemRecoverer . |
void |
setFailedItemIdentifier(FailedItemIdentifier failedItemIdentifier)
Public setter for the FailedItemIdentifier . |
void |
setKeyGenerator(ItemKeyGenerator keyGenerator)
Public setter for the ItemKeyGenerator . |
void |
setRecoverer(ItemRecoverer recoverer)
Setter for injecting optional recovery handler. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ItemWriterRetryCallback(Object item, ItemWriter writer)
item
- the item to processwriter
- the writer to use to process itMethod Detail |
---|
public void setRecoverer(ItemRecoverer recoverer)
ItemRecoverer
, one of those will
be used instead (preferring the reader to the writer if both would be
appropriate).
recoverer
- public void setKeyGenerator(ItemKeyGenerator keyGenerator)
ItemKeyGenerator
. If it is not injected
but the reader or writer implement ItemKeyGenerator
, one of
those will be used instead (preferring the reader to the writer if both
would be appropriate).
keyGenerator
- the keyGenerator to setpublic void setFailedItemIdentifier(FailedItemIdentifier failedItemIdentifier)
FailedItemIdentifier
. If it is not
injected but the reader or writer implement FailedItemIdentifier
,
one of those will be used instead (preferring the reader to the writer if
both would be appropriate).
failedItemIdentifier
- the FailedItemIdentifier
to setpublic Object doWithRetry(RetryContext context) throws Throwable
RetryCallback
doWithRetry
in interface RetryCallback
context
- the current retry context.
Throwable
public Object getItem()
public ItemKeyGenerator getKeyGenerator()
ItemRecoverer
. If the handler is null but the
ItemWriter
is an instance of ItemRecoverer
, then it will
be returned instead. If none of those strategies works then a default
implementation of ItemKeyGenerator
will be used that just returns
the item.
ItemRecoverer
.public FailedItemIdentifier getFailedItemIdentifier()
FailedItemIdentifier
. If the handler is null
but the ItemWriter
or ItemWriter
is an instance of
FailedItemIdentifier
, then it will be returned instead. If none
of those strategies works returns null.
FailedItemIdentifier
.public ItemRecoverer getRecoverer()
ItemRecoverer
. If the handler is null but the
ItemWriter
is an instance of ItemRecoverer
, then it will
be returned instead.
ItemRecoverer
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |