Class AbstractSimpleMessageHandlerFactoryBean<H extends org.springframework.messaging.MessageHandler>

java.lang.Object
org.springframework.integration.config.AbstractSimpleMessageHandlerFactoryBean<H>
Type Parameters:
H - the target message handler type.
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.FactoryBean<org.springframework.messaging.MessageHandler>, org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationEventPublisherAware
Direct Known Subclasses:
AbstractStandardMessageHandlerFactoryBean, AggregatorFactoryBean, ExpressionControlBusFactoryBean

public abstract class AbstractSimpleMessageHandlerFactoryBean<H extends org.springframework.messaging.MessageHandler>
extends java.lang.Object
implements org.springframework.beans.factory.FactoryBean<org.springframework.messaging.MessageHandler>, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.context.ApplicationEventPublisherAware
Factory bean to create and configure a MessageHandler.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected org.apache.commons.logging.Log logger  

    Fields inherited from interface org.springframework.beans.factory.FactoryBean

    OBJECT_TYPE_ATTRIBUTE
  • Constructor Summary

    Constructors 
    Constructor Description
    AbstractSimpleMessageHandlerFactoryBean()  
  • Method Summary

    Modifier and Type Method Description
    protected abstract H createHandler()  
    protected H createHandlerInternal()  
    protected org.springframework.beans.factory.BeanFactory getBeanFactory()  
    H getObject()  
    java.lang.Class<? extends org.springframework.messaging.MessageHandler> getObjectType()  
    protected java.lang.Class<? extends org.springframework.messaging.MessageHandler> getPreCreationHandlerType()
    Subclasses can override this to return a more specific type before handler creation.
    boolean isSingleton()  
    void setAdviceChain​(java.util.List<org.aopalliance.aop.Advice> adviceChain)
    Set the advice chain to be configured within an AbstractReplyProducingMessageHandler to advise just this local endpoint.
    void setApplicationContext​(org.springframework.context.ApplicationContext applicationContext)  
    void setApplicationEventPublisher​(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)  
    void setAsync​(java.lang.Boolean async)
    Currently only exposed on the service activator namespace.
    void setBeanFactory​(org.springframework.beans.factory.BeanFactory beanFactory)  
    void setBeanName​(java.lang.String beanName)  
    void setChannelResolver​(org.springframework.messaging.core.DestinationResolver<org.springframework.messaging.MessageChannel> channelResolver)
    Set the handler's channel resolver.
    void setComponentName​(java.lang.String componentName)
    Sets the name of the handler component.
    void setOrder​(java.lang.Integer order)
    Set the order in which the handler will be subscribed to its channel (when subscribable).
    void setOutputChannel​(org.springframework.messaging.MessageChannel outputChannel)
    Set the handler's output channel.
    void setOutputChannelName​(java.lang.String outputChannelName)
    Set the handler's output channel name.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • logger

      protected final org.apache.commons.logging.Log logger
  • Constructor Details

  • Method Details

    • setApplicationContext

      public void setApplicationContext​(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
      Throws:
      org.springframework.beans.BeansException
    • setBeanName

      public void setBeanName​(java.lang.String beanName)
      Specified by:
      setBeanName in interface org.springframework.beans.factory.BeanNameAware
    • setApplicationEventPublisher

      public void setApplicationEventPublisher​(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
      Specified by:
      setApplicationEventPublisher in interface org.springframework.context.ApplicationEventPublisherAware
    • setChannelResolver

      public void setChannelResolver​(org.springframework.messaging.core.DestinationResolver<org.springframework.messaging.MessageChannel> channelResolver)
      Set the handler's channel resolver.
      Parameters:
      channelResolver - the channel resolver to set.
    • setOutputChannel

      public void setOutputChannel​(org.springframework.messaging.MessageChannel outputChannel)
      Set the handler's output channel.
      Parameters:
      outputChannel - the output channel to set.
    • setOutputChannelName

      public void setOutputChannelName​(java.lang.String outputChannelName)
      Set the handler's output channel name.
      Parameters:
      outputChannelName - the output channel bean name to set.
      Since:
      5.1.4
    • setOrder

      public void setOrder​(java.lang.Integer order)
      Set the order in which the handler will be subscribed to its channel (when subscribable).
      Parameters:
      order - the order to set.
    • setBeanFactory

      public void setBeanFactory​(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException
      Specified by:
      setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAware
      Throws:
      org.springframework.beans.BeansException
    • getBeanFactory

      protected org.springframework.beans.factory.BeanFactory getBeanFactory()
    • setAdviceChain

      public void setAdviceChain​(java.util.List<org.aopalliance.aop.Advice> adviceChain)
      Set the advice chain to be configured within an AbstractReplyProducingMessageHandler to advise just this local endpoint. For other handlers, the advice chain is applied around the handler itself.
      Parameters:
      adviceChain - the adviceChain to set.
    • setAsync

      public void setAsync​(java.lang.Boolean async)
      Currently only exposed on the service activator namespace. It's not clear that other endpoints would benefit from async support, but any subclass of AbstractReplyProducingMessageHandler can potentially return a ListenableFuture<?>.
      Parameters:
      async - the async to set.
      Since:
      4.3
    • setComponentName

      public void setComponentName​(java.lang.String componentName)
      Sets the name of the handler component.
      Parameters:
      componentName - The component name.
    • getObject

      public H getObject()
      Specified by:
      getObject in interface org.springframework.beans.factory.FactoryBean<H extends org.springframework.messaging.MessageHandler>
    • createHandlerInternal

      protected final H createHandlerInternal()
    • createHandler

      protected abstract H createHandler()
    • getObjectType

      public java.lang.Class<? extends org.springframework.messaging.MessageHandler> getObjectType()
      Specified by:
      getObjectType in interface org.springframework.beans.factory.FactoryBean<H extends org.springframework.messaging.MessageHandler>
    • getPreCreationHandlerType

      protected java.lang.Class<? extends org.springframework.messaging.MessageHandler> getPreCreationHandlerType()
      Subclasses can override this to return a more specific type before handler creation. After handler creation, the actual type is used.
      Returns:
      the type.
    • isSingleton

      public boolean isSingleton()
      Specified by:
      isSingleton in interface org.springframework.beans.factory.FactoryBean<H extends org.springframework.messaging.MessageHandler>