Search in sources :

Example 1 with HeaderMethodArgumentResolver

use of org.springframework.messaging.handler.annotation.support.HeaderMethodArgumentResolver in project spring-framework by spring-projects.

the class SimpAnnotationMethodMessageHandler method initArgumentResolvers.

protected List<HandlerMethodArgumentResolver> initArgumentResolvers() {
    ConfigurableBeanFactory beanFactory = (getApplicationContext() instanceof ConfigurableApplicationContext ? ((ConfigurableApplicationContext) getApplicationContext()).getBeanFactory() : null);
    List<HandlerMethodArgumentResolver> resolvers = new ArrayList<>();
    // Annotation-based argument resolution
    resolvers.add(new HeaderMethodArgumentResolver(this.conversionService, beanFactory));
    resolvers.add(new HeadersMethodArgumentResolver());
    resolvers.add(new DestinationVariableMethodArgumentResolver(this.conversionService));
    // Type-based argument resolution
    resolvers.add(new PrincipalMethodArgumentResolver());
    resolvers.add(new MessageMethodArgumentResolver(this.messageConverter));
    resolvers.addAll(getCustomArgumentResolvers());
    resolvers.add(new PayloadArgumentResolver(this.messageConverter, this.validator));
    return resolvers;
}
Also used : ConfigurableBeanFactory(org.springframework.beans.factory.config.ConfigurableBeanFactory) ConfigurableApplicationContext(org.springframework.context.ConfigurableApplicationContext) HeadersMethodArgumentResolver(org.springframework.messaging.handler.annotation.support.HeadersMethodArgumentResolver) ArrayList(java.util.ArrayList) HeaderMethodArgumentResolver(org.springframework.messaging.handler.annotation.support.HeaderMethodArgumentResolver) MessageMethodArgumentResolver(org.springframework.messaging.handler.annotation.support.MessageMethodArgumentResolver) HandlerMethodArgumentResolver(org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver) PayloadArgumentResolver(org.springframework.messaging.handler.annotation.support.PayloadArgumentResolver) DestinationVariableMethodArgumentResolver(org.springframework.messaging.handler.annotation.support.DestinationVariableMethodArgumentResolver)

Aggregations

ArrayList (java.util.ArrayList)1 ConfigurableBeanFactory (org.springframework.beans.factory.config.ConfigurableBeanFactory)1 ConfigurableApplicationContext (org.springframework.context.ConfigurableApplicationContext)1 DestinationVariableMethodArgumentResolver (org.springframework.messaging.handler.annotation.support.DestinationVariableMethodArgumentResolver)1 HeaderMethodArgumentResolver (org.springframework.messaging.handler.annotation.support.HeaderMethodArgumentResolver)1 HeadersMethodArgumentResolver (org.springframework.messaging.handler.annotation.support.HeadersMethodArgumentResolver)1 MessageMethodArgumentResolver (org.springframework.messaging.handler.annotation.support.MessageMethodArgumentResolver)1 PayloadArgumentResolver (org.springframework.messaging.handler.annotation.support.PayloadArgumentResolver)1 HandlerMethodArgumentResolver (org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver)1