public VertxServer start(Handler<AsyncResult<Void>> completionHandler) { if (id.port > 0) { actual = map.computeIfAbsent(id, id -> new ActualServer(context.owner(), id, options, builder)); } else { actual = new ActualServer(context.owner(), id, options, builder); } actual.start(context, ar1 -> { if (ar1.succeeded()) { hook = ar2 -> shutdown(); context.addCloseHook(hook); } completionHandler.handle(ar1); }); return this; }
public VertxServer shutdown(Handler<AsyncResult<Void>> completionHandler) { if (hook != null) { context.removeCloseHook(hook); } actual.stop(context, completionHandler); return this; }