public class LinuxOperatingSystem extends AbstractOperatingSystem
LinuxOperatingSystem class.
AbstractOperatingSystem.FamilyVersionInfo
OperatingSystem.OSVersionInfo, OperatingSystem.ProcessSort
jvmBitness, version
Constructor and Description |
---|
LinuxOperatingSystem()
Constructor for LinuxOperatingSystem.
|
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. |
static long |
getHz()
Gets Jiffies per second, useful for converting ticks to milliseconds and vice
versa.
|
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
|
OSProcess[] |
getProcesses(int limit,
OperatingSystem.ProcessSort sort,
boolean slowFields)
Gets currently running processes.
|
int |
getProcessId()
Gets the current process ID
|
protected static String |
getReleaseFilename()
Looks for a collection of possible distrib-release filenames
|
OSService[] |
getServices()
Gets the all services on the system.
|
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 int |
queryBitness() |
protected boolean |
queryElevated() |
AbstractOperatingSystem.FamilyVersionInfo |
queryFamilyVersionInfo() |
String |
queryManufacturer() |
getBitness, getFamily, getManufacturer, getProcesses, getProcesses, getVersion, getVersionInfo, isElevated, processSort, toString
public LinuxOperatingSystem()
Constructor for LinuxOperatingSystem.
public String queryManufacturer()
queryManufacturer
in class AbstractOperatingSystem
public AbstractOperatingSystem.FamilyVersionInfo queryFamilyVersionInfo()
queryFamilyVersionInfo
in class AbstractOperatingSystem
protected int queryBitness()
queryBitness
in class AbstractOperatingSystem
protected boolean queryElevated()
queryElevated
in class AbstractOperatingSystem
public FileSystem getFileSystem()
OperatingSystem
FileSystem
object.FileSystem
object.public OSProcess[] getProcesses(int limit, OperatingSystem.ProcessSort sort, boolean slowFields)
OperatingSystem
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 getProcess(int pid)
OperatingSystem
pid
- A process IDOSProcess
object for the specified
process id if it is running; null otherwisepublic OSProcess[] getChildProcesses(int parentPid, int limit, OperatingSystem.ProcessSort sort)
OperatingSystem
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 int getProcessId()
OperatingSystem
public int getProcessCount()
OperatingSystem
public int getThreadCount()
OperatingSystem
public long getSystemUptime()
OperatingSystem
public long getSystemBootTime()
OperatingSystem
public NetworkParams getNetworkParams()
OperatingSystem
NetworkParams
object.NetworkParams
object.protected static String getReleaseFilename()
public static long getHz()
public OSService[] getServices()
OperatingSystem
getServices
in interface OperatingSystem
getServices
in class AbstractOperatingSystem
OSService
objectsCopyright © 2010–2019 oshi. All rights reserved.