/** * The main build method that creates and returns a {@link BQRuntime}. * * @return a new instance of {@link BQRuntime} configured in this builder. */ public BQRuntime createRuntime() { BQRuntime runtime = bootique.createRuntime(); runtimes.add(runtime); return runtime; }
/** * Creates runtime without starting it. Can be started via {@link BQDaemonTestFactory#start(BQRuntime)}. * * @return newly created managed runtime. * @since 0.23 */ public BQRuntime createRuntime() { BQRuntime runtime = bootique.createRuntime(); // wrap in BQRuntimeDaemon to handle thread pool shutdown and startup checks. BQRuntimeDaemon testRuntime = new BQRuntimeDaemon(runtime, startupCheck, startupTimeout, startupTimeoutTimeUnit); runtimes.put(runtime, testRuntime); return runtime; }
/** * Creates and returns an instance of {@link BQRuntime} that contains all Bootique services, commands, etc. * This method is only needed if you are managing Bootique execution sequence manually. Normally you'd be using * {@link #exec()} method instead of this method. * * @return a new {@link BQRuntime} instance that contains all Bootique services, commands, etc. * @since 0.13 */ public BQRuntime createRuntime() { Injector injector = createInjector(); return createRuntime(injector); }
Runtime.getRuntime().addShutdownHook(shutdownThread); try { o = createRuntime().run();
/** * Creates and returns an instance of {@link BQRuntime} that contains all Bootique services, commands, etc. * This method is only needed if you are managing Bootique execution sequence manually. Normally you'd be using * {@link #exec()} method instead of this method. * * @return a new {@link BQRuntime} instance that contains all Bootique services, commands, etc. * @since 0.13 */ public BQRuntime createRuntime() { Injector injector = createInjector(); return createRuntime(injector); }
/** Create the compiler runtime. * * @param args the command line arguments. * @return the runtime. */ @SuppressWarnings("static-method") protected BQRuntime createRuntime(String... args) { SARLStandaloneSetup.doPreSetup(); final BQRuntime runtime = Bootique.app(args).autoLoadModules().createRuntime(); SARLStandaloneSetup.doPostSetup(runtime.getInstance(Injector.class)); return runtime; }
Runtime.getRuntime().addShutdownHook(shutdownThread); try { o = createRuntime().run();