public static void main(String[] args) { // Show download stats - they don't display properly in Gradle so we only have them when running // on the command line HttpResolution.suppressDownloadCounter = false; new Starter(args); }
private void runBareHA(Args args) { PlatformManager mgr = startPM(true, false, args); if (mgr == null) { return; } addShutdownHook(mgr); block(); }
private void pullDependencies(String modName) { log.info("Attempting to pull in dependencies for module " + modName); createPM().pullInDependencies(modName, createLoggingHandler("pulling in dependencies", unblockHandler())); block(); }
sargs = removeOptions(sargs); runBareHA(args); } else { displaySyntax(); log.info(getVersion()); } else { if (sargs.length < 2) { displaySyntax(); } else { String operand = sargs[1]; switch (command) { case "run": runVerticle(false, false, operand, args); break; case "runmod": runVerticle(false, true, operand, args); break; case "runzip": runVerticle(true, true, operand, args); break; case "install": installModule(operand); break; case "uninstall": uninstallModule(operand); break; case "pulldeps":
private void runVerticle(boolean zip, boolean module, String main, Args args) { boolean ha = args.map.get("-ha") != null; boolean clustered = args.map.get("-cluster") != null; PlatformManager mgr = startPM(ha, clustered, args); if (mgr == null) { return; displaySyntax(); return; displaySyntax(); return; mgr.deployModuleFromZip(main, conf, instances, createLoggingHandler("deploying module from zip", doneHandler)); } else if (module) { final String deployMsg = "deploying module"; if (hasClasspath) { mgr.deployModuleFromClasspath(main, conf, instances, classpath, createLoggingHandler(deployMsg, doneHandler)); } else if (ha) { mgr.deployModule(main, conf, instances, true, createLoggingHandler(deployMsg, doneHandler)); } else { mgr.deployModule(main, conf, instances, createLoggingHandler(deployMsg, doneHandler)); if (worker) { mgr.deployWorkerVerticle(false, main, conf, classpath, instances, includes, createLoggingHandler("deploying worker verticle", doneHandler)); } else { mgr.deployVerticle(main, conf, classpath, instances, includes, createLoggingHandler("deploying verticle", doneHandler)); addShutdownHook(mgr);
clusterHost = getDefaultAddress(); if (clusterHost == null) { log.error("Unable to find a default network interface for clustering. Please specify one using -cluster-host"); String haGroup = args.map.get("-hagroup"); int quorumSize = sQuorumSize == null ? 0 : Integer.valueOf(sQuorumSize); mgr = createPM(clusterPort, clusterHost, quorumSize, haGroup); } else { mgr = createPM(clusterPort, clusterHost); mgr = createPM();
private void installModule(String modName) { log.info("Attempting to install module " + modName); createPM().installModule(modName, createLoggingHandler("installing module", unblockHandler())); block(); }
private void createModuleLink(String modName) { log.info("Attempting to create module link for module " + modName); createPM().createModuleLink(modName, createLoggingHandler("creating module link", unblockHandler())); block(); }
private void uninstallModule(String modName) { log.info("Attempting to uninstall module " + modName); createPM().uninstallModule(modName, createLoggingHandler("uninstalling module", unblockHandler())); block(); }
private void fatJar(String modName, Args args) { log.info("Attempting to make a fat jar for module " + modName); String directory = args.map.get("-d"); if (directory != null && !new File(directory).exists()) { log.info("Directory does not exist: " + directory); return; } createPM().makeFatJar(modName, directory, createLoggingHandler("making fat jar", unblockHandler())); block(); }