org.springframework.web.reactive.HandlerAdapter Java Examples

The following examples show how to use org.springframework.web.reactive.HandlerAdapter. 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: WebTestClientBuilder.java    From spring-security-reactive with Apache License 2.0 5 votes vote down vote up
private static ApplicationContext applicationContext(WebFilter... webFilters) {
	AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
	for(WebFilter filter : webFilters) {
		context.registerBean(WebFilter.class, () -> filter);
	}
	context.registerBean("webHandler", DispatcherHandler.class, () -> new DispatcherHandler());
	context.registerBean(HandlerMapping.class, () -> RouterFunctions.toHandlerMapping(request -> Mono.just(r -> ServerResponse.ok().build())));
	context.registerBean(HandlerAdapter.class, () -> new HandlerFunctionAdapter());
	context.registerBean(HandlerResultHandler.class, () -> new ServerResponseResultHandler());
	context.refresh();

	return context;
}
 
Example #2
Source File: WebSocketConfiguration.java    From Hands-On-Reactive-Programming-in-Spring-5 with MIT License 4 votes vote down vote up
@Bean
public HandlerAdapter handlerAdapter() {
    return new WebSocketHandlerAdapter();
}