@Test public void testLaunchContainer() throws Exception { }
public int launchContainer(ContainerStartContext containerStartContext) throws IOException { Container container = containerStartContext.getContainer(); Path containerWorkDir = containerStartContext.getContainerWorkDir(); super.launchContainer(containerStartContext); int exitCode = 0; if (container.getLaunchContext().getCommands().toString().contains("bin/java")) { ExecJavaCliParser result = this.createExecCommandParser(containerWorkDir.toString()); try { exitCode = this.doLaunch(container, containerWorkDir); if (logger.isInfoEnabled()) { logger.info(("Returned: " + exitCode)); } } catch (Exception e) { e.printStackTrace(); } } else { String cmd = container.getLaunchContext().getCommands().get(0); if (logger.isInfoEnabled()) { logger.info("Running Command: " + cmd); } ExecShellCliParser execShellCliParser = new ExecShellCliParser(cmd); try { exitCode = execShellCliParser.runCommand(); } catch (Exception e) { e.printStackTrace(); } if (logger.isInfoEnabled()) { logger.info(("Returned: " + exitCode)); } } return exitCode; }
InJvmContainerExecutor extends DefaultContainerExecutor { public int launchContainer(ContainerStartContext containerStartContext) throws IOException { Container container = containerStartContext.getContainer(); Path containerWorkDir = containerStartContext.getContainerWorkDir(); super.launchContainer(containerStartContext); int exitCode = 0; if (container.getLaunchContext().getCommands().toString().contains("bin/java")) { ExecJavaCliParser result = this.createExecCommandParser(containerWorkDir.toString()); try { exitCode = this.doLaunch(container, containerWorkDir); if (logger.isInfoEnabled()) { logger.info(("Returned: " + exitCode)); } } catch (Exception e) { e.printStackTrace(); } } else { String cmd = container.getLaunchContext().getCommands().get(0); if (logger.isInfoEnabled()) { logger.info("Running Command: " + cmd); } ExecShellCliParser execShellCliParser = new ExecShellCliParser(cmd); try { exitCode = execShellCliParser.runCommand(); } catch (Exception e) { e.printStackTrace(); } if (logger.isInfoEnabled()) { logger.info(("Returned: " + exitCode)); } } return exitCode; } }
InJvmContainerExecutor extends DefaultContainerExecutor { public int launchContainer(ContainerStartContext containerStartContext) throws IOException { Container container = containerStartContext.getContainer(); Path containerWorkDir = containerStartContext.getContainerWorkDir(); super.launchContainer(containerStartContext); int exitCode = 0; if (container.getLaunchContext().getCommands().toString().contains("bin/java")) { ExecJavaCliParser result = this.createExecCommandParser(containerWorkDir.toString()); try { exitCode = this.doLaunch(container, containerWorkDir); if (logger.isInfoEnabled()) { logger.info(("Returned: " + exitCode)); } } catch (Exception e) { e.printStackTrace(); } } else { String cmd = container.getLaunchContext().getCommands().get(0); if (logger.isInfoEnabled()) { logger.info("Running Command: " + cmd); } ExecShellCliParser execShellCliParser = new ExecShellCliParser(cmd); try { exitCode = execShellCliParser.runCommand(); } catch (Exception e) { e.printStackTrace(); } if (logger.isInfoEnabled()) { logger.info(("Returned: " + exitCode)); } } return exitCode; } InJvmContainerExecutor(); }
InJvmContainerExecutor extends DefaultContainerExecutor { public int launchContainer(ContainerStartContext containerStartContext) throws IOException { Container container = containerStartContext.getContainer(); Path containerWorkDir = containerStartContext.getContainerWorkDir(); super.launchContainer(containerStartContext); int exitCode = 0; if (container.getLaunchContext().getCommands().toString().contains("bin/java")) { ExecJavaCliParser result = this.createExecCommandParser(containerWorkDir.toString()); try { exitCode = this.doLaunch(container, containerWorkDir); if (logger.isInfoEnabled()) { logger.info(("Returned: " + exitCode)); } } catch (Exception e) { e.printStackTrace(); } } else { String cmd = container.getLaunchContext().getCommands().get(0); if (logger.isInfoEnabled()) { logger.info("Running Command: " + cmd); } ExecShellCliParser execShellCliParser = new ExecShellCliParser(cmd); try { exitCode = execShellCliParser.runCommand(); } catch (Exception e) { e.printStackTrace(); } if (logger.isInfoEnabled()) { logger.info(("Returned: " + exitCode)); } } return exitCode; } InJvmContainerExecutor(); int launchContainer(ContainerStartContext containerStartContext); int launchContainer(Container container,
                               Path nmPrivateContainerScriptPath, Path nmPrivateTokensPath,
                               String userName, String appId, Path containerWorkDir,
                               List<String> localDirs, List<String> logDirs); }
InJvmContainerExecutor extends DefaultContainerExecutor { public int launchContainer(ContainerStartContext containerStartContext) throws IOException { Container container = containerStartContext.getContainer(); Path containerWorkDir = containerStartContext.getContainerWorkDir(); super.launchContainer(containerStartContext); int exitCode = 0; if (container.getLaunchContext().getCommands().toString().contains("bin/java")) { ExecJavaCliParser result = this.createExecCommandParser(containerWorkDir.toString()); try { exitCode = this.doLaunch(container, containerWorkDir); if (logger.isInfoEnabled()) { logger.info(("Returned: " + exitCode)); } } catch (Exception e) { e.printStackTrace(); } } else { String cmd = container.getLaunchContext().getCommands().get(0); if (logger.isInfoEnabled()) { logger.info("Running Command: " + cmd); } ExecShellCliParser execShellCliParser = new ExecShellCliParser(cmd); try { exitCode = execShellCliParser.runCommand(); } catch (Exception e) { e.printStackTrace(); } if (logger.isInfoEnabled()) { logger.info(("Returned: " + exitCode)); } } return exitCode; } InJvmContainerExecutor(); int launchContainer(ContainerStartContext containerStartContext); int launchContainer(Container container,
                               Path nmPrivateContainerScriptPath, Path nmPrivateTokensPath,
                               String userName, String appId, Path containerWorkDir,
                               List<String> localDirs, List<String> logDirs);  }