public class NetworkUtils {
+ private NetworkUtils() {
+ // only static stuff
+ }
+
public static int freePort() {
try {
ServerSocket s = new ServerSocket(0);
package org.sonar.process;
import org.apache.commons.io.IOUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.annotation.Nullable;
public class ProcessUtils {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(ProcessUtils.class);
+
private ProcessUtils() {
// only static stuff
}
process.exitValue();
return false;
} catch (IllegalThreadStateException e) {
+ LOGGER.trace("Process has no exit value yet", e);
return true;
}
}
try {
process.destroy();
} catch (Exception ignored) {
- // ignored
+ LOGGER.warn("Exception while destroying the process", ignored);
}
}
}
logger.info(line);
}
} catch (Exception ignored) {
- LOGGER.trace("Error while Gobbling", ignored);
+ logger.trace("Error while Gobbling", ignored);
} finally {
IOUtils.closeQuietly(br);
IOUtils.closeQuietly(isr);
@Override
protected boolean doIsReady() {
- return (node.client().admin().cluster().prepareHealth()
+ return node.client().admin().cluster().prepareHealth()
.setWaitForYellowStatus()
.setTimeout(TimeValue.timeValueSeconds(3L))
.get()
- .getStatus() != ClusterHealthStatus.RED);
+ .getStatus() != ClusterHealthStatus.RED;
}
@Override