|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.core.system.JavaSystemInfo
public class JavaSystemInfo
This is the "non-native" fallback implementation of a SystemInfo used in the case when there is no native
library available that can be used to obtain low-level system information. This implementation cannot provide all the
types of information that a true NativeSystemInfo implementation can - in the cases where this implementation
cannot provide the requested information, the UnsupportedOperationException exception will be thrown.
| Method Summary | |
|---|---|
ProcessExecutionResults |
executeProcess(ProcessExecution processExecution)
Spawns a new process using the Java Runtime API. |
List<NetworkAdapterInfo> |
getAllNetworkAdapters()
Returns partially filled NetworkAdapterInfo objects - only the data available via the Java API
(particularly the NetworkInterface class) will be available in the returned objects. |
List<ProcessInfo> |
getAllProcesses()
Throws UnsupportedOperationException since the Java API cannot obtain information about currently running
processes. |
List<ServiceInfo> |
getAllServices()
Throws UnsupportedOperationException since the Java API cannot obtain information about installed
services. |
CpuInformation |
getCpu(int cpuIndex)
Throws UnsupportedOperationException since the Java API cannot obtain information about CPUs. |
FileSystemInfo |
getFileSystem(String directory)
Throws UnsupportedOperationException since the Java API cannot obtain information about file systems. |
List<FileSystemInfo> |
getFileSystems()
Throws UnsupportedOperationException since the Java API cannot obtain information about file systems. |
String |
getHostname()
This returns the canonical hostname as it is known via the Java API InetAddress.getLocalHost(). |
org.hyperic.sigar.Mem |
getMemoryInfo()
Throws UnsupportedOperationException since the Java API cannot obtain information about low level memory
details. |
NetworkAdapterStats |
getNetworkAdapterStats(String interfaceName)
|
NetworkStats |
getNetworkStats(String addressName,
int port)
|
int |
getNumberOfCpus()
Throws UnsupportedOperationException since the Java API cannot obtain information about the number of
CPUs. |
String |
getOperatingSystemName()
Returns the value of the Java system property os.name. |
OperatingSystemType |
getOperatingSystemType()
Returns OperatingSystemType.JAVA unless the type can be determined via the Java "os.name" property. |
String |
getOperatingSystemVersion()
Returns the value of the Java system property os.version. |
List<ProcessInfo> |
getProcesses(String processInfoQuery)
Throws UnsupportedOperationException since the Java API cannot obtain information about processes. |
org.hyperic.sigar.Swap |
getSwapInfo()
Throws UnsupportedOperationException since the Java API cannot obtain information about low level swap
details. |
String |
getSystemArchitecture()
Returns the architecture of the underlying hardware |
ProcessInfo |
getThisProcess()
Throws UnsupportedOperationException since the Java API cannot obtain information about currently running
processes. |
boolean |
isNative()
Returns false - this implementation relies solely on the Java API to get all the system information
it can. |
String |
readLineFromConsole(boolean noEcho)
Reads from System.in. |
void |
writeLineToConsole(String line)
Writes to System.out. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public boolean isNative()
false - this implementation relies solely on the Java API to get all the system information
it can.
isNative in interface SystemInfotrue if there is a low-level native API available for the JVM's platformSystemInfo.isNative()public OperatingSystemType getOperatingSystemType()
OperatingSystemType.JAVA unless the type can be determined via the Java "os.name" property. The
caller can call getOperatingSystemName() to try to determine the real operating system type if this
method cannot.
getOperatingSystemType in interface SystemInfoSystemInfo.getOperatingSystemType()public String getOperatingSystemName()
os.name.
getOperatingSystemName in interface SystemInfoSystemInfo.getOperatingSystemName()public String getOperatingSystemVersion()
os.version.
getOperatingSystemVersion in interface SystemInfoSystemInfo.getOperatingSystemVersion()public String getHostname()
InetAddress.getLocalHost().
getHostname in interface SystemInfoSystemInfo.getHostname()
public List<NetworkAdapterInfo> getAllNetworkAdapters()
throws SystemInfoException
NetworkAdapterInfo objects - only the data available via the Java API
(particularly the NetworkInterface class) will be available in the returned objects.
getAllNetworkAdapters in interface SystemInfoSystemInfoExceptionSystemInfo.getAllServices()
public List<ServiceInfo> getAllServices()
throws UnsupportedOperationException
UnsupportedOperationException since the Java API cannot obtain information about installed
services.
getAllServices in interface SystemInfoUnsupportedOperationExceptionSystemInfo.getAllServices()
public List<ProcessInfo> getAllProcesses()
throws UnsupportedOperationException
UnsupportedOperationException since the Java API cannot obtain information about currently running
processes.
getAllProcesses in interface SystemInfoUnsupportedOperationExceptionSystemInfo.getAllProcesses()public List<ProcessInfo> getProcesses(String processInfoQuery)
UnsupportedOperationException since the Java API cannot obtain information about processes.
getProcesses in interface SystemInfoprocessInfoQuery - the PIQL query string
SystemInfo.getProcesses(String)public ProcessInfo getThisProcess()
UnsupportedOperationException since the Java API cannot obtain information about currently running
processes.
getThisProcess in interface SystemInfoSystemInfo.getThisProcess()public ProcessExecutionResults executeProcess(ProcessExecution processExecution)
executeProcess in interface SystemInfoprocessExecution - the settings on how to execute the process
SystemInfo.executeProcess(ProcessExecution)public int getNumberOfCpus()
UnsupportedOperationException since the Java API cannot obtain information about the number of
CPUs.
getNumberOfCpus in interface SystemInfoSystemInfo.getNumberOfCpus()public org.hyperic.sigar.Mem getMemoryInfo()
UnsupportedOperationException since the Java API cannot obtain information about low level memory
details.
getMemoryInfo in interface SystemInfoSystemInfo.getMemoryInfo()public org.hyperic.sigar.Swap getSwapInfo()
UnsupportedOperationException since the Java API cannot obtain information about low level swap
details.
getSwapInfo in interface SystemInfoSystemInfo.getSwapInfo()
public String readLineFromConsole(boolean noEcho)
throws IOException
System.in.
readLineFromConsole in interface SystemInfonoEcho - if true, the implementation should try to not echo the input to the console
IOException - if failed to read console inputSystemInfo.readLineFromConsole(boolean)
public void writeLineToConsole(String line)
throws IOException
System.out.
writeLineToConsole in interface SystemInfoIOExceptionSystemInfo.writeLineToConsole(String)public CpuInformation getCpu(int cpuIndex)
UnsupportedOperationException since the Java API cannot obtain information about CPUs.
getCpu in interface SystemInfocpuIndex - identifies the CPU whose information is to be returned; on a single-CPU system, the index must
be 0.
SystemInfo.getCpu(int)public List<FileSystemInfo> getFileSystems()
UnsupportedOperationException since the Java API cannot obtain information about file systems.
getFileSystems in interface SystemInfoSystemInfo.getFileSystems()public FileSystemInfo getFileSystem(String directory)
UnsupportedOperationException since the Java API cannot obtain information about file systems.
getFileSystem in interface SystemInfodirectory - the file or directory whose mounted file system should be returned
SystemInfo.getFileSystem(String)public NetworkAdapterStats getNetworkAdapterStats(String interfaceName)
getNetworkAdapterStats in interface SystemInfo
public NetworkStats getNetworkStats(String addressName,
int port)
getNetworkStats in interface SystemInfopublic String getSystemArchitecture()
SystemInfo
getSystemArchitecture in interface SystemInfo
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||