diff options
author | Dan Timoney <dtimoney@att.com> | 2019-03-27 19:55:18 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-03-27 19:55:18 +0000 |
commit | bfd52ebfec9674b424d8e64f2891283993427d70 (patch) | |
tree | 68026902281f0be94430fa5ed8b6ddc244cbade1 /ms/blueprintsprocessor | |
parent | 28153002ca2548bf3e67b3bdf8d9e2efde5f89a6 (diff) | |
parent | 5f7f21b2bbf8a6506ac2c0afa94e15f22c83d201 (diff) |
Merge "Do not start 2 netty server"
Diffstat (limited to 'ms/blueprintsprocessor')
-rw-r--r-- | ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintHttpServer.java | 33 |
1 files changed, 6 insertions, 27 deletions
diff --git a/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintHttpServer.java b/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintHttpServer.java index ae75488c1..85ccd1f43 100644 --- a/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintHttpServer.java +++ b/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintHttpServer.java @@ -16,40 +16,19 @@ package org.onap.ccsdk.cds.blueprintsprocessor; -import javax.annotation.PostConstruct; -import javax.annotation.PreDestroy; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.web.embedded.netty.NettyReactiveWebServerFactory; -import org.springframework.boot.web.reactive.server.ReactiveWebServerFactory; -import org.springframework.boot.web.server.WebServer; -import org.springframework.http.server.reactive.HttpHandler; +import org.springframework.boot.web.server.WebServerFactoryCustomizer; import org.springframework.stereotype.Component; @Component -public class BlueprintHttpServer { - - private static Logger log = LoggerFactory.getLogger(BlueprintHttpServer.class); +public class BlueprintHttpServer implements WebServerFactoryCustomizer<NettyReactiveWebServerFactory> { @Value("${blueprintsprocessor.httpPort}") private Integer httpPort; - @Autowired - HttpHandler httpHandler; - - WebServer http; - - @PostConstruct - public void start() { - ReactiveWebServerFactory factory = new NettyReactiveWebServerFactory(httpPort); - this.http = factory.getWebServer(this.httpHandler); - this.http.start(); - } - - @PreDestroy - public void stop() { - this.http.stop(); + @Override + public void customize(NettyReactiveWebServerFactory serverFactory) { + serverFactory.setPort(httpPort); } -} +}
\ No newline at end of file |