Class AbstractMethodAnnotationPostProcessor<T extends Annotation>
java.lang.Object
org.springframework.integration.config.AbstractMethodAnnotationPostProcessor<T>
- Type Parameters:
T
- the target annotation type.
- All Implemented Interfaces:
Aware
,BeanFactoryAware
,MethodAnnotationPostProcessor<T>
- Direct Known Subclasses:
AggregatorAnnotationPostProcessor
,BridgeFromAnnotationPostProcessor
,BridgeToAnnotationPostProcessor
,FilterAnnotationPostProcessor
,InboundChannelAdapterAnnotationPostProcessor
,RouterAnnotationPostProcessor
,ServiceActivatorAnnotationPostProcessor
,SplitterAnnotationPostProcessor
,TransformerAnnotationPostProcessor
public abstract class AbstractMethodAnnotationPostProcessor<T extends Annotation>
extends Object
implements MethodAnnotationPostProcessor<T>, BeanFactoryAware
Base class for Method-level annotation post-processors.
- Author:
- Mark Fisher, Artem Bilan, Gary Russell, Chris Bono, Ngoc Nhan
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static final record
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
protected final Log
protected static final String
Fields inherited from interface org.springframework.integration.config.annotation.MethodAnnotationPostProcessor
INPUT_CHANNEL_ATTRIBUTE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static BeanDefinition
buildLambdaMessageProcessor
(ResolvableType beanType, AnnotatedBeanDefinition beanDefinition) protected void
checkMessageHandlerAttributes
(String handlerBeanName, List<Annotation> annotations) protected void
configurePollingEndpoint
(AbstractPollingEndpoint pollingEndpoint, Poller poller) protected AbstractEndpoint
createEndpoint
(MessageHandler handler, Method method, List<Annotation> annotations) protected BeanDefinition
createEndpointBeanDefinition
(ComponentDefinition handlerBeanDefinition, ComponentDefinition beanDefinition, List<Annotation> annotations) protected abstract MessageHandler
createHandler
(Object bean, Method method, List<Annotation> annotations) Subclasses must implement this method to create the MessageHandler.protected AbstractEndpoint
doCreateEndpoint
(MessageHandler handler, MessageChannel inputChannel, List<Annotation> annotations) extractAdviceChain
(String beanName, List<Annotation> annotations) protected String
generateHandlerBeanName
(String originalBeanName, Method method) protected String
generateHandlerBeanName
(String originalBeanName, MergedAnnotations mergedAnnotations) protected String
generateHandlerBeanName
(String originalBeanName, MergedAnnotations mergedAnnotations, String methodName) protected ConfigurableListableBeanFactory
protected DestinationResolver<MessageChannel>
protected ConversionService
protected BeanDefinitionRegistry
postProcess
(Object bean, String beanName, Method method, List<Annotation> annotations) void
processBeanDefinition
(String beanName, AnnotatedBeanDefinition beanDefinition, List<Annotation> annotations) protected boolean
resolveAttributeToBoolean
(String attribute) protected BeanDefinition
resolveHandlerBeanDefinition
(String beanName, AnnotatedBeanDefinition beanDefinition, ResolvableType handlerBeanType, List<Annotation> annotations) void
setBeanFactory
(BeanFactory beanFactory) protected static void
setOutputChannelIfPresent
(List<Annotation> annotations, AbstractMessageProducingHandler handler) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.integration.config.annotation.MethodAnnotationPostProcessor
beanAnnotationAware, getInputChannelAttribute, shouldCreateEndpoint, shouldCreateEndpoint, supportsPojoMethod
-
Field Details
-
logger
-
ADVICE_CHAIN_ATTRIBUTE
- See Also:
-
SEND_TIMEOUT_ATTRIBUTE
- See Also:
-
messageHandlerAttributes
-
annotationType
-
-
Constructor Details
-
AbstractMethodAnnotationPostProcessor
public AbstractMethodAnnotationPostProcessor()
-
-
Method Details
-
setBeanFactory
- Specified by:
setBeanFactory
in interfaceBeanFactoryAware
- Throws:
BeansException
-
getBeanFactory
-
getDefinitionRegistry
-
getConversionService
-
getChannelResolver
-
processBeanDefinition
public void processBeanDefinition(String beanName, AnnotatedBeanDefinition beanDefinition, List<Annotation> annotations) - Specified by:
processBeanDefinition
in interfaceMethodAnnotationPostProcessor<T extends Annotation>
-
createEndpointBeanDefinition
protected BeanDefinition createEndpointBeanDefinition(ComponentDefinition handlerBeanDefinition, ComponentDefinition beanDefinition, List<Annotation> annotations) -
resolveHandlerBeanDefinition
@Nullable protected BeanDefinition resolveHandlerBeanDefinition(String beanName, AnnotatedBeanDefinition beanDefinition, ResolvableType handlerBeanType, List<Annotation> annotations) -
postProcess
public Object postProcess(Object bean, String beanName, Method method, List<Annotation> annotations) - Specified by:
postProcess
in interfaceMethodAnnotationPostProcessor<T extends Annotation>
-
extractAdviceChain
-
createEndpoint
protected AbstractEndpoint createEndpoint(MessageHandler handler, Method method, List<Annotation> annotations) -
doCreateEndpoint
protected AbstractEndpoint doCreateEndpoint(MessageHandler handler, MessageChannel inputChannel, List<Annotation> annotations) -
configurePollingEndpoint
-
generateHandlerBeanName
-
generateHandlerBeanName
protected String generateHandlerBeanName(String originalBeanName, MergedAnnotations mergedAnnotations) -
generateHandlerBeanName
protected String generateHandlerBeanName(String originalBeanName, MergedAnnotations mergedAnnotations, @Nullable String methodName) -
setOutputChannelIfPresent
protected static void setOutputChannelIfPresent(List<Annotation> annotations, AbstractMessageProducingHandler handler) -
checkMessageHandlerAttributes
-
resolveAttributeToBoolean
-
buildLambdaMessageProcessor
protected static BeanDefinition buildLambdaMessageProcessor(ResolvableType beanType, AnnotatedBeanDefinition beanDefinition) -
createHandler
protected abstract MessageHandler createHandler(Object bean, Method method, List<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.
-