Class MessagePublishingInterceptor

java.lang.Object
org.springframework.integration.aop.MessagePublishingInterceptor
All Implemented Interfaces:
org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware

public class MessagePublishingInterceptor
extends java.lang.Object
implements org.aopalliance.intercept.MethodInterceptor, org.springframework.beans.factory.BeanFactoryAware
A MethodInterceptor that publishes Messages to a channel. The payload of the published Message can be derived from arguments or any return value or exception resulting from the method invocation. That mapping is the responsibility of the EL expression provided by the PublisherMetadataSource.
Since:
2.0
  • Constructor Summary

    Constructors 
    Constructor Description
    MessagePublishingInterceptor​(org.springframework.integration.aop.PublisherMetadataSource metadataSource)  
  • Method Summary

    Modifier and Type Method Description
    protected MessageBuilderFactory getMessageBuilderFactory()  
    java.lang.Object invoke​(org.aopalliance.intercept.MethodInvocation invocation)  
    void setBeanFactory​(org.springframework.beans.factory.BeanFactory beanFactory)  
    void setChannelResolver​(org.springframework.messaging.core.DestinationResolver<org.springframework.messaging.MessageChannel> channelResolver)  
    void setDefaultChannelName​(java.lang.String defaultChannelName)  

    Methods inherited from class java.lang.Object

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

    • MessagePublishingInterceptor

      public MessagePublishingInterceptor​(org.springframework.integration.aop.PublisherMetadataSource metadataSource)
  • Method Details

    • setDefaultChannelName

      public void setDefaultChannelName​(java.lang.String defaultChannelName)
      Parameters:
      defaultChannelName - the default channel name.
      Since:
      4.0.3
    • setChannelResolver

      public void setChannelResolver​(org.springframework.messaging.core.DestinationResolver<org.springframework.messaging.MessageChannel> channelResolver)
    • 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
    • getMessageBuilderFactory

      protected MessageBuilderFactory getMessageBuilderFactory()
    • invoke

      public final java.lang.Object invoke​(org.aopalliance.intercept.MethodInvocation invocation) throws java.lang.Throwable
      Specified by:
      invoke in interface org.aopalliance.intercept.MethodInterceptor
      Throws:
      java.lang.Throwable