Class AbstractMethodAnnotationPostProcessor<T extends java.lang.annotation.Annotation>
java.lang.Object
org.springframework.integration.config.annotation.AbstractMethodAnnotationPostProcessor<T>
- Type Parameters:
T
- the target annotation type.
- 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>
annotationType
protected org.springframework.beans.factory.config.ConfigurableListableBeanFactory
beanFactory
protected org.springframework.messaging.core.DestinationResolver<org.springframework.messaging.MessageChannel>
channelResolver
protected org.springframework.core.convert.ConversionService
conversionService
protected org.springframework.beans.factory.support.BeanDefinitionRegistry
definitionRegistry
protected org.apache.commons.logging.Log
logger
protected java.util.List<java.lang.String>
messageHandlerAttributes
protected static java.lang.String
SEND_TIMEOUT_ATTRIBUTE
-
Constructor Summary
Constructors Constructor Description AbstractMethodAnnotationPostProcessor(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
-
Method Summary
Modifier and Type Method Description protected boolean
beanAnnotationAware()
protected MessageProcessor<?>
buildLambdaMessageProcessorForBeanMethod(java.lang.reflect.Method method, java.lang.Object target)
protected void
checkMessageHandlerAttributes(java.lang.String handlerBeanName, java.util.List<java.lang.annotation.Annotation> annotations)
protected void
configurePollingEndpoint(AbstractPollingEndpoint pollingEndpoint, Poller[] pollers)
protected AbstractEndpoint
createEndpoint(org.springframework.messaging.MessageHandler handler, java.lang.reflect.Method method, java.util.List<java.lang.annotation.Annotation> annotations)
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.protected AbstractEndpoint
doCreateEndpoint(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> H
extractTypeIfPossible(java.lang.Object targetObject, java.lang.Class<H> expectedType)
protected java.lang.String
generateHandlerBeanName(java.lang.String originalBeanName, java.lang.reflect.Method method)
protected java.lang.String
getInputChannelAttribute()
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)
protected boolean
resolveAttributeToBoolean(java.lang.String attribute)
protected java.lang.Object
resolveTargetBeanFromMethodWithBeanAnnotation(java.lang.reflect.Method method)
protected java.lang.String
resolveTargetBeanName(java.lang.reflect.Method method)
protected void
setOutputChannelIfPresent(java.util.List<java.lang.annotation.Annotation> annotations, AbstractReplyProducingMessageHandler handler)
boolean
shouldCreateEndpoint(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 -
definitionRegistry
protected final org.springframework.beans.factory.support.BeanDefinitionRegistry definitionRegistry -
conversionService
protected final org.springframework.core.convert.ConversionService conversionService -
channelResolver
protected final org.springframework.messaging.core.DestinationResolver<org.springframework.messaging.MessageChannel> channelResolver -
annotationType
-
-
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:
postProcess
in 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:
shouldCreateEndpoint
in 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
boolean
flag to determine whether 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
-
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.
-