public class ProcessUtils extends Object
| 构造器和说明 |
|---|
ProcessUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
extendAppStatus(List<Map<String,Object>> serviceIniFileInfoList) |
static Long |
findPidByPort(Integer appPort)
通过linux的netstat命令,根据端口号,查找进程ID
在Linux下,如果该端口被使用,那么返回的是如下内容
tcp6 0 0 :::9000 :::* LISTEN 2012423/java
|
static List<String> |
gcProcess(Long pid)
GC java进程
|
static List<Map<String,Object>> |
getProcess() |
static List<Map<String,Object>> |
getProcess(String appType)
获得进程信息
|
static long |
getProcessID()
获得当前进程的ID
|
static Set<Long> |
getProcessPort(Long pid) |
static Map<String,Object> |
getSysProcess(String feature) |
static Map<String,Object> |
getSysProcess(String feature,
boolean isSysParam) |
static boolean |
killLoader() |
public static void extendAppStatus(List<Map<String,Object>> serviceIniFileInfoList) throws IOException, InterruptedException
public static List<Map<String,Object>> getProcess() throws IOException, InterruptedException
public static List<Map<String,Object>> getProcess(String appType) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic static Map<String,Object> getSysProcess(String feature) throws IOException, InterruptedException
public static Map<String,Object> getSysProcess(String feature, boolean isSysParam) throws IOException, InterruptedException
public static Set<Long> getProcessPort(Long pid) throws IOException, InterruptedException
public static List<String> gcProcess(Long pid) throws IOException, InterruptedException
pid - IOExceptionInterruptedExceptionpublic static Long findPidByPort(Integer appPort) throws IOException, InterruptedException
appPort - 端口号IOException - 异常信息InterruptedException - 异常信息public static final long getProcessID()
public static boolean killLoader()
Copyright © 2024. All rights reserved.