org.springframework.integration.aop
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
- Direct Known Subclasses:
- AnnotationAwareMessagePublishingInterceptor
public class MessagePublishingInterceptor
- extends java.lang.Object
- implements org.aopalliance.intercept.MethodInterceptor
Interceptor that publishes a target method's return value to a channel.
- Author:
- Mark Fisher
Field Summary |
protected org.apache.commons.logging.Log |
logger
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected org.apache.commons.logging.Log logger
MessagePublishingInterceptor
public MessagePublishingInterceptor()
setDefaultChannel
public void setDefaultChannel(MessageChannel defaultChannel)
setMessageMapper
public void setMessageMapper(MessageMapper mapper)
- Specify the
MessageMapper
to use when creating a message from the
return value Object. The default is a SimplePayloadMessageMapper
.
- Parameters:
mapper
- the mapper to use
invoke
public java.lang.Object invoke(org.aopalliance.intercept.MethodInvocation invocation)
throws java.lang.Throwable
- Invoke the target method and publish its return value.
- Specified by:
invoke
in interface org.aopalliance.intercept.MethodInterceptor
- Throws:
java.lang.Throwable
resolveChannel
protected MessageChannel resolveChannel(org.aopalliance.intercept.MethodInvocation invocation)
- Subclasses may override this method to provide custom behavior.