1 17 package org.apache.excalibur.util.system; 18 19 import java.io.BufferedReader ; 20 import java.io.InputStreamReader ; 21 22 import org.apache.excalibur.util.CPUParser; 23 24 32 public final class Windows95 implements CPUParser 33 { 34 private final int m_processors = 1; 35 private final String m_cpuInfo; 36 37 public Windows95() 38 { 39 String info = ""; 40 41 try 42 { 43 Runtime rt = Runtime.getRuntime(); 45 Process proc = rt.exec( "command.com /C echo %PROCESSOR_IDENTIFIER%" ); 46 BufferedReader reader = new BufferedReader ( new InputStreamReader ( proc.getInputStream() ) ); 47 info = reader.readLine(); 48 } 49 catch( Exception e ) 50 { 51 } 52 53 m_cpuInfo = info; 54 } 55 56 59 public int numProcessors() 60 { 61 return m_processors; 62 } 63 64 70 public String cpuInfo() 71 { 72 return m_cpuInfo; 73 } 74 } 75 76 | Popular Tags |