|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.rhq.core.system.NativeSystemInfo
public class NativeSystemInfo
The superclass for all the native SystemInfo
implementations. You are free to subclass this implementation if
there are additional platform-specific methods that need to be exposed. Most functionality, however, can be exposed
via this native superclass implementation.
This implementation uses SIGAR. To enable debug logging in SIGAR, set the system property "sigar.nativeLogging" or
call Sigar.enableLogging(boolean)
.
Method Summary | |
---|---|
ProcessExecutionResults |
executeProcess(ProcessExecution processExecution)
Executes a process. |
List<NetworkAdapterInfo> |
getAllNetworkAdapters()
Returns the information on all installed network adapters. |
List<ProcessInfo> |
getAllProcesses()
Returns the information on all processes found in the process table. |
List<ServiceInfo> |
getAllServices()
Returns the information on all installed services found in the services manager. |
CpuInformation |
getCpu(int cpuIndex)
Returns information about a specified CPU installed on the hardware where the JVM is running. |
FileSystemInfo |
getFileSystem(String path)
Returns information on the mounted file system that hosts the given file or directory. |
List<FileSystemInfo> |
getFileSystems()
Returns information on all mounted file systems. |
String |
getHostname()
Returns the hostname that the system is known as. |
org.hyperic.sigar.Mem |
getMemoryInfo()
Returns information about memory installed on the platform. |
NetworkAdapterStats |
getNetworkAdapterStats(String interfaceName)
|
NetworkStats |
getNetworkStats(String addressName,
int port)
|
int |
getNumberOfCpus()
Returns the number of CPUs on the hardware platform. |
String |
getOperatingSystemName()
Returns the name of the operating system. |
OperatingSystemType |
getOperatingSystemType()
Returns the operating system type, if known; otherwise, OperatingSystemType.JAVA is returned (in which
case, the caller can examine the Java system property "os.name" to try to detect the type). |
String |
getOperatingSystemVersion()
Returns the version string of the operating system, as reported by the operating system. |
List<ProcessInfo> |
getProcesses(String piq)
Returns ProcessInfo objects for all processes that match the provided PIQL query string |
org.hyperic.sigar.Swap |
getSwapInfo()
Returns information about the virtual, swap memory installed on the platform. |
String |
getSystemArchitecture()
Returns the architecture of the underlying hardware |
ProcessInfo |
getThisProcess()
Returns the process information for the Java VM process this object is running in. |
boolean |
isNative()
Always returns true to indicate that the native library is available. |
String |
readLineFromConsole(boolean noEcho)
Reads a line of input from the console and returns that line as a string. |
void |
writeLineToConsole(String line)
Writes a line of output to the console. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public boolean isNative()
true
to indicate that the native library is available.
isNative
in interface SystemInfo
true
if there is a low-level native API available for the JVM's platformSystemInfo.isNative()
public OperatingSystemType getOperatingSystemType()
SystemInfo
OperatingSystemType.JAVA
is returned (in which
case, the caller can examine the Java system property "os.name" to try to detect the type).
getOperatingSystemType
in interface SystemInfo
public String getOperatingSystemName()
SystemInfo
getOperatingSystemName
in interface SystemInfo
public String getOperatingSystemVersion()
SystemInfo
getOperatingSystemVersion
in interface SystemInfo
public String getHostname() throws SystemInfoException
SystemInfo
getHostname
in interface SystemInfo
SystemInfoException
public List<NetworkAdapterInfo> getAllNetworkAdapters() throws SystemInfoException
SystemInfo
getAllNetworkAdapters
in interface SystemInfo
SystemInfoException
public NetworkAdapterStats getNetworkAdapterStats(String interfaceName)
getNetworkAdapterStats
in interface SystemInfo
public NetworkStats getNetworkStats(String addressName, int port)
getNetworkStats
in interface SystemInfo
public List<ServiceInfo> getAllServices() throws SystemInfoException
SystemInfo
getAllServices
in interface SystemInfo
SystemInfoException
public List<ProcessInfo> getAllProcesses()
SystemInfo
getAllProcesses
in interface SystemInfo
public List<ProcessInfo> getProcesses(String piq)
SystemInfo
getProcesses
in interface SystemInfo
piq
- the PIQL query string
public ProcessInfo getThisProcess()
SystemInfo
getThisProcess
in interface SystemInfo
public ProcessExecutionResults executeProcess(ProcessExecution processExecution)
SystemInfo
executeProcess
in interface SystemInfo
processExecution
- the settings on how to execute the process
public int getNumberOfCpus()
SystemInfo
getNumberOfCpus
in interface SystemInfo
public org.hyperic.sigar.Mem getMemoryInfo()
SystemInfo
getMemoryInfo
in interface SystemInfo
@Nullable public org.hyperic.sigar.Swap getSwapInfo()
SystemInfo
getSwapInfo
in interface SystemInfo
public String readLineFromConsole(boolean noEcho) throws IOException
SystemInfo
true
as the value to noEcho
.
noEcho
is a hint and not guaranteed to work since some implementations (like the Java-only fallback
implementation) will not be able to stop the console from echoing input.
readLineFromConsole
in interface SystemInfo
noEcho
- if true
, the implementation should try to not echo the input to the console
IOException
- if failed to read console inputpublic void writeLineToConsole(String line) throws IOException
SystemInfo
line
.
writeLineToConsole
in interface SystemInfo
IOException
public CpuInformation getCpu(int cpuIndex)
SystemInfo
getCpu
in interface SystemInfo
cpuIndex
- identifies the CPU whose information is to be returned; on a single-CPU system, the index must
be 0.
public List<FileSystemInfo> getFileSystems()
SystemInfo
getFileSystems
in interface SystemInfo
public FileSystemInfo getFileSystem(String path)
SystemInfo
getFileSystem
in interface SystemInfo
path
- the file or directory whose mounted file system should be returned
public String getSystemArchitecture()
SystemInfo
getSystemArchitecture
in interface SystemInfo
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |