org.springframework.batch.integration.async
Class StepExecutionInterceptor

java.lang.Object
  extended by org.springframework.integration.channel.interceptor.ChannelInterceptorAdapter
      extended by org.springframework.batch.integration.async.StepExecutionInterceptor
All Implemented Interfaces:
org.springframework.integration.channel.ChannelInterceptor

public class StepExecutionInterceptor
extends org.springframework.integration.channel.interceptor.ChannelInterceptorAdapter

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
static String STEP_EXECUTION
          The name of the header
 
Constructor Summary
StepExecutionInterceptor()
           
 
Method Summary
 org.springframework.integration.Message<?> preSend(org.springframework.integration.Message<?> message, org.springframework.integration.MessageChannel channel)
           
 
Methods inherited from class org.springframework.integration.channel.interceptor.ChannelInterceptorAdapter
postReceive, postSend, preReceive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STEP_EXECUTION

public static final String STEP_EXECUTION
The name of the header

See Also:
Constant Field Values
Constructor Detail

StepExecutionInterceptor

public StepExecutionInterceptor()
Method Detail

preSend

public org.springframework.integration.Message<?> preSend(org.springframework.integration.Message<?> message,
                                                          org.springframework.integration.MessageChannel channel)
Specified by:
preSend in interface org.springframework.integration.channel.ChannelInterceptor
Overrides:
preSend in class org.springframework.integration.channel.interceptor.ChannelInterceptorAdapter


Copyright © 2011. All Rights Reserved.