public class WindowsSystemCommander extends AbstractSystemCommander
Constructor and Description |
---|
WindowsSystemCommander() |
Modifier and Type | Method and Description |
---|---|
String |
buildKill(int pid)
构建kill 命令
|
String |
emptyLogFile(File file)
清空文件内容
|
com.alibaba.fastjson.JSONObject |
getAllMonitor()
获取windows 监控
https://docs.oracle.com/javase/7/docs/jre/api/management/extension/com/sun/management/OperatingSystemMXBean.html
|
ProcessModel |
getPidInfo(int pid)
获取指定进程的 内存信息
|
List<ProcessModel> |
getProcessList(String processName)
获取当前服务器的所有进程列表
|
boolean |
getServiceStatus(String serviceName)
查询服务状态
|
String |
startService(String serviceName)
启动服务
|
String |
stopService(String serviceName)
关闭服务
|
getHardDisk, getInstance, kill
public com.alibaba.fastjson.JSONObject getAllMonitor()
getAllMonitor
in class AbstractSystemCommander
public List<ProcessModel> getProcessList(String processName)
AbstractSystemCommander
getProcessList
in class AbstractSystemCommander
processName
- 进程名称public ProcessModel getPidInfo(int pid)
AbstractSystemCommander
getPidInfo
in class AbstractSystemCommander
pid
- 进程idpublic String emptyLogFile(File file)
AbstractSystemCommander
emptyLogFile
in class AbstractSystemCommander
file
- 文件public boolean getServiceStatus(String serviceName)
AbstractSystemCommander
getServiceStatus
in class AbstractSystemCommander
serviceName
- 服务名称public String startService(String serviceName)
AbstractSystemCommander
startService
in class AbstractSystemCommander
serviceName
- 服务名称public String stopService(String serviceName)
AbstractSystemCommander
stopService
in class AbstractSystemCommander
serviceName
- 服务名称public String buildKill(int pid)
AbstractSystemCommander
buildKill
in class AbstractSystemCommander
pid
- 进程编号Copyright © 2017–2022. All rights reserved.