Package oshi.software.os
Class OSService
- java.lang.Object
-
- oshi.software.os.OSService
-
@Immutable public class OSService extends java.lang.Object
Operating system services are responsible for the management of platform resources, including the processor, memory, files, and input and output. They generally shield applications from the implementation details of the machine.This class is provided for information purposes only. Interpretation of the meaning of services is platform-dependent.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OSService.State
Service Execution States
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
name
private int
processID
private OSService.State
state
-
Constructor Summary
Constructors Constructor Description OSService(java.lang.String name, int processID, OSService.State state)
Instantiate a newOSService
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getName()
Getter for the fieldname
.int
getProcessID()
Getter for the fieldprocessID
.OSService.State
getState()
Getter for the fieldstate
.
-
-
-
Field Detail
-
name
private final java.lang.String name
-
processID
private final int processID
-
state
private final OSService.State state
-
-
Constructor Detail
-
OSService
public OSService(java.lang.String name, int processID, OSService.State state)
Instantiate a newOSService
.- Parameters:
name
- The service name.processID
- The process ID if running, or 0 if stopped.state
- The serviceOSService.State
.
-
-
Method Detail
-
getName
public java.lang.String getName()
Getter for the field
name
.- Returns:
- Returns the name of the service.
-
getProcessID
public int getProcessID()
Getter for the field
processID
.- Returns:
- Returns the processID.
-
getState
public OSService.State getState()
Getter for the field
state
.- Returns:
- Returns the state of the service.
-
-