org.springframework.messaging.handler.annotation.support.HeaderMethodArgumentResolver Java Examples

The following examples show how to use org.springframework.messaging.handler.annotation.support.HeaderMethodArgumentResolver. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SimpAnnotationMethodMessageHandler.java    From spring-analysis-note with MIT License 6 votes vote down vote up
protected List<HandlerMethodArgumentResolver> initArgumentResolvers() {
	ApplicationContext context = getApplicationContext();
	ConfigurableBeanFactory beanFactory = (context instanceof ConfigurableApplicationContext ?
			((ConfigurableApplicationContext) context).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 PayloadMethodArgumentResolver(this.messageConverter, this.validator));

	return resolvers;
}
 
Example #2
Source File: SimpAnnotationMethodMessageHandler.java    From java-technology-stack with MIT License 6 votes vote down vote up
protected List<HandlerMethodArgumentResolver> initArgumentResolvers() {
	ApplicationContext context = getApplicationContext();
	ConfigurableBeanFactory beanFactory = (context instanceof ConfigurableApplicationContext ?
			((ConfigurableApplicationContext) context).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;
}
 
Example #3
Source File: SimpAnnotationMethodMessageHandler.java    From spring4-understanding with Apache License 2.0 6 votes vote down vote up
protected List<HandlerMethodArgumentResolver> initArgumentResolvers() {
	ConfigurableBeanFactory beanFactory = (getApplicationContext() instanceof ConfigurableApplicationContext ?
			((ConfigurableApplicationContext) getApplicationContext()).getBeanFactory() : null);

	List<HandlerMethodArgumentResolver> resolvers = new ArrayList<HandlerMethodArgumentResolver>();

	// 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());

	resolvers.addAll(getCustomArgumentResolvers());
	resolvers.add(new PayloadArgumentResolver(this.messageConverter, this.validator));

	return resolvers;
}
 
Example #4
Source File: QueueMessageHandler.java    From spring-cloud-aws with Apache License 2.0 6 votes vote down vote up
@Override
protected List<? extends HandlerMethodArgumentResolver> initArgumentResolvers() {
	List<HandlerMethodArgumentResolver> resolvers = new ArrayList<>(
			getCustomArgumentResolvers());

	resolvers.add(new HeaderMethodArgumentResolver(null, null));
	resolvers.add(new SqsHeadersMethodArgumentResolver());

	resolvers.add(new NotificationSubjectArgumentResolver());
	resolvers.add(new AcknowledgmentHandlerMethodArgumentResolver(ACKNOWLEDGMENT));
	resolvers.add(new VisibilityHandlerMethodArgumentResolver(VISIBILITY));

	CompositeMessageConverter compositeMessageConverter = createPayloadArgumentCompositeConverter();
	resolvers.add(new NotificationMessageArgumentResolver(compositeMessageConverter));
	resolvers.add(new MessageMethodArgumentResolver(
			this.messageConverters.isEmpty() ? new StringMessageConverter()
					: new CompositeMessageConverter(this.messageConverters)));
	resolvers.add(new PayloadArgumentResolver(compositeMessageConverter,
			new NoOpValidator()));

	return resolvers;
}
 
Example #5
Source File: RqueueMessageHandler.java    From rqueue with Apache License 2.0 5 votes vote down vote up
@Override
protected List<? extends HandlerMethodArgumentResolver> initArgumentResolvers() {
  List<HandlerMethodArgumentResolver> resolvers = new ArrayList<>(getCustomArgumentResolvers());
  // Annotation-based argument resolution
  resolvers.add(new HeaderMethodArgumentResolver(this.conversionService, getBeanFactory()));
  resolvers.add(new HeadersMethodArgumentResolver());

  // Type-based argument resolution
  resolvers.add(new PrincipalMethodArgumentResolver());
  resolvers.add(new MessageMethodArgumentResolver(messageConverter));
  resolvers.add(new PayloadArgumentResolver(messageConverter, null));

  return resolvers;
}