public static void runDataStoreServer(int port) throws IOException { PlatformManager platformManager = PlatformLocator.factory.createPlatformManager(); JsonObject jsonObject = new JsonObject(); jsonObject.putNumber("port", port); URL url = new File(".", "target/classes").getCanonicalFile().toURL(); platformManager.deployVerticle("org.boon.slumberdb.DataStoreVerticle", jsonObject, new URL[]{url}, 1, null, new Handler<AsyncResult<String>>() { @Override public void handle(AsyncResult<String> stringAsyncResult) { if (stringAsyncResult.succeeded()) { puts("Launched verticle"); } } } ); // Prevent the JVM from exiting System.in.read(); }
createLoggingHandler("deploying worker verticle", doneHandler)); } else { mgr.deployVerticle(main, conf, classpath, instances, includes, createLoggingHandler("deploying verticle", doneHandler));
mgr.deployVerticle(main, conf, urls.toArray(new URL[urls.size()]), 1, includes, new AsyncResultHandler<String>() { public void handle(AsyncResult<String> ar) { if (ar.succeeded()) {
/** * Deploy a verticle * * @param main The main, e.g. app.js, foo.rb, org.mycompany.MyMain, etc * @param config Any JSON config to pass to the verticle, or null if none * @param classpath The classpath for the verticle * @param instances The number of instances to deploy * @param includes Comma separated list of modules to include, or null if none * @return Promise of deployment */ @Override public Promise<String> deployVerticle(String main, JsonObject config, URL[] classpath, int instances, String includes) { final Deferred<String> d = when.defer(); manager.deployVerticle(main, config, classpath, instances, includes, result -> { if (result.succeeded()) { d.resolve(result.result()); } else { d.reject(result.cause()); } }); return d.getPromise(); }