org.apache.excalibur.util.system
Class Linux

java.lang.Object
  extended by org.apache.excalibur.util.system.Linux
All Implemented Interfaces:
CPUParser

public final class Linux
extends java.lang.Object
implements CPUParser

Parses the Linux environment--Uses the proc filesystem to determine all the CPU information.

Version:
CVS $Revision: 1.4 $ $Date: 2004/02/28 11:47:29 $
Author:
Avalon Development Team

Field Summary
private  java.lang.String m_cpuInfo
           
private  int m_processors
           
 
Constructor Summary
Linux()
           
 
Method Summary
 java.lang.String cpuInfo()
          Return the cpu info for the processors (assuming symetric multiprocessing which means that all CPUs are identical).
 int numProcessors()
          Return the number of processors available on the machine
private static java.lang.String[] split(java.lang.String string, java.lang.String onToken)
          Splits the string on every token into an array of strings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_processors

private final int m_processors

m_cpuInfo

private final java.lang.String m_cpuInfo
Constructor Detail

Linux

public Linux()
Method Detail

numProcessors

public int numProcessors()
Return the number of processors available on the machine

Specified by:
numProcessors in interface CPUParser

cpuInfo

public java.lang.String cpuInfo()
Return the cpu info for the processors (assuming symetric multiprocessing which means that all CPUs are identical). The format is: ${arch} family ${family} Model ${model} Stepping ${stepping}, ${identifier}

Specified by:
cpuInfo in interface CPUParser

split

private static final java.lang.String[] split(java.lang.String string,
                                              java.lang.String onToken)
Splits the string on every token into an array of strings.

Parameters:
string - the string
onToken - the token
Returns:
the resultant array