public class JvmUtil extends Object
Modifier and Type | Field and Description |
---|---|
static Supplier<String> |
JPS_ERROR_MSG
Jps 异常消息回调
|
static boolean |
jpsNormal
状态服务器 jps 命令执行是否正常
|
Constructor and Description |
---|
JvmUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
checkCommandLineIsJpom(String commandLine,
String tag)
判断命令行是否为jpom 标识
|
static void |
checkJpsNormal()
检查 jps 命令是否正常
|
static boolean |
exist(long pid)
执行 jps 判断是否存在 对应的进程
|
static Integer |
findMainClassPid(String mainClass)
工具指定的 mainClass 获取对应所有的的 MonitoredVm对象
|
static int |
getJavaVirtualCount()
获取当前系统运行的java 程序个数
|
static String |
getJpomPidTag(String id,
String path)
获取进程标识
|
static Integer |
getPidByTag(String tag)
工具Jpom运行项目的id 获取进程ID
|
static String |
getPidJpsInfoInfo(int pid)
根据pid 获取jvm
|
static String |
parseCommandJpomTag(String commandLine)
解析命令行的 tag 信息
|
public static void checkJpsNormal()
public static String getJpomPidTag(String id, String path)
id
- ipath
- 路径public static int getJavaVirtualCount()
public static boolean exist(long pid)
public static String getPidJpsInfoInfo(int pid)
pid
- 进程idpublic static Integer getPidByTag(String tag)
tag
- 项目idpublic static boolean checkCommandLineIsJpom(String commandLine, String tag)
commandLine
- 命令行tag
- 标识public static String parseCommandJpomTag(String commandLine)
commandLine
- 命令行Copyright © 2017–2022. All rights reserved.