org.springframework.integration.endpoint.interceptor
Class ConcurrencyInterceptor

java.lang.Object
  extended by org.springframework.integration.endpoint.interceptor.EndpointInterceptorAdapter
      extended by org.springframework.integration.endpoint.interceptor.ConcurrencyInterceptor
All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, ChannelRegistryAware, EndpointInterceptor

public class ConcurrencyInterceptor
extends EndpointInterceptorAdapter
implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, ChannelRegistryAware

An EndpointInterceptor implementation that delegates to a TaskExecutor for concurrent, asynchronous message handling.

Author:
Mark Fisher

Field Summary
private  ChannelRegistry channelRegistry
           
private  ErrorHandler errorHandler
           
private  org.springframework.core.task.TaskExecutor executor
           
private  org.apache.commons.logging.Log logger
           
 
Constructor Summary
ConcurrencyInterceptor(ConcurrencyPolicy concurrencyPolicy, java.lang.String threadPrefix)
           
ConcurrencyInterceptor(org.springframework.core.task.TaskExecutor executor)
           
 
Method Summary
 void afterPropertiesSet()
           
 Message<?> aroundHandle(Message<?> requestMessage, MessageHandler handler)
           
 void destroy()
           
 void setChannelRegistry(ChannelRegistry channelRegistry)
           
 void setErrorHandler(ErrorHandler errorHandler)
           
 
Methods inherited from class org.springframework.integration.endpoint.interceptor.EndpointInterceptorAdapter
postHandle, preHandle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private final org.apache.commons.logging.Log logger

executor

private final org.springframework.core.task.TaskExecutor executor

errorHandler

private volatile ErrorHandler errorHandler

channelRegistry

private volatile ChannelRegistry channelRegistry
Constructor Detail

ConcurrencyInterceptor

public ConcurrencyInterceptor(org.springframework.core.task.TaskExecutor executor)

ConcurrencyInterceptor

public ConcurrencyInterceptor(ConcurrencyPolicy concurrencyPolicy,
                              java.lang.String threadPrefix)
Method Detail

setErrorHandler

public void setErrorHandler(ErrorHandler errorHandler)

setChannelRegistry

public void setChannelRegistry(ChannelRegistry channelRegistry)
Specified by:
setChannelRegistry in interface ChannelRegistryAware

afterPropertiesSet

public void afterPropertiesSet()
                        throws java.lang.Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
java.lang.Exception

destroy

public void destroy()
             throws java.lang.Exception
Specified by:
destroy in interface org.springframework.beans.factory.DisposableBean
Throws:
java.lang.Exception

aroundHandle

public Message<?> aroundHandle(Message<?> requestMessage,
                               MessageHandler handler)
Specified by:
aroundHandle in interface EndpointInterceptor
Overrides:
aroundHandle in class EndpointInterceptorAdapter