KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > container > monitor > jvm > v14 > OperatingSystemInfoImpl


1 /***************************************************************************
2  * Copyright 2001-2003 The eXo Platform SARL All rights reserved. *
3  * Please look at license.txt in info directory for more license detail. *
4  **************************************************************************/

5 package org.exoplatform.container.monitor.jvm.v14;
6
7
8 import java.net.URL JavaDoc;
9 import org.exoplatform.container.monitor.jvm.OperatingSystemInfo;
10 /**
11  * @author Tuan Nguyen (tuan08@users.sourceforge.net)
12  * @since Nov 8, 2004
13  * @version $Id$
14  */

15 public class OperatingSystemInfoImpl implements OperatingSystemInfo {
16   
17   public OperatingSystemInfoImpl() {
18   }
19   
20   public String JavaDoc getArch() { return "N/A" ; }
21
22   public String JavaDoc getName() { return "N/A" ; }
23   
24   public String JavaDoc getVersion() { return "N/A" ;}
25   
26   public int getAvailableProcessors() { return -1 ; }
27   
28   public URL JavaDoc createURL(String JavaDoc file) throws Exception JavaDoc {
29     return new URL JavaDoc("file:" + file) ;
30   }
31   
32   public String JavaDoc toString() {
33     StringBuffer JavaDoc b = new StringBuffer JavaDoc() ;
34     b.append("Operating System: ").append(getName()).append("\n") ;
35     b.append("Operating System Version : ").append(getVersion()).append("\n") ;
36     b.append("CPU Achitechure : ").append(getArch()).append("\n") ;
37     b.append("Number of Processors : ").append(getAvailableProcessors()).append("\n") ;
38     return b.toString() ;
39   }
40 }
Popular Tags