/** * Exits the JVM and indicate an issue during the Vert.x initialization. */ public static void exitBecauseOfVertxInitializationIssue() { exit(VERTX_INITIALIZATION_EXIT_CODE); }
private void terminateWindowsApplication() { // Use wmic. List<String> cmd = Arrays.asList( "WMIC", "PROCESS", "WHERE", "CommandLine like '%vertx.id=" + id + "%'", "CALL", "TERMINATE" ); try { final Process process = new ProcessBuilder(cmd).start(); int result = process.waitFor(); out.println("Application '" + id + "' terminated with status " + result); if (!redeploy) { // We leave the application using the same exit code. ExecUtils.exit(result); } } catch (Exception e) { out.println("Failed to stop application '" + id + "'"); e.printStackTrace(out); if (!redeploy) { ExecUtils.exitBecauseOfProcessIssue(); } } }
JsonObject conf = getConfiguration(); if (conf == null) { ExecUtils.exit(KNOTX_MISSING_OR_EMPTY_CONFIGURATION_EXIT_CODE);
private void terminateLinuxApplication() { String pid = pid(); if (pid == null) { out.println("Cannot find process for application using the id '" + id + "'."); if (!redeploy) { ExecUtils.exitBecauseOfProcessIssue(); } return; } List<String> cmd = new ArrayList<>(); cmd.add("kill"); cmd.add(pid); try { int result = new ProcessBuilder(cmd).start().waitFor(); out.println("Application '" + id + "' terminated with status " + result); if (!redeploy) { // We leave the application using the same exit code. ExecUtils.exit(result); } } catch (Exception e) { out.println("Failed to stop application '" + id + "'"); e.printStackTrace(out); if (!redeploy) { ExecUtils.exitBecauseOfProcessIssue(); } } }
/** * Exits the JVM and indicate an issue during the deployment of the main verticle. */ public static void exitBecauseOfVertxDeploymentIssue() { exit(VERTX_DEPLOYMENT_EXIT_CODE); }
JsonObject conf = getConfiguration(); if (conf == null) { ExecUtils.exit(KNOTX_MISSING_OR_EMPTY_CONFIGURATION_EXIT_CODE);
private void terminateWindowsApplication() { // Use wmic. List<String> cmd = Arrays.asList( "WMIC", "PROCESS", "WHERE", "CommandLine like '%vertx.id=" + id + "%'", "CALL", "TERMINATE" ); try { final Process process = new ProcessBuilder(cmd).start(); int result = process.waitFor(); out.println("Application '" + id + "' terminated with status " + result); if (!redeploy) { // We leave the application using the same exit code. ExecUtils.exit(result); } } catch (Exception e) { out.println("Failed to stop application '" + id + "'"); e.printStackTrace(out); if (!redeploy) { ExecUtils.exitBecauseOfProcessIssue(); } } }
/** * Exits the JVM and indicate an issue with a process creation or termination. */ public static void exitBecauseOfProcessIssue() { exit(PROCESS_ERROR_EXIT_CODE); }
private void terminateLinuxApplication() { String pid = pid(); if (pid == null) { out.println("Cannot find process for application using the id '" + id + "'."); if (!redeploy) { ExecUtils.exitBecauseOfProcessIssue(); } return; } List<String> cmd = new ArrayList<>(); cmd.add("kill"); cmd.add(pid); try { int result = new ProcessBuilder(cmd).start().waitFor(); out.println("Application '" + id + "' terminated with status " + result); if (!redeploy) { // We leave the application using the same exit code. ExecUtils.exit(result); } } catch (Exception e) { out.println("Failed to stop application '" + id + "'"); e.printStackTrace(out); if (!redeploy) { ExecUtils.exitBecauseOfProcessIssue(); } } }
/** * Exits the JVM and indicate an issue with the system configuration. */ public static void exitBecauseOfSystemConfigurationIssue() { exit(SYSTEM_CONFIGURATION_EXIT_CODE); }
/** * Exits the JVM and indicate an issue during the Vert.x initialization. */ public static void exitBecauseOfVertxInitializationIssue() { exit(VERTX_INITIALIZATION_EXIT_CODE); }
/** * Exits the JVM and indicate an issue during the deployment of the main verticle. */ public static void exitBecauseOfVertxDeploymentIssue() { exit(VERTX_DEPLOYMENT_EXIT_CODE); }
/** * Exits the JVM and indicate an issue with the system configuration. */ public static void exitBecauseOfSystemConfigurationIssue() { exit(SYSTEM_CONFIGURATION_EXIT_CODE); }
/** * Exits the JVM and indicate an issue with a process creation or termination. */ public static void exitBecauseOfProcessIssue() { exit(PROCESS_ERROR_EXIT_CODE); }