类 MessageSourcePollerInterceptor

  • 所有已实现的接口:
    org.springframework.beans.factory.InitializingBean, org.springframework.messaging.support.ChannelInterceptor

    public class MessageSourcePollerInterceptor
    extends org.springframework.messaging.support.ChannelInterceptorAdapter
    implements org.springframework.beans.factory.InitializingBean
    A ChannelInterceptor that turns a pollable channel into a "pass-thru channel": if a client calls receive() on the channel it will delegate to a MessageSource to pull the message directly from an external source. This is particularly useful in combination with a message channel in thread scope, in which case the receive() can join a transaction which was started by the caller.
    作者:
    Dave Syer
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型方法说明
      voidafterPropertiesSet()
      Asserts that mandatory properties are set.
      booleanpreReceive​(org.springframework.messaging.MessageChannel channel)
      Receive from the MessageSource and send immediately to the input channel, so that the call that we are intercepting always a message to receive.
      voidsetChannel​(org.springframework.messaging.MessageChannel channel)
      Optional MessageChannel for injecting the message received from the source (defaults to the channel intercepted in preReceive(MessageChannel)).
      voidsetMessageSource​(org.springframework.integration.core.MessageSource<?> source) 
      • 从类继承的方法 org.springframework.messaging.support.ChannelInterceptorAdapter

        afterReceiveCompletion, afterSendCompletion, postReceive, postSend, preSend
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

      • MessageSourcePollerInterceptor

        public MessageSourcePollerInterceptor​(org.springframework.integration.core.MessageSource<?> source)
        参数:
        source - a message source to poll for messages on receive.
    • 方法详细资料

      • setChannel

        public void setChannel​(org.springframework.messaging.MessageChannel channel)
        Optional MessageChannel for injecting the message received from the source (defaults to the channel intercepted in preReceive(MessageChannel)).
        参数:
        channel - the channel to set
      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws java.lang.Exception
        Asserts that mandatory properties are set.
        指定者:
        afterPropertiesSet 在接口中 org.springframework.beans.factory.InitializingBean
        抛出:
        java.lang.Exception
        另请参阅:
        InitializingBean.afterPropertiesSet()
      • setMessageSource

        public void setMessageSource​(org.springframework.integration.core.MessageSource<?> source)
        参数:
        source - a message source to poll for messages on receive.
      • preReceive

        public boolean preReceive​(org.springframework.messaging.MessageChannel channel)
        Receive from the MessageSource and send immediately to the input channel, so that the call that we are intercepting always a message to receive.
        指定者:
        preReceive 在接口中 org.springframework.messaging.support.ChannelInterceptor
        覆盖:
        preReceive 在类中 org.springframework.messaging.support.ChannelInterceptorAdapter
        另请参阅:
        ChannelInterceptorAdapter.preReceive(MessageChannel)