Migrated the following modules to parent-boot with spring-boot 2.1:

* spring-5-reactive-client
* spring-5-reactive-security
* spring-5-security
* spring-5-security-oauth
* spring-all
This commit is contained in:
geroza
2018-12-03 19:13:43 -02:00
parent baa6288375
commit b91f7e321e
8 changed files with 21 additions and 20 deletions
@@ -1,9 +1,7 @@
package com.baeldung.reactive.actuator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
@SpringBootApplication
public class Spring5ReactiveApplication{
@@ -8,8 +8,9 @@ import org.springframework.http.server.reactive.HttpHandler;
import org.springframework.http.server.reactive.ReactorHttpHandlerAdapter;
import org.springframework.web.reactive.config.EnableWebFlux;
import org.springframework.web.server.adapter.WebHttpHandlerBuilder;
import reactor.ipc.netty.NettyContext;
import reactor.ipc.netty.http.server.HttpServer;
import reactor.netty.DisposableServer;
import reactor.netty.http.server.HttpServer;
@ComponentScan(basePackages = {"com.baeldung.reactive.security"})
@EnableWebFlux
@@ -18,17 +19,19 @@ public class SpringSecurity5Application {
public static void main(String[] args) {
try (AnnotationConfigApplicationContext context =
new AnnotationConfigApplicationContext(SpringSecurity5Application.class)) {
context.getBean(NettyContext.class).onClose().block();
context.getBean(DisposableServer.class).onDispose().block();
}
}
@Bean
public NettyContext nettyContext(ApplicationContext context) {
public DisposableServer disposableServer(ApplicationContext context) {
HttpHandler handler = WebHttpHandlerBuilder.applicationContext(context)
.build();
ReactorHttpHandlerAdapter adapter = new ReactorHttpHandlerAdapter(handler);
HttpServer httpServer = HttpServer.create("localhost", 8080);
return httpServer.newHandler(adapter).block();
HttpServer httpServer = HttpServer.create();
httpServer.host("localhost");
httpServer.port(8080);
return httpServer.handle(adapter).bindNow();
}
}