org.springframework.integration.aop
Class AnnotationAwareMessagePublishingInterceptor

java.lang.Object
  extended by org.springframework.integration.aop.MessagePublishingInterceptor
      extended by org.springframework.integration.aop.AnnotationAwareMessagePublishingInterceptor
All Implemented Interfaces:
org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor

public class AnnotationAwareMessagePublishingInterceptor
extends MessagePublishingInterceptor

MessagePublishingInterceptor that resolves the channel from the publisher annotation of the invoked method.

Author:
Mark Fisher

Nested Class Summary
 
Nested classes/interfaces inherited from class org.springframework.integration.aop.MessagePublishingInterceptor
MessagePublishingInterceptor.PayloadType
 
Field Summary
private  java.lang.String channelAttributeName
           
private  ChannelRegistry channelRegistry
           
private  java.lang.Class<? extends java.lang.annotation.Annotation> publisherAnnotationType
           
 
Fields inherited from class org.springframework.integration.aop.MessagePublishingInterceptor
logger
 
Constructor Summary
AnnotationAwareMessagePublishingInterceptor(java.lang.Class<? extends java.lang.annotation.Annotation> publisherAnnotationType, java.lang.String channelAttributeName, ChannelRegistry channelRegistry)
           
 
Method Summary
protected  MessagePublishingInterceptor.PayloadType determinePayloadType(org.aopalliance.intercept.MethodInvocation invocation)
           
private
<T> T
extractAnnotationValue(org.aopalliance.intercept.MethodInvocation invocation, java.lang.String attributeName, java.lang.Class<T> type)
           
protected  MessageChannel resolveChannel(org.aopalliance.intercept.MethodInvocation invocation)
          Subclasses may override this method to provide custom behavior.
 
Methods inherited from class org.springframework.integration.aop.MessagePublishingInterceptor
invoke, setDefaultChannel, setMessageCreator, setPayloadType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

publisherAnnotationType

private java.lang.Class<? extends java.lang.annotation.Annotation> publisherAnnotationType

channelAttributeName

private java.lang.String channelAttributeName

channelRegistry

private ChannelRegistry channelRegistry
Constructor Detail

AnnotationAwareMessagePublishingInterceptor

public AnnotationAwareMessagePublishingInterceptor(java.lang.Class<? extends java.lang.annotation.Annotation> publisherAnnotationType,
                                                   java.lang.String channelAttributeName,
                                                   ChannelRegistry channelRegistry)
Method Detail

resolveChannel

protected MessageChannel resolveChannel(org.aopalliance.intercept.MethodInvocation invocation)
Description copied from class: MessagePublishingInterceptor
Subclasses may override this method to provide custom behavior.

Overrides:
resolveChannel in class MessagePublishingInterceptor

determinePayloadType

protected MessagePublishingInterceptor.PayloadType determinePayloadType(org.aopalliance.intercept.MethodInvocation invocation)
Overrides:
determinePayloadType in class MessagePublishingInterceptor

extractAnnotationValue

private <T> T extractAnnotationValue(org.aopalliance.intercept.MethodInvocation invocation,
                                     java.lang.String attributeName,
                                     java.lang.Class<T> type)