Search in sources :

Example 1 with HandlerMethodArgumentResolver

use of org.springframework.messaging.handler.invocation.reactive.HandlerMethodArgumentResolver in project spring-framework by spring-projects.

the class MessageMappingMessageHandler method initArgumentResolvers.

@Override
protected List<? extends HandlerMethodArgumentResolver> initArgumentResolvers() {
    List<HandlerMethodArgumentResolver> resolvers = new ArrayList<>();
    ApplicationContext context = getApplicationContext();
    ConfigurableBeanFactory beanFactory = (context instanceof ConfigurableApplicationContext ? ((ConfigurableApplicationContext) context).getBeanFactory() : null);
    // Annotation-based resolvers
    resolvers.add(new HeaderMethodArgumentResolver(this.conversionService, beanFactory));
    resolvers.add(new HeadersMethodArgumentResolver());
    resolvers.add(new DestinationVariableMethodArgumentResolver(this.conversionService));
    // Type-based...
    if (KotlinDetector.isKotlinPresent()) {
        resolvers.add(new ContinuationHandlerMethodArgumentResolver());
    }
    // Custom resolvers
    resolvers.addAll(getArgumentResolverConfigurer().getCustomResolvers());
    // Catch-all
    resolvers.add(new PayloadMethodArgumentResolver(getDecoders(), this.validator, getReactiveAdapterRegistry(), true));
    return resolvers;
}
Also used : ConfigurableBeanFactory(org.springframework.beans.factory.config.ConfigurableBeanFactory) ConfigurableApplicationContext(org.springframework.context.ConfigurableApplicationContext) ConfigurableApplicationContext(org.springframework.context.ConfigurableApplicationContext) ApplicationContext(org.springframework.context.ApplicationContext) ArrayList(java.util.ArrayList) HandlerMethodArgumentResolver(org.springframework.messaging.handler.invocation.reactive.HandlerMethodArgumentResolver)

Aggregations

ArrayList (java.util.ArrayList)1 ConfigurableBeanFactory (org.springframework.beans.factory.config.ConfigurableBeanFactory)1 ApplicationContext (org.springframework.context.ApplicationContext)1 ConfigurableApplicationContext (org.springframework.context.ConfigurableApplicationContext)1 HandlerMethodArgumentResolver (org.springframework.messaging.handler.invocation.reactive.HandlerMethodArgumentResolver)1