Class EventEmittingItemProcessListener
java.lang.Object
org.springframework.cloud.task.batch.listener.EventEmittingItemProcessListener
- All Implemented Interfaces:
org.springframework.batch.core.ItemProcessListener
,org.springframework.batch.core.StepListener
,org.springframework.core.Ordered
public class EventEmittingItemProcessListener
extends Object
implements org.springframework.batch.core.ItemProcessListener, org.springframework.core.Ordered
Provides informational messages around the
ItemProcessListener
of a batch job.
The ItemProcessListener.beforeProcess(Object)
of this listener is a no-op.
ItemProcessListener.afterProcess(Object, Object)
returns a message if an item
was filtered (ItemProcessor
returned null), if the result of the processor was
equal to the input (via .equals
), or if they were not equal.
ItemProcessListener.onProcessError(Object, Exception)
provides the exception
via the BatchJobHeaders.BATCH_EXCEPTION
message header.- Author:
- Michael Minella, Glenn Renfro, Ali Shahbour
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ConstructorDescriptionEventEmittingItemProcessListener
(MessagePublisher messagePublisher, int order, TaskEventProperties properties) EventEmittingItemProcessListener
(MessagePublisher messagePublisher, TaskEventProperties properties) -
Method Summary
Modifier and TypeMethodDescriptionvoid
afterProcess
(Object item, Object result) void
beforeProcess
(Object item) int
getOrder()
void
onProcessError
(Object item, Exception e)
-
Constructor Details
-
EventEmittingItemProcessListener
public EventEmittingItemProcessListener(MessagePublisher messagePublisher, TaskEventProperties properties) -
EventEmittingItemProcessListener
public EventEmittingItemProcessListener(MessagePublisher messagePublisher, int order, TaskEventProperties properties)
-
-
Method Details
-
beforeProcess
- Specified by:
beforeProcess
in interfaceorg.springframework.batch.core.ItemProcessListener
-
afterProcess
- Specified by:
afterProcess
in interfaceorg.springframework.batch.core.ItemProcessListener
-
onProcessError
- Specified by:
onProcessError
in interfaceorg.springframework.batch.core.ItemProcessListener
-
getOrder
public int getOrder()- Specified by:
getOrder
in interfaceorg.springframework.core.Ordered
-