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

The following examples show how to use org.springframework.messaging.handler.annotation.support.HeaderMethodArgumentResolver. These examples are extracted from open source projects. 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
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
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
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 Project: spring-cloud-aws   Source File: QueueMessageHandler.java    License: 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 Project: rqueue   Source File: RqueueMessageHandler.java    License: 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;
}