org.springframework.integration.handler
Class ConcurrentHandler

java.lang.Object
  extended by org.springframework.integration.handler.ConcurrentHandler
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle, MessageHandler

public class ConcurrentHandler
extends java.lang.Object
implements MessageHandler, org.springframework.context.Lifecycle, org.springframework.beans.factory.InitializingBean

A MessageHandler implementation that encapsulates a ThreadPoolTaskExecutor and delegates to a wrapped handler for concurrent, asynchronous message handling.

Author:
Mark Fisher

Constructor Summary
ConcurrentHandler(MessageHandler handler)
           
ConcurrentHandler(MessageHandler handler, ConcurrencyPolicy concurrencyPolicy)
           
 
Method Summary
 void afterPropertiesSet()
           
 Message<?> handle(Message<?> message)
           
 boolean isRunning()
           
 void refreshExecutor()
           
 void setErrorHandler(ErrorHandler errorHandler)
           
 void setExecutor(org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor executor)
           
 void setReplyHandler(ReplyHandler replyHandler)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConcurrentHandler

public ConcurrentHandler(MessageHandler handler)

ConcurrentHandler

public ConcurrentHandler(MessageHandler handler,
                         ConcurrencyPolicy concurrencyPolicy)
Method Detail

setExecutor

public void setExecutor(org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor executor)

setErrorHandler

public void setErrorHandler(ErrorHandler errorHandler)

setReplyHandler

public void setReplyHandler(ReplyHandler replyHandler)

afterPropertiesSet

public void afterPropertiesSet()
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean

refreshExecutor

public void refreshExecutor()

isRunning

public boolean isRunning()
Specified by:
isRunning in interface org.springframework.context.Lifecycle

start

public void start()
Specified by:
start in interface org.springframework.context.Lifecycle

stop

public void stop()
Specified by:
stop in interface org.springframework.context.Lifecycle

handle

public Message<?> handle(Message<?> message)
Specified by:
handle in interface MessageHandler