-----------------------------------------------------------------------

	"@(#)README 1.0 98/09/21 SMI"

	Copyright (c) 09/21/98, by Sun Microsystems, Inc.
	All rights reserved.

-----------------------------------------------------------------------

			Kstat Example
			==============


-----------------------------------------------------------------------
1. Example overview
-----------------------------------------------------------------------
This example runs only on machines with Solaris Os.
The current directory contains the following source files:
   * build.java
	- This class automatically generates a M-bean for any kernel information 
	  that can be accessed using the kstat interface. It takes as input a 
	  module name and instance name and generates the associated Java M-bean.	  	

   * KernelStat.java
	- This class contains the JNI interface for Kernel Statistics based on the 
	  Solaris kstat(3K) interface. The native library implementing the native 
	  methods is libstat.so provided under:
	 /opt/SUNWconn/jaw/lib/Solaris/sparc/2.x/lib/libstat.so

   * le0.java
   * cpu_info0.java
   * cpu_info1.java	
   * hme0.java
   * rpc_server.java	
	- These are examples M-beans generated by the "build" class, for 
	  <module name>=le, <instance name>=le0
	  <module name>=cpu_info, <instance name>=cpu_info0 
	  <module name>=hme, <instance name>=hme0
	  <module name>=unix, <instance name>=rpc_server

For information on the Solaris kstat library and the way to use it you can do :
man -s 3K kstat.

  
The following script file:
   * doit
 	- This script takes as input a module name and an instance name.
	  It invokes the "build" program with this input. It invokes then
	  "mogen" for each M-bean generated by the "build" program. It 
	  compiles the generated M-bean and the objects created by mogen.
	  
   

-----------------------------------------------------------------------
2. Running the precompiled version
-----------------------------------------------------------------------
To run the precompiled version of the example, type the following 
commands:

   setenv CLASSPATH /opt/SUNWconn/jaw/examples/classes:/opt/SUNWconn/jaw/classes/jawco.jar:/opt/SUNWconn/jaw/classes/jawag.jar:/opt/SUNWconn/jaw/classes/jawcl.jar:/opt/SUNWconn/jaw/classes/jawcs.jar:/opt/SUNWconn/jaw/classes/jawtk.jar

   setenv LD_LIBRARY_PATH /opt/SUNWconn/jaw/lib/

   # Make sure that no agents are already running 
   # and start the Java DMK base agent:

   jaw start

   # Start the Kstat example

   doit <kstat module name> <kstat instance name>


-----------------------------------------------------------------------
3. Building and running your own version
-----------------------------------------------------------------------
To build your own version of the example, copy the example source files 
to your working directory and type the following commands:

   cd <WORKING_DIR>

   setenv CLASSPATH .:/opt/SUNWconn/jaw/examples/classes:/opt/SUNWconn/jaw/classes/jawco.jar:/opt/SUNWconn/jaw/classes/jawag.jar:/opt/SUNWconn/jaw/classes/jawcl.jar:/opt/SUNWconn/jaw/classes/jawcs.jar:/opt/SUNWconn/jaw/classes/jawtk.jar

    javac -d . build.java
    javac -d . KernelStat.java

To run the version of the example you have just built, type the 
following commands:

   # Make sure that no agents are already running 
   # and start the Java DMK base agent:

   jaw start

   # Start the kstat example

   doit <kstat module name> <kstat instance name>
