Class StepExecutionInterceptor
- java.lang.Object
- org.springframework.messaging.support.ChannelInterceptorAdapter
- org.springframework.batch.integration.async.StepExecutionInterceptor
- All Implemented Interfaces:
org.springframework.messaging.support.ChannelInterceptor
public class StepExecutionInterceptor extends org.springframework.messaging.support.ChannelInterceptorAdapter
AChannelInterceptor
that adds the currentStepExecution
(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
Fields Modifier and Type Field Description static java.lang.String
STEP_EXECUTION
The name of the header
Constructor Summary
Constructors Constructor Description StepExecutionInterceptor()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.messaging.Message<?>
preSend(org.springframework.messaging.Message<?> message, org.springframework.messaging.MessageChannel channel)
Field Detail
STEP_EXECUTION
public static final java.lang.String STEP_EXECUTION
The name of the header- See Also:
- Constant Field Values
Method Detail
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
- Overrides:
preSend
in classorg.springframework.messaging.support.ChannelInterceptorAdapter