@Override protected void onAfterProcessStart(ProcessControl process, IRuntimeConfig runtimeConfig) throws IOException { ProcessOutput outputConfig = runtimeConfig.getProcessOutput(); LogWatchStreamProcessor logWatch = new LogWatchStreamProcessor( "waiting for connections on port", "failed", StreamToLineProcessor.wrap(outputConfig.getOutput())); Processors.connect(process.getReader(), logWatch); Processors.connect(process.getError(), StreamToLineProcessor.wrap(outputConfig.getError())); logWatch.waitForResult(TIMEOUT); if (logWatch.isInitWithSuccess()) { setProcessId(Mongos.getMongosProcessId(logWatch.getOutput(), -1)); } else { throw new IOException("Could not start mongod process"); } }
@Override protected final void onAfterProcessStart(ProcessControl process, IRuntimeConfig runtimeConfig) throws IOException { ProcessOutput outputConfig = runtimeConfig.getProcessOutput(); LogWatchStreamProcessor logWatch = new LogWatchStreamProcessor( successMessage(), knownFailureMessages(), StreamToLineProcessor.wrap(outputConfig.getOutput())); Processors.connect(process.getReader(), logWatch); Processors.connect(process.getError(), StreamToLineProcessor.wrap(outputConfig.getError())); logWatch.waitForResult(getConfig().timeout().getStartupTimeout()); if (logWatch.isInitWithSuccess()) { setProcessId(Mongod.getMongodProcessId(logWatch.getOutput(), -1)); } else { throw new IOException("Could not start process: " + logWatch.getFailureFound()); } }