Package oshi.software.os.unix.freebsd
Class FreeBsdOperatingSystem
- java.lang.Object
-
- oshi.software.common.AbstractOperatingSystem
-
- oshi.software.os.unix.freebsd.FreeBsdOperatingSystem
-
- All Implemented Interfaces:
java.io.Serializable
,OperatingSystem
public class FreeBsdOperatingSystem extends AbstractOperatingSystem
Linux is a family of free operating systems most commonly used on personal computers.- Author:
- widdis[at]gmail[dot]com
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface oshi.software.os.OperatingSystem
OperatingSystem.ProcessSort
-
-
Field Summary
-
Fields inherited from class oshi.software.common.AbstractOperatingSystem
bitness, family, manufacturer, version
-
-
Constructor Summary
Constructors Constructor Description FreeBsdOperatingSystem()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OSProcess[]
getChildProcesses(int parentPid, int limit, OperatingSystem.ProcessSort sort)
Gets currently running child processes of provided PID.FileSystem
getFileSystem()
Instantiates aFileSystem
object.NetworkParams
getNetworkParams()
Instantiates aNetworkParams
object.OSProcess
getProcess(int pid)
Gets information on a currently running processint
getProcessCount()
Get the number of processes currently runningOSProcess[]
getProcesses(int limit, OperatingSystem.ProcessSort sort, boolean slowFields)
Gets currently running processes.int
getProcessId()
Gets the current process IDint
getThreadCount()
Get the number of threads currently running-
Methods inherited from class oshi.software.common.AbstractOperatingSystem
getBitness, getFamily, getManufacturer, getProcesses, getProcesses, getVersion, processSort, toString
-
-
-
-
Method Detail
-
getFileSystem
public FileSystem getFileSystem()
Instantiates aFileSystem
object.- Returns:
- A
FileSystem
object.
-
getProcesses
public OSProcess[] getProcesses(int limit, OperatingSystem.ProcessSort sort, boolean slowFields)
Gets currently running processes. If a positive limit is specified, returns only that number of processes; zero will return all processes. The order may be specified by the sort parameter, for example, to return the top cpu or memory consuming processes; if null, no order is guaranteed.- Parameters:
limit
- Max number of results to return, or 0 to return all resultssort
- If not null, determines sorting of resultsslowFields
- If false, skipOSProcess
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.- Returns:
- An array of
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.
-
getProcess
public OSProcess getProcess(int pid)
Gets information on a currently running process- Parameters:
pid
- A process ID- Returns:
- An
OSProcess
object for the specified process id if it is running; null otherwise
-
getChildProcesses
public OSProcess[] getChildProcesses(int parentPid, int limit, OperatingSystem.ProcessSort sort)
Gets currently running child processes of provided PID. If a positive limit is specified, returns only that number of processes; zero will return all processes. The order may be specified by the sort parameter, for example, to return the top cpu or memory consuming processes; if null, no order is guaranteed.- Parameters:
parentPid
- A process IDlimit
- Max number of results to return, or 0 to return all resultssort
- If not null, determines sorting of results- Returns:
- An array of
OSProcess
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.
-
getProcessId
public int getProcessId()
Gets the current process ID- Returns:
- the Process ID of the current process
-
getProcessCount
public int getProcessCount()
Get the number of processes currently running- Returns:
- The number of processes running
-
getThreadCount
public int getThreadCount()
Get the number of threads currently running- Returns:
- The number of threads running
-
getNetworkParams
public NetworkParams getNetworkParams()
Instantiates aNetworkParams
object.- Returns:
- A
NetworkParams
object.
-
-