use of org.springframework.messaging.support.ExecutorChannelInterceptor in project spring-integration by spring-projects.
the class PollingConsumer method applyBeforeHandle.
private Message<?> applyBeforeHandle(Message<?> message, Deque<ExecutorChannelInterceptor> interceptorStack) {
Message<?> theMessage = message;
for (ChannelInterceptor interceptor : this.channelInterceptors) {
if (interceptor instanceof ExecutorChannelInterceptor) {
ExecutorChannelInterceptor executorInterceptor = (ExecutorChannelInterceptor) interceptor;
theMessage = executorInterceptor.beforeHandle(theMessage, this.inputChannel, this.handler);
if (message == null) {
if (logger.isDebugEnabled()) {
logger.debug(executorInterceptor.getClass().getSimpleName() + " returned null from beforeHandle, i.e. precluding the send.");
}
triggerAfterMessageHandled(null, null, interceptorStack);
return null;
}
interceptorStack.add(executorInterceptor);
}
}
return theMessage;
}
Aggregations