@Override public void deployModuleFromClasspath(final String moduleName, final JsonObject config, final int instances, final URL[] classpath, final Handler<AsyncResult<String>> doneHandler) { final Handler<AsyncResult<String>> wrapped = wrapDoneHandler(doneHandler); runInBackground(new Runnable() { public void run() { ModuleIdentifier modID = new ModuleIdentifier(moduleName); deployModuleFromCP(null, modID, config, instances, classpath, wrapped); } }, wrapped); }
@Override public JsonObject config() { VerticleHolder holder = getVerticleHolder(); return holder == null ? null : holder.config; }
@Override public void deployWorkerVerticle(String main, JsonObject config, int instances, boolean multiThreaded, Handler<AsyncResult<String>> doneHandler) { mgr.deployWorkerVerticle(multiThreaded, main, config, null, instances, null, doneHandler); }
@Override public void deployModuleInternal(final String moduleName, final JsonObject config, final int instances, final boolean ha, final Handler<AsyncResult<String>> doneHandler) { final File currentModDir = getDeploymentModDir(); final Handler<AsyncResult<String>> wrapped = wrapDoneHandler(doneHandler); runInBackground(new Runnable() { public void run() { ModuleIdentifier modID = new ModuleIdentifier(moduleName); deployModuleFromFileSystem(modRoot, null, modID, config, instances, currentModDir, ha, wrapped); } }, wrapped); }
public void stop() { if (stopped) { return; } if (haManager != null) { haManager.stop(); } redeployer.close(); deleteTmpDeployments(); vertx.stop(); stopped = true; }
private Set<ModuleClassLoader> getModuleGraph() { if (modGraph == null) { modGraph = new LinkedHashSet<>(); modGraph.add(this); computeModules(modGraph); } return modGraph; }
private ModuleReference getModuleReference(String moduleKey, URL[] urls, boolean loadFromModuleFirst) { ModuleReference mr = moduleRefs.get(moduleKey); if (mr == null) { mr = new ModuleReference(this, moduleKey, new ModuleClassLoader(moduleKey, platformClassLoader, urls, loadFromModuleFirst), false); ModuleReference prev = moduleRefs.putIfAbsent(moduleKey, mr); if (prev != null) { mr = prev; } } return mr; }
protected DefaultPlatformManager() { DefaultVertx v = new DefaultVertx(); this.vertx = new WrappedVertx(v); this.clusterManager = v.clusterManager(); init(); }
@Override public void deployWorkerVerticle(boolean multiThreaded, String main, JsonObject config, URL[] classpath, int instances, String includes, Handler<AsyncResult<String>> doneHandler) { deployVerticle(true, multiThreaded, main, config, classpath, instances, includes, doneHandler); }
public void run() { ModuleIdentifier modID = new ModuleIdentifier(moduleName); deployModuleFromCP(null, modID, config, instances, classpath, wrapped); } }, wrapped);
@Override public void deployModule(final String moduleName, final JsonObject config, final int instances, final Handler<AsyncResult<String>> doneHandler) { deployModuleInternal(moduleName, config, instances, false, doneHandler); }
private void handleDeployFailure(final Throwable t, Deployment dep, final CountingCompletionHandler<Void> handler) { // First we undeploy doUndeploy(dep, new Handler<AsyncResult<Void>>() { public void handle(AsyncResult<Void> res) { if (res.failed()) { vertx.reportException(res.cause()); } // And pass the *deploy* (not undeploy) Throwable back to the original handler handler.failed(t); } }); }
@Override public PlatformManager createPlatformManager(int clusterPort, String clusterHost, int quorumSize, String haGroup) { return new DefaultPlatformManager(clusterPort, clusterHost, quorumSize, haGroup); } }
@Override public void pullInDependencies(final String moduleName, final Handler<AsyncResult<Void>> doneHandler) { final Handler<AsyncResult<Void>> wrapped = wrapDoneHandler(doneHandler); runInBackground(new Runnable() { public void run() { ModuleIdentifier modID = new ModuleIdentifier(moduleName); // Validates it doPullInDependencies(modRoot, modID); doneHandler.handle(new DefaultFutureResult<>((Void) null)); } }, wrapped); }
@Override public Logger logger() { VerticleHolder holder = getVerticleHolder(); return holder == null ? null : holder.logger; }
@Override public void deployVerticle(String main, JsonObject config, URL[] classpath, int instances, String includes, Handler<AsyncResult<String>> doneHandler) { deployVerticle(false, false, main, config, classpath, instances, includes, doneHandler); }
public void run() { ModuleIdentifier modID = new ModuleIdentifier(moduleName); deployModuleFromFileSystem(modRoot, null, modID, config, instances, currentModDir, ha, wrapped); } }, wrapped);
@Override public void installModule(final String moduleName, final Handler<AsyncResult<Void>> doneHandler) { final Handler<AsyncResult<Void>> wrapped = wrapDoneHandler(doneHandler); runInBackground(new Runnable() { public void run() { ModuleIdentifier modID = new ModuleIdentifier(moduleName); doInstallMod(modID); doneHandler.handle(new DefaultFutureResult<>((Void) null)); } }, wrapped); }
@Override public void makeFatJar(final String moduleName, final String directory, final Handler<AsyncResult<Void>> doneHandler) { final Handler<AsyncResult<Void>> wrapped = wrapDoneHandler(doneHandler); runInBackground(new Runnable() { public void run() { ModuleIdentifier modID = new ModuleIdentifier(moduleName); // Validates it doMakeFatJar(modRoot, modID, directory); doneHandler.handle(new DefaultFutureResult<>((Void) null)); } }, wrapped); }
@Override public void createModuleLink(final String moduleName, final Handler<AsyncResult<Void>> doneHandler) { final Handler<AsyncResult<Void>> wrapped = wrapDoneHandler(doneHandler); runInBackground(new Runnable() { public void run() { ModuleIdentifier modID = new ModuleIdentifier(moduleName); // Validates it doCreateModuleLink(modRoot, modID); doneHandler.handle(new DefaultFutureResult<>((Void) null)); } }, wrapped); }