public class Processes extends Object
Constructor and Description |
---|
Processes() |
Modifier and Type | Method and Description |
---|---|
static List<String> |
getDockerContainerIds()
Returns a list of active docker containers
|
static List<Long> |
getJavaProcessIds(String... classNameFilter)
Returns the list of current active PIDs for any java based process
that has a main class which contains any of the given bits of text
|
static List<Long> |
getProcessIds()
Returns the list of current active PIDs
|
static boolean |
isProcessAlive(long pid)
Returns true if the given PID is still alive
|
static int |
killDockerContainer(String containerId)
Returns a list of active docker containers
|
static void |
killDockerContainers()
Kills all docker containers on the current host
|
static int |
killJavaProcesses()
Kills all commonly created Java based processes created by fabric8 and its unit tests.
|
static int |
killJavaProcesses(String... classNameFilters)
Kills all java processes found which include the classNameFilter in their main class
|
static int |
killProcess(Long pid,
String params)
Attempts to kill the given process
|
protected static int |
killProcessUnix(Long pid,
String params) |
protected static int |
killProcessWindows(Long pid,
String params) |
protected static void |
parseProcesses(InputStream inputStream,
List<Long> answer,
String message,
Filter<String> lineFilter,
Function<String,String> preFunction) |
protected static void |
processErrors(InputStream inputStream,
String message) |
protected static void |
processInput(InputStream inputStream,
String message) |
protected static void |
processOutput(InputStream inputStream,
Function<String,Void> function,
String errrorMessage) |
protected static void |
readProcessOutput(InputStream inputStream,
String prefix,
String message) |
public static boolean isProcessAlive(long pid)
public static List<Long> getJavaProcessIds(String... classNameFilter)
public static int killJavaProcesses()
public static int killJavaProcesses(String... classNameFilters)
public static List<String> getDockerContainerIds()
public static int killDockerContainer(String containerId)
public static void killDockerContainers()
public static int killProcess(Long pid, String params)
protected static void parseProcesses(InputStream inputStream, List<Long> answer, String message, Filter<String> lineFilter, Function<String,String> preFunction) throws Exception
Exception
protected static void processInput(InputStream inputStream, String message) throws Exception
Exception
protected static void processErrors(InputStream inputStream, String message) throws Exception
Exception
protected static void readProcessOutput(InputStream inputStream, String prefix, String message) throws Exception
Exception
protected static void processOutput(InputStream inputStream, Function<String,Void> function, String errrorMessage) throws IOException
IOException
Copyright © 2011–2016 Red Hat. All rights reserved.