Class StepExecutionInterceptor
java.lang.Object
org.springframework.batch.integration.async.StepExecutionInterceptor
- All Implemented Interfaces:
org.springframework.messaging.support.ChannelInterceptor
public class StepExecutionInterceptor
extends Object
implements org.springframework.messaging.support.ChannelInterceptor
A
ChannelInterceptor
that adds the current StepExecution
(if there is
one) as a header to the message. Downstream asynchronous handlers can then take
advantage of the step context without needing to be step scoped, which is a problem for
handlers executing in another thread because the scope context is not available.- Author:
- Dave Syer
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.messaging.Message<?>
preSend
(org.springframework.messaging.Message<?> message, org.springframework.messaging.MessageChannel channel) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.messaging.support.ChannelInterceptor
afterReceiveCompletion, afterSendCompletion, postReceive, postSend, preReceive
-
Field Details
-
STEP_EXECUTION
The name of the header- See Also:
-
-
Constructor Details
-
StepExecutionInterceptor
public StepExecutionInterceptor()
-
-
Method Details
-
preSend
public org.springframework.messaging.Message<?> preSend(org.springframework.messaging.Message<?> message, org.springframework.messaging.MessageChannel channel) - Specified by:
preSend
in interfaceorg.springframework.messaging.support.ChannelInterceptor
-