public class MessagePublishingInterceptor extends Object implements MethodInterceptor, BeanFactoryAware
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
.Constructor and Description |
---|
MessagePublishingInterceptor(org.springframework.integration.aop.PublisherMetadataSource metadataSource) |
Modifier and Type | Method and Description |
---|---|
protected MessageBuilderFactory |
getMessageBuilderFactory() |
Object |
invoke(MethodInvocation invocation) |
void |
setBeanFactory(BeanFactory beanFactory) |
void |
setChannelResolver(DestinationResolver<MessageChannel> channelResolver) |
void |
setDefaultChannelName(String defaultChannelName) |
public MessagePublishingInterceptor(org.springframework.integration.aop.PublisherMetadataSource metadataSource)
public void setDefaultChannelName(String defaultChannelName)
defaultChannelName
- the default channel name.public void setChannelResolver(DestinationResolver<MessageChannel> channelResolver)
public void setBeanFactory(BeanFactory beanFactory) throws BeansException
setBeanFactory
in interface BeanFactoryAware
BeansException
protected MessageBuilderFactory getMessageBuilderFactory()
public final Object invoke(MethodInvocation invocation) throws Throwable
invoke
in interface MethodInterceptor
Throwable