@Test public void initializationTest(TestContext ctx) { ModuleOne m1 = new ModuleOne(); m1.setConfig(new JsonObject()); initializer.initialize(m1).setHandler(ar -> { ctx.assertTrue(ar.succeeded()); SharedData sd = Environment.my(SharedData.class); sd.getCounter("c1", c -> { c.result().get(ar1 -> { ctx.assertEquals(2l, ar1.result()); }); }); }); }
public Future<Void> initialize(Modularized modularized) { if (log.isDebugEnabled()) { log.debug("Initialize Auto Configuration for {}", modularized.getClass().getName()); } Future<Void> initFuture = Future.future(); if (modularized == null || !modularized.getClass().isAnnotationPresent(Modules.class)) { initFuture.complete(); return initFuture; } final JsonObject config = new JsonObject(); config.mergeIn(modularized.getConfig()); if (log.isInfoEnabled() && modularized.getClass().isAnnotationPresent(PrintConfig.class)) { log.info("Config: {}", modularized.getConfig()); } if (moduleHasClasspathScan(modularized)) { lookupToClasspathScanner(modularized); } final List<Supplier<Future>> futures = new ArrayList<>(); try { lookupModules(futures, modularized); } catch (Throwable e) { return Future.failedFuture(e); } ReduceFuture.create(futures).reduce().setHandler(ar -> { if (ar.succeeded()) { initFuture.complete(); } else { initFuture.fail(ar.cause()); } }); return initFuture; }
ModuleInitializer extends MySupport { public Future<Void> initialize(Modularized modularized) { if (log.isDebugEnabled()) { log.debug("Initialize Auto Configuration for {}", modularized.getClass().getName()); } Future<Void> initFuture = Future.future(); if (modularized == null || !modularized.getClass().isAnnotationPresent(Modules.class)) { initFuture.complete(); return initFuture; } final JsonObject config = new JsonObject(); config.mergeIn(modularized.getConfig()); if (log.isInfoEnabled() && modularized.getClass().isAnnotationPresent(PrintConfig.class)) { log.info("Config: {}", modularized.getConfig()); } if (moduleHasClasspathScan(modularized)) { lookupToClasspathScanner(modularized); } final List<Supplier<Future>> futures = new ArrayList<>(); try { lookupModules(futures, modularized); } catch (Throwable e) { return Future.failedFuture(e); } ReduceFuture.create(futures).reduce().setHandler(ar -> { if (ar.succeeded()) { initFuture.complete(); } else { initFuture.fail(ar.cause()); } }); return initFuture; } }
ModuleInitializer extends MySupport { public Future<Void> initialize(Modularized modularized) { if (log.isDebugEnabled()) { log.debug("Initialize Auto Configuration for {}", modularized.getClass().getName()); } Future<Void> initFuture = Future.future(); if (modularized == null || !modularized.getClass().isAnnotationPresent(Modules.class)) { initFuture.complete(); return initFuture; } final JsonObject config = new JsonObject(); config.mergeIn(modularized.getConfig()); if (log.isInfoEnabled() && modularized.getClass().isAnnotationPresent(PrintConfig.class)) { log.info("Config: {}", modularized.getConfig()); } if (moduleHasClasspathScan(modularized)) { lookupToClasspathScanner(modularized); } final List<Supplier<Future>> futures = new ArrayList<>(); try { lookupModules(futures, modularized); } catch (Throwable e) { return Future.failedFuture(e); } ReduceFuture.create(futures).reduce().setHandler(ar -> { if (ar.succeeded()) { initFuture.complete(); } else { initFuture.fail(ar.cause()); } }); return initFuture; } ModuleInitializer(); }
ModuleInitializer extends MySupport { public Future<Void> initialize(Modularized modularized) { if (log.isDebugEnabled()) { log.debug("Initialize Auto Configuration for {}", modularized.getClass().getName()); } Future<Void> initFuture = Future.future(); if (modularized == null || !modularized.getClass().isAnnotationPresent(Modules.class)) { initFuture.complete(); return initFuture; } final JsonObject config = new JsonObject(); config.mergeIn(modularized.getConfig()); if (log.isInfoEnabled() && modularized.getClass().isAnnotationPresent(PrintConfig.class)) { log.info("Config: {}", modularized.getConfig()); } if (moduleHasClasspathScan(modularized)) { lookupToClasspathScanner(modularized); } final List<Supplier<Future>> futures = new ArrayList<>(); try { lookupModules(futures, modularized); } catch (Throwable e) { return Future.failedFuture(e); } ReduceFuture.create(futures).reduce().setHandler(ar -> { if (ar.succeeded()) { initFuture.complete(); } else { initFuture.fail(ar.cause()); } }); return initFuture; } ModuleInitializer(); Future<Void> initialize(Modularized modularized); }
ModuleInitializer extends MySupport { public Future<Void> initialize(Modularized modularized) { if (log.isDebugEnabled()) { log.debug("Initialize Auto Configuration for {}", modularized.getClass().getName()); } Future<Void> initFuture = Future.future(); if (modularized == null || !modularized.getClass().isAnnotationPresent(Modules.class)) { initFuture.complete(); return initFuture; } final JsonObject config = new JsonObject(); config.mergeIn(modularized.getConfig()); if (log.isInfoEnabled() && modularized.getClass().isAnnotationPresent(PrintConfig.class)) { log.info("Config: {}", modularized.getConfig()); } if (moduleHasClasspathScan(modularized)) { lookupToClasspathScanner(modularized); } final List<Supplier<Future>> futures = new ArrayList<>(); try { lookupModules(futures, modularized); } catch (Throwable e) { return Future.failedFuture(e); } ReduceFuture.create(futures).reduce().setHandler(ar -> { if (ar.succeeded()) { initFuture.complete(); } else { initFuture.fail(ar.cause()); } }); return initFuture; } ModuleInitializer(); Future<Void> initialize(Modularized modularized);  }