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

	"@(#)README 3.3 99/03/23 SMI"

	Copyright (c) 03/23/99, by Sun Microsystems, Inc.
	All rights reserved.

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

			Monitor Example
			===============


-----------------------------------------------------------------------
1. Example overview
-----------------------------------------------------------------------
This example shows how the counter and gauge monitors can be used to 
observe the property values of a specific m-beans properties and receive
events according to changes in the values of these m-bean properties.

The current directory contains the following source files:
   * Client.java:
	- Implements a simple manager.	
	- Sets up communication using the RMI adaptor client
	  to connect to the agent.
	- Gets a handle on an m-bean from the remote agent.
	- Instantiates, registers and configures a counter monitor in the
	  remote agent. It monitors the value of the NbObjects property 
	  in the AskMe m-bean and emits an event when the comparison
	  level is reached. It also increases the comparison level by 
	  an offset when the comparison level is reached.
	- Instantiates, registers and configures a gauge monitor in the
	  remote agent. It monitors the value of the FreeMem property in 
	  the AskMe m-bean and emits an event when the value exceeds 
	  or falls below a predefined value.
	- Instantiates and registers a listener for receiving monitor events. 

   * ClientListener.java:
	- Implements the MonitorListenerMO event listener interface for
	  receiving events of type MonitorEventMO emitted by monitors.

   * MbeanCreator.java:
	- Creates 30 instances of the Simple m-bean in a remote agent.

   * AskMe.java:
	- Implements a simple m-bean.
        - Uses the m-bean specific method initCmf to register an m-bean 
	  with the framework. This method makes it possible
          for an m-bean to change itself and its environment.
	- Contains a read-only m-bean property.


-----------------------------------------------------------------------
2. Building and running the example
-----------------------------------------------------------------------
To build the monitor1 example, copy the example source files to your 
working directory and type the following commands:

   cd <WORKING_DIR>

   javac -d . AskMe.java Simple.java

   mogen AskMe Simple

   javac -d . *.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 manager:

   java Client
