verticle.init(vertx, context); Future<Void> startFuture = Future.future(); verticle.start(startFuture); startFuture.setHandler(ar -> { if (ar.succeeded()) {
/** * Override this method to signify that start is complete sometime _after_ the start() method has returned * This is useful if your verticle deploys other verticles or modules and you don't want this verticle to * be considered started until the other modules and verticles have been started. * * @param startedResult When you are happy your verticle is started set the result * @throws Exception */ @Override public void start(Future<Void> startedResult) throws Exception { // Start the real verticle realVerticle.start(startedResult); }
/** * Override this method to signify that start is complete sometime _after_ the start() method has returned * This is useful if your verticle deploys other verticles or modules and you don't want this verticle to * be considered started until the other modules and verticles have been started. * * @param startedResult When you are happy your verticle is started set the result * @throws Exception */ @Override public void start(Future<Void> startedResult) throws Exception { // Start the real verticle realVerticle.start(startedResult); }
/** * Override this method to signify that start is complete sometime _after_ the start() method has returned * This is useful if your verticle deploys other verticles or modules and you don't want this verticle to * be considered started until the other modules and verticles have been started. * * @param startedResult When you are happy your verticle is started set the result * @throws Exception */ @Override public void start(Future<Void> startedResult) throws Exception { // Start the real verticle realVerticle.start(startedResult); }
verticle.init(vertx, context); Future<Void> startFuture = Future.future(); verticle.start(startFuture); startFuture.setHandler(ar -> { if (ar.succeeded()) {
@DocAnnotation$annotation$(description = " When you add a new route with a regular expression, you can add named capture groups for parameters. <br/>\n However, if you need more complex parameters names (like \"param_name\"), you can add parameters names with\n this function. You have to name capture groups in regex with names: \"p0\", \"p1\", \"p2\", ... <br/>\n <br/>\n For example: If you declare route with regex \\/(?<p0>[a-z]*)\\/(?<p1>[a-z]*) and group names ") @Override public void start(Future<Void> startFuture) throws Exception { ClassLoader loader = module.runner.getModuleClassLoader(); Method introspector = loader.loadClass("io.vertx.ceylon.core.impl.resolveVerticles_").getDeclaredMethod("resolveVerticles", String.class, String.class); Map<String, Callable<?>> moduleFactories = (Map<String, Callable<?>>) introspector.invoke(null, module.name, null); Callable<?> factory = moduleFactories.values().iterator().next(); verticle = (Verticle) factory.call(); verticle.init(vertx, context); verticle.start(startFuture); }
@Override public void start(Future<Void> startFuture) throws Exception { // compile TypeScript source when verticle is started delegateVerticle.getVertx().executeBlocking((Future<Void> future) -> { // create a new class loader that automatically compiles sources ClassLoader cl = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(new TypeScriptClassLoader( cl, getTypeScriptCompiler(), CACHE)); // start the JavaScript verticle. this will trigger loading and compiling. try { delegateVerticle.start(future); } catch (Exception e) { future.fail(e); } finally { Thread.currentThread().setContextClassLoader(cl); } }, res -> { if (res.succeeded()) { startFuture.complete(); } else { startFuture.fail(res.cause()); } }); }