/** * Called to start the service * @param whenDone */ public void start(Handler<AsyncResult<Void>> whenDone) { this.delegate.start(whenDone); }
@Override public void start(Future<Void> startFuture) throws Exception { final JsonObject conf = config(); final CountDownLatch cdl = new CountDownLatch(1); final Handler<AsyncResult<Void>> simpleEndHandler = res -> { cdl.countDown(); if (res.failed()) { startFuture.fail(res.cause()); } else { if (cdl.getCount() == 0 && !startFuture.isComplete()) { startFuture.complete(); } } }; // Create the service object final String address = conf.getString("address"); if (address == null) { throw new IllegalStateException("address field must be specified in config for service verticle"); } service = createService(vertx, conf); ProxyHelper.registerService(AsyncSqlService.class, vertx, service, address); service.start(simpleEndHandler); }
service.start(createHandler(msg)); break;