Class AbstractSimpleMessageHandlerFactoryBean<H extends MessageHandler>

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

public abstract class AbstractSimpleMessageHandlerFactoryBean<H extends MessageHandler> extends Object implements FactoryBean<MessageHandler>, ApplicationContextAware, BeanFactoryAware, BeanNameAware, ApplicationEventPublisherAware
Factory bean to create and configure a MessageHandler.
Author:
Dave Syer, Oleg Zhurakousky, Gary Russell, Artem Bilan, David Liu, Christian Tzolov, Ngoc Nhan
  • Field Details

    • logger

      protected final Log logger
  • Constructor Details

    • AbstractSimpleMessageHandlerFactoryBean

      public AbstractSimpleMessageHandlerFactoryBean()
  • Method Details

    • setApplicationContext

      public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
      Specified by:
      setApplicationContext in interface ApplicationContextAware
      Throws:
      BeansException
    • setBeanName

      public void setBeanName(String beanName)
      Specified by:
      setBeanName in interface BeanNameAware
    • setApplicationEventPublisher

      public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher)
      Specified by:
      setApplicationEventPublisher in interface ApplicationEventPublisherAware
    • setChannelResolver

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

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

      public void setOutputChannelName(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(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(BeanFactory beanFactory) throws BeansException
      Specified by:
      setBeanFactory in interface BeanFactoryAware
      Throws:
      BeansException
    • getBeanFactory

      protected BeanFactory getBeanFactory()
    • setAdviceChain

      public void setAdviceChain(List<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(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(String componentName)
      Sets the name of the handler component.
      Parameters:
      componentName - The component name.
    • getObject

      public H getObject()
      Specified by:
      getObject in interface FactoryBean<H extends MessageHandler>
    • createHandlerInternal

      protected final H createHandlerInternal()
    • createHandler

      protected abstract H createHandler()
    • getObjectType

      public Class<? extends MessageHandler> getObjectType()
      Specified by:
      getObjectType in interface FactoryBean<H extends MessageHandler>
    • getPreCreationHandlerType

      protected Class<? extends 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 FactoryBean<H extends MessageHandler>