Class AbstractMethodAnnotationPostProcessor<T extends java.lang.annotation.Annotation>
java.lang.Object
org.springframework.integration.config.annotation.AbstractMethodAnnotationPostProcessor<T>
- All Implemented Interfaces:
MethodAnnotationPostProcessor<T>
- Direct Known Subclasses:
AggregatorAnnotationPostProcessor,BridgeFromAnnotationPostProcessor,BridgeToAnnotationPostProcessor,FilterAnnotationPostProcessor,InboundChannelAdapterAnnotationPostProcessor,RouterAnnotationPostProcessor,ServiceActivatorAnnotationPostProcessor,SplitterAnnotationPostProcessor,TransformerAnnotationPostProcessor
public abstract class AbstractMethodAnnotationPostProcessor<T extends java.lang.annotation.Annotation> extends java.lang.Object implements MethodAnnotationPostProcessor<T>
Base class for Method-level annotation post-processors.
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Class<T>annotationTypeprotected org.springframework.beans.factory.config.ConfigurableListableBeanFactorybeanFactoryprotected org.springframework.messaging.core.DestinationResolver<org.springframework.messaging.MessageChannel>channelResolverprotected org.springframework.core.convert.ConversionServiceconversionServiceprotected org.springframework.integration.config.annotation.Disposablesdisposablesprotected org.apache.commons.logging.Logloggerprotected java.util.List<java.lang.String>messageHandlerAttributesprotected static java.lang.StringSEND_TIMEOUT_ATTRIBUTE -
Constructor Summary
Constructors Constructor Description AbstractMethodAnnotationPostProcessor(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory) -
Method Summary
Modifier and Type Method Description protected booleanbeanAnnotationAware()protected MessageProcessor<?>buildLambdaMessageProcessorForBeanMethod(java.lang.reflect.Method method, java.lang.Object target)protected voidcheckMessageHandlerAttributes(java.lang.String handlerBeanName, java.util.List<java.lang.annotation.Annotation> annotations)protected voidconfigurePollingEndpoint(AbstractPollingEndpoint pollingEndpoint, java.util.List<java.lang.annotation.Annotation> annotations)protected AbstractEndpointcreateEndpoint(org.springframework.messaging.MessageHandler handler, java.lang.reflect.Method method, java.util.List<java.lang.annotation.Annotation> annotations)protected abstract org.springframework.messaging.MessageHandlercreateHandler(java.lang.Object bean, java.lang.reflect.Method method, java.util.List<java.lang.annotation.Annotation> annotations)Subclasses must implement this method to create the MessageHandler.protected AbstractEndpointdoCreateEndpoint(org.springframework.messaging.MessageHandler handler, org.springframework.messaging.MessageChannel inputChannel, java.util.List<java.lang.annotation.Annotation> annotations)protected java.util.List<org.aopalliance.aop.Advice>extractAdviceChain(java.lang.String beanName, java.util.List<java.lang.annotation.Annotation> annotations)protected <H> HextractTypeIfPossible(java.lang.Object targetObject, java.lang.Class<H> expectedType)protected java.lang.StringgenerateHandlerBeanName(java.lang.String originalBeanName, java.lang.reflect.Method method)protected java.lang.StringgetInputChannelAttribute()java.lang.ObjectpostProcess(java.lang.Object bean, java.lang.String beanName, java.lang.reflect.Method method, java.util.List<java.lang.annotation.Annotation> annotations)protected booleanresolveAttributeToBoolean(java.lang.String attribute)protected java.lang.ObjectresolveTargetBeanFromMethodWithBeanAnnotation(java.lang.reflect.Method method)protected java.lang.StringresolveTargetBeanName(java.lang.reflect.Method method)protected voidsetOutputChannelIfPresent(java.util.List<java.lang.annotation.Annotation> annotations, AbstractReplyProducingMessageHandler handler)booleanshouldCreateEndpoint(java.lang.reflect.Method method, java.util.List<java.lang.annotation.Annotation> annotations)
-
Field Details
-
SEND_TIMEOUT_ATTRIBUTE
protected static final java.lang.String SEND_TIMEOUT_ATTRIBUTE- See Also:
- Constant Field Values
-
logger
protected final org.apache.commons.logging.Log logger -
messageHandlerAttributes
protected final java.util.List<java.lang.String> messageHandlerAttributes -
beanFactory
protected final org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory -
conversionService
protected final org.springframework.core.convert.ConversionService conversionService -
channelResolver
protected final org.springframework.messaging.core.DestinationResolver<org.springframework.messaging.MessageChannel> channelResolver -
annotationType
-
disposables
protected final org.springframework.integration.config.annotation.Disposables disposables
-
-
Constructor Details
-
AbstractMethodAnnotationPostProcessor
public AbstractMethodAnnotationPostProcessor(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
-
-
Method Details
-
postProcess
public java.lang.Object postProcess(java.lang.Object bean, java.lang.String beanName, java.lang.reflect.Method method, java.util.List<java.lang.annotation.Annotation> annotations)- Specified by:
postProcessin interfaceMethodAnnotationPostProcessor<T extends java.lang.annotation.Annotation>
-
shouldCreateEndpoint
public boolean shouldCreateEndpoint(java.lang.reflect.Method method, java.util.List<java.lang.annotation.Annotation> annotations)Description copied from interface:MethodAnnotationPostProcessor- Specified by:
shouldCreateEndpointin interfaceMethodAnnotationPostProcessor<T extends java.lang.annotation.Annotation>- Parameters:
method- the method to check if it is eligible to create an Endpointannotations- the List of annotations to process- Returns:
- the
booleanflag to determine whether or not to create anAbstractEndpoint
-
getInputChannelAttribute
protected java.lang.String getInputChannelAttribute() -
beanAnnotationAware
protected boolean beanAnnotationAware() -
extractAdviceChain
protected java.util.List<org.aopalliance.aop.Advice> extractAdviceChain(java.lang.String beanName, java.util.List<java.lang.annotation.Annotation> annotations) -
createEndpoint
protected AbstractEndpoint createEndpoint(org.springframework.messaging.MessageHandler handler, java.lang.reflect.Method method, java.util.List<java.lang.annotation.Annotation> annotations) -
doCreateEndpoint
protected AbstractEndpoint doCreateEndpoint(org.springframework.messaging.MessageHandler handler, org.springframework.messaging.MessageChannel inputChannel, java.util.List<java.lang.annotation.Annotation> annotations) -
configurePollingEndpoint
protected void configurePollingEndpoint(AbstractPollingEndpoint pollingEndpoint, java.util.List<java.lang.annotation.Annotation> annotations) -
generateHandlerBeanName
protected java.lang.String generateHandlerBeanName(java.lang.String originalBeanName, java.lang.reflect.Method method) -
setOutputChannelIfPresent
protected void setOutputChannelIfPresent(java.util.List<java.lang.annotation.Annotation> annotations, AbstractReplyProducingMessageHandler handler) -
resolveTargetBeanFromMethodWithBeanAnnotation
protected java.lang.Object resolveTargetBeanFromMethodWithBeanAnnotation(java.lang.reflect.Method method) -
resolveTargetBeanName
protected java.lang.String resolveTargetBeanName(java.lang.reflect.Method method) -
extractTypeIfPossible
protected <H> H extractTypeIfPossible(@Nullable java.lang.Object targetObject, java.lang.Class<H> expectedType) -
checkMessageHandlerAttributes
protected void checkMessageHandlerAttributes(java.lang.String handlerBeanName, java.util.List<java.lang.annotation.Annotation> annotations) -
resolveAttributeToBoolean
protected boolean resolveAttributeToBoolean(java.lang.String attribute) -
buildLambdaMessageProcessorForBeanMethod
@Nullable protected MessageProcessor<?> buildLambdaMessageProcessorForBeanMethod(java.lang.reflect.Method method, java.lang.Object target) -
createHandler
protected abstract org.springframework.messaging.MessageHandler createHandler(java.lang.Object bean, java.lang.reflect.Method method, java.util.List<java.lang.annotation.Annotation> annotations)Subclasses must implement this method to create the MessageHandler.- Parameters:
bean- The bean.method- The method.annotations- The messaging annotation (or meta-annotation hierarchy) on the method.- Returns:
- The MessageHandler.
-