Package oshi.hardware.common
Class AbstractHardwareAbstractionLayer
- java.lang.Object
-
- oshi.hardware.common.AbstractHardwareAbstractionLayer
-
- All Implemented Interfaces:
HardwareAbstractionLayer
- Direct Known Subclasses:
AixHardwareAbstractionLayer
,FreeBsdHardwareAbstractionLayer
,LinuxHardwareAbstractionLayer
,MacHardwareAbstractionLayer
,OpenBsdHardwareAbstractionLayer
,SolarisHardwareAbstractionLayer
,WindowsHardwareAbstractionLayer
@ThreadSafe public abstract class AbstractHardwareAbstractionLayer extends java.lang.Object implements HardwareAbstractionLayer
Common fields or methods used by platform-specific implementations of HardwareAbstractionLayer
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.function.Supplier<ComputerSystem>
computerSystem
private java.util.function.Supplier<GlobalMemory>
memory
private java.util.function.Supplier<CentralProcessor>
processor
private java.util.function.Supplier<Sensors>
sensors
-
Constructor Summary
Constructors Constructor Description AbstractHardwareAbstractionLayer()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract ComputerSystem
createComputerSystem()
Instantiates the platform-specificComputerSystem
objectprotected abstract GlobalMemory
createMemory()
Instantiates the platform-specificGlobalMemory
objectprotected abstract CentralProcessor
createProcessor()
Instantiates the platform-specificCentralProcessor
objectprotected abstract Sensors
createSensors()
Instantiates the platform-specificSensors
objectComputerSystem
getComputerSystem()
Instantiates aComputerSystem
object.GlobalMemory
getMemory()
Instantiates aGlobalMemory
object.java.util.List<NetworkIF>
getNetworkIFs()
Gets a list of non-localNetworkIF
objects, representing a network interface.CentralProcessor
getProcessor()
Instantiates aCentralProcessor
object.Sensors
getSensors()
Instantiates aSensors
object, representing CPU temperature and fan speed.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface oshi.hardware.HardwareAbstractionLayer
getDiskStores, getDisplays, getGraphicsCards, getLogicalVolumeGroups, getNetworkIFs, getPowerSources, getSoundCards, getUsbDevices
-
-
-
-
Field Detail
-
computerSystem
private final java.util.function.Supplier<ComputerSystem> computerSystem
-
processor
private final java.util.function.Supplier<CentralProcessor> processor
-
memory
private final java.util.function.Supplier<GlobalMemory> memory
-
sensors
private final java.util.function.Supplier<Sensors> sensors
-
-
Method Detail
-
getComputerSystem
public ComputerSystem getComputerSystem()
Description copied from interface:HardwareAbstractionLayer
Instantiates aComputerSystem
object. This represents the physical hardware, including components such as BIOS/Firmware and a motherboard, logic board, etc.- Specified by:
getComputerSystem
in interfaceHardwareAbstractionLayer
- Returns:
- a
ComputerSystem
object.
-
createComputerSystem
protected abstract ComputerSystem createComputerSystem()
Instantiates the platform-specificComputerSystem
object- Returns:
- platform-specific
ComputerSystem
object
-
getProcessor
public CentralProcessor getProcessor()
Description copied from interface:HardwareAbstractionLayer
Instantiates aCentralProcessor
object. This represents one or more Logical CPUs.- Specified by:
getProcessor
in interfaceHardwareAbstractionLayer
- Returns:
- A
CentralProcessor
object.
-
createProcessor
protected abstract CentralProcessor createProcessor()
Instantiates the platform-specificCentralProcessor
object- Returns:
- platform-specific
CentralProcessor
object
-
getMemory
public GlobalMemory getMemory()
Description copied from interface:HardwareAbstractionLayer
Instantiates aGlobalMemory
object.- Specified by:
getMemory
in interfaceHardwareAbstractionLayer
- Returns:
- A memory object.
-
createMemory
protected abstract GlobalMemory createMemory()
Instantiates the platform-specificGlobalMemory
object- Returns:
- platform-specific
GlobalMemory
object
-
getSensors
public Sensors getSensors()
Description copied from interface:HardwareAbstractionLayer
Instantiates aSensors
object, representing CPU temperature and fan speed.- Specified by:
getSensors
in interfaceHardwareAbstractionLayer
- Returns:
- A Sensors object
-
createSensors
protected abstract Sensors createSensors()
Instantiates the platform-specificSensors
object- Returns:
- platform-specific
Sensors
object
-
getNetworkIFs
public java.util.List<NetworkIF> getNetworkIFs()
Description copied from interface:HardwareAbstractionLayer
Gets a list of non-localNetworkIF
objects, representing a network interface. The list excludes local interfaces.- Specified by:
getNetworkIFs
in interfaceHardwareAbstractionLayer
- Returns:
- A list of
NetworkIF
objects representing the interfaces
-
-