Class MessagePublishingInterceptor
java.lang.Object
org.springframework.integration.aop.MessagePublishingInterceptor
- All Implemented Interfaces:
Advice
,Interceptor
,MethodInterceptor
,Aware
,BeanFactoryAware
public class MessagePublishingInterceptor
extends Object
implements MethodInterceptor, 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
- Author:
- Mark Fisher, Artem Bilan, Gary Russell
-
Constructor Summary
ConstructorDescriptionMessagePublishingInterceptor
(org.springframework.integration.aop.PublisherMetadataSource metadataSource) -
Method Summary
Modifier and TypeMethodDescriptionprotected MessageBuilderFactory
final Object
invoke
(MethodInvocation invocation) void
setBeanFactory
(BeanFactory beanFactory) void
setChannelResolver
(DestinationResolver<MessageChannel> channelResolver) void
setDefaultChannelName
(String defaultChannelName)
-
Constructor Details
-
MessagePublishingInterceptor
public MessagePublishingInterceptor(org.springframework.integration.aop.PublisherMetadataSource metadataSource)
-
-
Method Details
-
setDefaultChannelName
- Parameters:
defaultChannelName
- the default channel name.- Since:
- 4.0.3
-
setChannelResolver
-
setBeanFactory
- Specified by:
setBeanFactory
in interfaceBeanFactoryAware
- Throws:
BeansException
-
getMessageBuilderFactory
-
invoke
- Specified by:
invoke
in interfaceMethodInterceptor
- Throws:
Throwable
-