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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected final org.apache.commons.logging.Log logger
messageCreator
private volatile MessageCreator messageCreator
defaultChannel
private volatile MessageChannel defaultChannel
payloadType
private volatile MessagePublishingInterceptor.PayloadType payloadType
MessagePublishingInterceptor
public MessagePublishingInterceptor()
setDefaultChannel
public void setDefaultChannel(MessageChannel defaultChannel)
setPayloadType
public void setPayloadType(MessagePublishingInterceptor.PayloadType payloadType)
setMessageCreator
public void setMessageCreator(MessageCreator messageCreator)
- Specify the
MessageCreator
to use when creating a message from the
return value Object.
- Parameters:
messageCreator
- the MessageCreator 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
sendMessage
private void sendMessage(java.lang.Object payload,
org.aopalliance.intercept.MethodInvocation invocation)
resolveChannel
protected MessageChannel resolveChannel(org.aopalliance.intercept.MethodInvocation invocation)
- Subclasses may override this method to provide custom behavior.
determinePayloadType
protected MessagePublishingInterceptor.PayloadType determinePayloadType(org.aopalliance.intercept.MethodInvocation invocation)