1818 */
1919public class Server {
2020
21- private int mPort ;
22- private String mHost ;
2321 private Vertx mVertx ;
2422 private String [] mRouterBuilder ;
2523 private String [] mMountPath ;
2624 private Router [] mRouter ;
2725 private Logger mLog ;
2826 private SockJSHandler mSockJSHandler ;
27+ private HttpServerOptions mHttpServerOptions ;
2928
3029 @ StartService
3130 public void start () {
3231
33- HttpServer server = getVertx ().createHttpServer (new HttpServerOptions (). setPort ( getPort ()). setHost ( getHost () ));
32+ HttpServer server = getVertx ().createHttpServer (getHttpServerOptions ( ));
3433
3534 Router router = Router .router (getVertx ());
3635
@@ -52,7 +51,7 @@ public void start() {
5251 .rxListen ()
5352 .blockingGet ();
5453
55- getLog ().debug (() -> String .format ("---------------Server[%s:%s] is ready-----------------" , getHost (), getPort ()));
54+ getLog ().debug (() -> String .format ("---------------Server[%s:%s] is ready-----------------" , getHttpServerOptions (). getHost (), getHttpServerOptions (). getPort ()));
5655 }
5756
5857 public Vertx getVertx () {
@@ -63,22 +62,6 @@ public void setVertx(Vertx pVertx) {
6362 this .mVertx = pVertx ;
6463 }
6564
66- public int getPort () {
67- return mPort ;
68- }
69-
70- public void setPort (int pPort ) {
71- this .mPort = pPort ;
72- }
73-
74- public String getHost () {
75- return mHost ;
76- }
77-
78- public void setHost (String pHost ) {
79- this .mHost = pHost ;
80- }
81-
8265 public String [] getRouterBuilder () {
8366 return mRouterBuilder ;
8467 }
@@ -115,4 +98,12 @@ public void setSockJSHandler(SockJSHandler pSockJSHandler) {
11598 this .mSockJSHandler = pSockJSHandler ;
11699 }
117100
101+ public HttpServerOptions getHttpServerOptions () {
102+ return mHttpServerOptions ;
103+ }
104+
105+ public void setHttpServerOptions (HttpServerOptions pHttpServerOptions ) {
106+ this .mHttpServerOptions = pHttpServerOptions ;
107+ }
108+
118109}
0 commit comments