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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final record -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected final Logprotected static final StringFields inherited from interface org.springframework.integration.config.annotation.MethodAnnotationPostProcessor
INPUT_CHANNEL_ATTRIBUTE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static BeanDefinitionbuildLambdaMessageProcessor(ResolvableType beanType, AnnotatedBeanDefinition beanDefinition) protected voidcheckMessageHandlerAttributes(String handlerBeanName, List<Annotation> annotations) protected voidconfigurePollingEndpoint(AbstractPollingEndpoint pollingEndpoint, Poller poller) protected AbstractEndpointcreateEndpoint(MessageHandler handler, Method method, List<Annotation> annotations) protected BeanDefinitioncreateEndpointBeanDefinition(ComponentDefinition handlerBeanDefinition, ComponentDefinition beanDefinition, List<Annotation> annotations) protected abstract MessageHandlercreateHandler(Object bean, Method method, List<Annotation> annotations) Subclasses must implement this method to create the MessageHandler.protected AbstractEndpointdoCreateEndpoint(MessageHandler handler, MessageChannel inputChannel, List<Annotation> annotations) extractAdviceChain(String beanName, List<Annotation> annotations) protected StringgenerateHandlerBeanName(String originalBeanName, Method method) protected StringgenerateHandlerBeanName(String originalBeanName, MergedAnnotations mergedAnnotations) protected StringgenerateHandlerBeanName(String originalBeanName, MergedAnnotations mergedAnnotations, String methodName) protected ConfigurableListableBeanFactoryprotected DestinationResolver<MessageChannel> protected ConversionServiceprotected BeanDefinitionRegistrypostProcess(Object bean, String beanName, Method method, List<Annotation> annotations) voidprocessBeanDefinition(String beanName, AnnotatedBeanDefinition beanDefinition, List<Annotation> annotations) protected booleanresolveAttributeToBoolean(String attribute) protected BeanDefinitionresolveHandlerBeanDefinition(String beanName, AnnotatedBeanDefinition beanDefinition, ResolvableType handlerBeanType, List<Annotation> annotations) voidsetBeanFactory(BeanFactory beanFactory) protected static voidsetOutputChannelIfPresent(List<Annotation> annotations, AbstractMessageProducingHandler handler) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
setBeanFactoryin interfaceBeanFactoryAware- Throws:
BeansException
-
getBeanFactory
-
getDefinitionRegistry
-
getConversionService
-
getChannelResolver
-
processBeanDefinition
public void processBeanDefinition(String beanName, AnnotatedBeanDefinition beanDefinition, List<Annotation> annotations) - Specified by:
processBeanDefinitionin 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:
postProcessin 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.
-