public class WindowsOperatingSystem extends AbstractOperatingSystem
WindowsOperatingSystem class.
OperatingSystem.ProcessSortbitness, elevated, family, manufacturer, version| Constructor and Description |
|---|
WindowsOperatingSystem()
Constructor for WindowsOperatingSystem.
|
| Modifier and Type | Method and Description |
|---|---|
OSProcess[] |
getChildProcesses(int parentPid,
int limit,
OperatingSystem.ProcessSort sort)
Gets currently running child processes of provided PID.
|
FileSystem |
getFileSystem()
Instantiates a
FileSystem object. |
NetworkParams |
getNetworkParams()
Instantiates a
NetworkParams object. |
OSProcess |
getProcess(int pid)
Gets information on a currently running process
|
int |
getProcessCount()
Get the number of processes currently running
|
List<OSProcess> |
getProcesses(Collection<Integer> pids)
Gets information on a currently running processes.
|
OSProcess[] |
getProcesses(int limit,
OperatingSystem.ProcessSort sort,
boolean slowFields)
Gets currently running processes.
|
int |
getProcessId()
Gets the current process ID
|
long |
getSystemBootTime()
Get Unix time of boot.
|
long |
getSystemUptime()
Get the System up time (time since boot).
|
int |
getThreadCount()
Get the number of threads currently running
|
protected void |
handleWin32ExceptionOnGetProcessInfo(OSProcess proc,
com.sun.jna.platform.win32.Win32Exception ex)
handleWin32ExceptionOnGetProcessInfo.
|
boolean |
isElevated()
Determine whether the current process has elevated permissions such as sudo /
Administrator
|
getBitness, getFamily, getManufacturer, getProcesses, getVersion, processSort, toStringpublic WindowsOperatingSystem()
Constructor for WindowsOperatingSystem.
public FileSystem getFileSystem()
FileSystem object.FileSystem object.public OSProcess[] getProcesses(int limit, OperatingSystem.ProcessSort sort, boolean slowFields)
limit - Max number of results to return, or 0 to return all resultssort - If not null, determines sorting of resultsslowFields - If false, skip OSProcess fields that are
slow to retrieve (e.g., group information on Windows, open files
on Unix and Linux). If true, include all fields, regardless of how
long it takes to retrieve the data.OSProcess objects for the
specified number (or all) of currently running processes, sorted as
specified. The array may contain null elements if a process
terminates during iteration.public OSProcess[] getChildProcesses(int parentPid, int limit, OperatingSystem.ProcessSort sort)
parentPid - A process IDlimit - Max number of results to return, or 0 to return all resultssort - If not null, determines sorting of resultsOSProcess objects presenting the
specified number (or all) of currently running child processes of the
provided PID, sorted as specified. The array may contain null
elements if a process terminates during iteration.public OSProcess getProcess(int pid)
pid - A process IDOSProcess object for the specified
process id if it is running; null otherwisepublic List<OSProcess> getProcesses(Collection<Integer> pids)
getProcesses in interface OperatingSystemgetProcesses in class AbstractOperatingSystempids - A collection of process IDsOSProcess object for the specified
process ids if it is runningprotected void handleWin32ExceptionOnGetProcessInfo(OSProcess proc, com.sun.jna.platform.win32.Win32Exception ex)
handleWin32ExceptionOnGetProcessInfo.
proc - a OSProcess object.ex - a Win32Exception object.public int getProcessId()
public int getProcessCount()
public int getThreadCount()
public long getSystemUptime()
public long getSystemBootTime()
public boolean isElevated()
isElevated in interface OperatingSystemisElevated in class AbstractOperatingSystempublic NetworkParams getNetworkParams()
NetworkParams object.NetworkParams object.Copyright © 2010–2019 oshi. All rights reserved.