Package com.pi4j.system.impl
Class DefaultSystemInfoProvider
- java.lang.Object
-
- com.pi4j.system.impl.SystemInfoProviderBase
-
- com.pi4j.system.impl.DefaultSystemInfoProvider
-
- All Implemented Interfaces:
SystemInfoProvider
- Direct Known Subclasses:
RaspiSystemInfoProvider
public abstract class DefaultSystemInfoProvider extends SystemInfoProviderBase implements SystemInfoProvider
Abstract base implementation of the SystemInfoProvider interface. This base impl includes support for all common method across all the supported platforms.
-
-
Constructor Summary
Constructors Constructor Description DefaultSystemInfoProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringgetBashVersionInfo()StringgetBogoMIPS()StringgetCpuArchitecture()String[]getCpuFeatures()StringgetCpuImplementer()protected StringgetCpuInfo(String target)This method will read and parse the '/proc/cpuinfo' into a collection of properties.StringgetCpuPart()StringgetCpuRevision()StringgetCpuVariant()StringgetHardware()StringgetJavaRuntime()StringgetJavaVendor()StringgetJavaVendorUrl()StringgetJavaVersion()StringgetJavaVirtualMachine()protected List<Long>getMemory()longgetMemoryBuffers()longgetMemoryCached()longgetMemoryFree()longgetMemoryShared()longgetMemoryTotal()longgetMemoryUsed()StringgetOsArch()StringgetOsName()StringgetOsVersion()StringgetProcessor()protected StringgetReadElfTag(String tag)StringgetRevision()StringgetSerial()protected booleanhasReadElfTag(String tag)booleanisHardFloatAbi()-
Methods inherited from class com.pi4j.system.impl.SystemInfoProviderBase
getBoardType, getClockFrequencyArm, getClockFrequencyCore, getClockFrequencyDPI, getClockFrequencyEMMC, getClockFrequencyH264, getClockFrequencyHDMI, getClockFrequencyISP, getClockFrequencyPixel, getClockFrequencyPWM, getClockFrequencyUART, getClockFrequencyV3D, getClockFrequencyVEC, getCodecH264Enabled, getCodecMPG2Enabled, getCodecWVC1Enabled, getCpuTemperature, getCpuVoltage, getMemoryVoltageSDRam_C, getMemoryVoltageSDRam_I, getMemoryVoltageSDRam_P, getModelName, getOsFirmwareBuild, getOsFirmwareDate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.pi4j.system.SystemInfoProvider
getBoardType, getClockFrequencyArm, getClockFrequencyCore, getClockFrequencyDPI, getClockFrequencyEMMC, getClockFrequencyH264, getClockFrequencyHDMI, getClockFrequencyISP, getClockFrequencyPixel, getClockFrequencyPWM, getClockFrequencyUART, getClockFrequencyV3D, getClockFrequencyVEC, getCodecH264Enabled, getCodecMPG2Enabled, getCodecWVC1Enabled, getCpuTemperature, getCpuVoltage, getMemoryVoltageSDRam_C, getMemoryVoltageSDRam_I, getMemoryVoltageSDRam_P, getModelName, getOsFirmwareBuild, getOsFirmwareDate
-
-
-
-
Method Detail
-
getCpuInfo
protected String getCpuInfo(String target) throws IOException, InterruptedException, UnsupportedOperationException
This method will read and parse the '/proc/cpuinfo' into a collection of properties.- Parameters:
target-- Returns:
- Throws:
IOExceptionInterruptedExceptionUnsupportedOperationException
-
getBashVersionInfo
protected String getBashVersionInfo()
-
hasReadElfTag
protected boolean hasReadElfTag(String tag)
-
getMemory
protected List<Long> getMemory() throws IOException, InterruptedException
- Throws:
IOExceptionInterruptedException
-
getProcessor
public String getProcessor() throws IOException, InterruptedException, UnsupportedOperationException
- Specified by:
getProcessorin interfaceSystemInfoProvider- Overrides:
getProcessorin classSystemInfoProviderBase- Throws:
IOExceptionInterruptedExceptionUnsupportedOperationException
-
getBogoMIPS
public String getBogoMIPS() throws IOException, InterruptedException, UnsupportedOperationException
- Specified by:
getBogoMIPSin interfaceSystemInfoProvider- Overrides:
getBogoMIPSin classSystemInfoProviderBase- Throws:
IOExceptionInterruptedExceptionUnsupportedOperationException
-
getCpuFeatures
public String[] getCpuFeatures() throws IOException, InterruptedException, UnsupportedOperationException
- Specified by:
getCpuFeaturesin interfaceSystemInfoProvider- Overrides:
getCpuFeaturesin classSystemInfoProviderBase- Throws:
IOExceptionInterruptedExceptionUnsupportedOperationException
-
getCpuImplementer
public String getCpuImplementer() throws IOException, InterruptedException, UnsupportedOperationException
- Specified by:
getCpuImplementerin interfaceSystemInfoProvider- Overrides:
getCpuImplementerin classSystemInfoProviderBase- Throws:
IOExceptionInterruptedExceptionUnsupportedOperationException
-
getCpuArchitecture
public String getCpuArchitecture() throws IOException, InterruptedException, UnsupportedOperationException
- Specified by:
getCpuArchitecturein interfaceSystemInfoProvider- Overrides:
getCpuArchitecturein classSystemInfoProviderBase- Throws:
IOExceptionInterruptedExceptionUnsupportedOperationException
-
getCpuVariant
public String getCpuVariant() throws IOException, InterruptedException, UnsupportedOperationException
- Specified by:
getCpuVariantin interfaceSystemInfoProvider- Overrides:
getCpuVariantin classSystemInfoProviderBase- Throws:
IOExceptionInterruptedExceptionUnsupportedOperationException
-
getCpuPart
public String getCpuPart() throws IOException, InterruptedException, UnsupportedOperationException
- Specified by:
getCpuPartin interfaceSystemInfoProvider- Overrides:
getCpuPartin classSystemInfoProviderBase- Throws:
IOExceptionInterruptedExceptionUnsupportedOperationException
-
getCpuRevision
public String getCpuRevision() throws IOException, InterruptedException, UnsupportedOperationException
- Specified by:
getCpuRevisionin interfaceSystemInfoProvider- Overrides:
getCpuRevisionin classSystemInfoProviderBase- Throws:
IOExceptionInterruptedExceptionUnsupportedOperationException
-
getHardware
public String getHardware() throws IOException, InterruptedException, UnsupportedOperationException
- Specified by:
getHardwarein interfaceSystemInfoProvider- Overrides:
getHardwarein classSystemInfoProviderBase- Throws:
IOExceptionInterruptedExceptionUnsupportedOperationException
-
getRevision
public String getRevision() throws IOException, InterruptedException, UnsupportedOperationException
- Specified by:
getRevisionin interfaceSystemInfoProvider- Overrides:
getRevisionin classSystemInfoProviderBase- Throws:
IOExceptionInterruptedExceptionUnsupportedOperationException
-
getSerial
public String getSerial() throws IOException, InterruptedException, UnsupportedOperationException
- Specified by:
getSerialin interfaceSystemInfoProvider- Overrides:
getSerialin classSystemInfoProviderBase- Throws:
IOExceptionInterruptedExceptionUnsupportedOperationException
-
getOsName
public String getOsName() throws UnsupportedOperationException
- Specified by:
getOsNamein interfaceSystemInfoProvider- Overrides:
getOsNamein classSystemInfoProviderBase- Throws:
UnsupportedOperationException
-
getOsVersion
public String getOsVersion() throws UnsupportedOperationException
- Specified by:
getOsVersionin interfaceSystemInfoProvider- Overrides:
getOsVersionin classSystemInfoProviderBase- Throws:
UnsupportedOperationException
-
getOsArch
public String getOsArch() throws UnsupportedOperationException
- Specified by:
getOsArchin interfaceSystemInfoProvider- Overrides:
getOsArchin classSystemInfoProviderBase- Throws:
UnsupportedOperationException
-
getJavaVendor
public String getJavaVendor() throws UnsupportedOperationException
- Specified by:
getJavaVendorin interfaceSystemInfoProvider- Overrides:
getJavaVendorin classSystemInfoProviderBase- Throws:
UnsupportedOperationException
-
getJavaVendorUrl
public String getJavaVendorUrl() throws UnsupportedOperationException
- Specified by:
getJavaVendorUrlin interfaceSystemInfoProvider- Overrides:
getJavaVendorUrlin classSystemInfoProviderBase- Throws:
UnsupportedOperationException
-
getJavaVersion
public String getJavaVersion() throws UnsupportedOperationException
- Specified by:
getJavaVersionin interfaceSystemInfoProvider- Overrides:
getJavaVersionin classSystemInfoProviderBase- Throws:
UnsupportedOperationException
-
getJavaVirtualMachine
public String getJavaVirtualMachine() throws UnsupportedOperationException
- Specified by:
getJavaVirtualMachinein interfaceSystemInfoProvider- Overrides:
getJavaVirtualMachinein classSystemInfoProviderBase- Throws:
UnsupportedOperationException
-
getJavaRuntime
public String getJavaRuntime() throws UnsupportedOperationException
- Specified by:
getJavaRuntimein interfaceSystemInfoProvider- Overrides:
getJavaRuntimein classSystemInfoProviderBase- Throws:
UnsupportedOperationException
-
isHardFloatAbi
public boolean isHardFloatAbi() throws UnsupportedOperationException- Specified by:
isHardFloatAbiin interfaceSystemInfoProvider- Overrides:
isHardFloatAbiin classSystemInfoProviderBase- Throws:
UnsupportedOperationException
-
getMemoryTotal
public long getMemoryTotal() throws IOException, InterruptedException, UnsupportedOperationException- Specified by:
getMemoryTotalin interfaceSystemInfoProvider- Overrides:
getMemoryTotalin classSystemInfoProviderBase- Throws:
IOExceptionInterruptedExceptionUnsupportedOperationException
-
getMemoryUsed
public long getMemoryUsed() throws IOException, InterruptedException, UnsupportedOperationException- Specified by:
getMemoryUsedin interfaceSystemInfoProvider- Overrides:
getMemoryUsedin classSystemInfoProviderBase- Throws:
IOExceptionInterruptedExceptionUnsupportedOperationException
-
getMemoryFree
public long getMemoryFree() throws IOException, InterruptedException, UnsupportedOperationException- Specified by:
getMemoryFreein interfaceSystemInfoProvider- Overrides:
getMemoryFreein classSystemInfoProviderBase- Throws:
IOExceptionInterruptedExceptionUnsupportedOperationException
-
getMemoryShared
public long getMemoryShared() throws IOException, InterruptedException, UnsupportedOperationException- Specified by:
getMemorySharedin interfaceSystemInfoProvider- Overrides:
getMemorySharedin classSystemInfoProviderBase- Throws:
IOExceptionInterruptedExceptionUnsupportedOperationException
-
getMemoryBuffers
public long getMemoryBuffers() throws IOException, InterruptedException, UnsupportedOperationException- Specified by:
getMemoryBuffersin interfaceSystemInfoProvider- Overrides:
getMemoryBuffersin classSystemInfoProviderBase- Throws:
IOExceptionInterruptedExceptionUnsupportedOperationException
-
getMemoryCached
public long getMemoryCached() throws IOException, InterruptedException, UnsupportedOperationException- Specified by:
getMemoryCachedin interfaceSystemInfoProvider- Overrides:
getMemoryCachedin classSystemInfoProviderBase- Throws:
IOExceptionInterruptedExceptionUnsupportedOperationException
-
-