You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by bl...@apache.org on 2002/09/26 20:22:07 UTC

cvs commit: jakarta-avalon-excalibur/event/src/xdocs util-howto.xml menu.xml

bloritsch    2002/09/26 11:22:06

  Modified:    event/src/xdocs menu.xml
  Added:       event/src/xdocs util-howto.xml
  Log:
  Add howto for SystemUtil
  
  Revision  Changes    Path
  1.7       +5 -2      jakarta-avalon-excalibur/event/src/xdocs/menu.xml
  
  Index: menu.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/event/src/xdocs/menu.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- menu.xml	26 Sep 2002 01:01:45 -0000	1.6
  +++ menu.xml	26 Sep 2002 18:22:06 -0000	1.7
  @@ -17,15 +17,18 @@
         <item href="thread.html" name="Thread"/>
         <item href="util.html" name="Util"/>
       </menu>
  -<!--
  +
       <menu name="How To">
  +<!--
         <item href="event-howto.html" name="Use Event Queues"/>
         <item href="command-howto.html" name="Use the Command Manager"/>
         <item href="mpool-howto.html" name="Use MPool"/>
         <item href="thread-howto.html" name="Use Thread Pools"/>
  +-->
         <item href="util-howto.html" name="Use System Util"/>
  +<!--
         <item href="cpuparser-howto.html" name="Extend System Util"/>
  +-->
       </menu>
  -  -->
     </body>
   </project>
  
  
  
  1.1                  jakarta-avalon-excalibur/event/src/xdocs/util-howto.xml
  
  Index: util-howto.xml
  ===================================================================
  <?xml version="1.0"?>
  
  <document>
    <header>
      <title>Excalibur Event - How To Use Util</title>
      <authors>
        <person name="Berin Loritsch" email="bloritsch@apache.org"/>
      </authors>
    </header>
    <body>
      <s1 title="Getting the System Info">
        <p>
          Util has one utility: SystemUtil.  SystemUtil is a static
          class that performs its magic when the class is loaded.
          It stores the information because it is unlikely that you
          will ever go from one to two processors while your machine
          is running.  The code snippet below demonstrates how to
          get any and all the relavant information:
        </p>
        <source>
  <![CDATA[
  public void dumpInfo()
  {
      System.out.println( "Number of Processors: " + SystemUtil.numProcessors() );
      System.out.println( "CPU Info:             " + SystemUtil.cpuInfo() );
      System.out.println( "Architecture:         " + SystemUtil.architecture() );
      System.out.println( "Operating System:     " + SystemUtil.operatingSystem() );
      System.out.println( "OS Version:           " + SystemUtil.osVersion() );
  }
  ]]>
        </source>
        <p>
          As you can see there is no real mystery here.  The method above
          uses every available SystemUtil method, and it is taken directly
          from the JUnit TestCase for SystemUtil.
        </p>
      </s1>
    </body>
    <footer>
      <legal>
        Copyright (c) @year@ The Jakarta Apache Project All rights reserved.
        $Revision: 1.1 $ $Date: 2002/09/26 18:22:06 $
      </legal>
    </footer>
  </document>
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>