com.phoenix_int.aserver.util
Class PHXProcessInfo

java.lang.Object
  extended by com.phoenix_int.aserver.util.PHXProcessInfo

public class PHXProcessInfo
extends java.lang.Object

This class represents information about a running process on the system. It includes static members for listing all processes. This is done in a semi- platform independant way by using and external program which is platform dependent (although fairly consistent on UNIX'es, ps). See PHXRuntime and PHXProcess for other convenient ways to use this information. Note that not all platforms will have all information available.


Constructor Summary
protected PHXProcessInfo()
          Constructs an empty process
 
Method Summary
 java.lang.String getCommand()
          Returns the command name of this process
 long getElapsedTime()
          returns the wall clock time for this process, if available
 long getMemUsage()
          Gets the memory usage of this process, if available
 int getParentProcessID()
          Gets the parent process ID of this process
 float getPercentCPU()
          Gets the percentage of the CPU usage, if available
static PHXProcessInfo[] getProcesses()
          lists all processes on the system
static PHXProcessInfo[] getProcesses(int parent)
          Lists the specified process' chillin (children).
 int getProcessID()
          Gets the platform dependeng process ID number
 long getTime()
          Returns the amount of CPU time this process has used, in ???
static void main(java.lang.String[] args)
           
 java.lang.String toString()
          Converts this process infor into a one-line readable string
 java.lang.String toXML()
          Converts this process information into a usable XML description
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PHXProcessInfo

protected PHXProcessInfo()
Constructs an empty process

Method Detail

getProcesses

public static PHXProcessInfo[] getProcesses(int parent)
                                     throws java.io.IOException
Lists the specified process' chillin (children).

Throws:
java.io.IOException

getProcesses

public static PHXProcessInfo[] getProcesses()
                                     throws java.io.IOException
lists all processes on the system

Throws:
java.io.IOException

getCommand

public java.lang.String getCommand()
Returns the command name of this process


getProcessID

public int getProcessID()
Gets the platform dependeng process ID number


getParentProcessID

public int getParentProcessID()
Gets the parent process ID of this process


getPercentCPU

public float getPercentCPU()
Gets the percentage of the CPU usage, if available


getMemUsage

public long getMemUsage()
Gets the memory usage of this process, if available


getTime

public long getTime()
Returns the amount of CPU time this process has used, in ???, if available.


getElapsedTime

public long getElapsedTime()
returns the wall clock time for this process, if available


toXML

public java.lang.String toXML()
Converts this process information into a usable XML description


toString

public java.lang.String toString()
Converts this process infor into a one-line readable string

Overrides:
toString in class java.lang.Object

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Throws:
java.io.IOException