healthMonitor
Class HealthMonitor

java.lang.Object
  extended by healthMonitor.HealthMonitor
All Implemented Interfaces:
EventListener, NotificationListener

public class HealthMonitor
extends Object
implements NotificationListener

This class is a JMX client application that connects to the GemFire JMX Agent via the RMIConnector defined in JSR 160 to monitor the health of a GemFire distributed system.

Since:
3.5
Author:
GemStone Systems, Inc.

Constructor Summary
HealthMonitor()
           
 
Method Summary
 void disconnect()
          Stops the example application and cleans up the connection to the GemFire JMX Agent.
 void go()
          Adds a shutdown hook and loops until user hits CTRL-C.
 void handleNotification(Notification notification, Object handback)
          Receives JMX Notifications by handling gemfire membership notifications, gemfire alert notifications, and notifications that the gemfire health attribute has changed.
 void initialize(String host, int port, String propsFileName)
          Connects to the GemFire JMX Agent and configures the settings for this example application.
static void main(String[] args)
          Parses the command line and runs the HealthMonitor example.
static String makeCompliantMBeanNameProperty(String value)
          Replaces illegal characters in string with '-' to ensure that the string can be used for an MBean's ObjectName property value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HealthMonitor

public HealthMonitor()
Method Detail

go

public void go()
Adds a shutdown hook and loops until user hits CTRL-C. JMX Notifications will be coming in on a separate thread.


disconnect

public void disconnect()
Stops the example application and cleans up the connection to the GemFire JMX Agent.


initialize

public void initialize(String host,
                       int port,
                       String propsFileName)
                throws Exception
Connects to the GemFire JMX Agent and configures the settings for this example application.

Throws:
Exception

handleNotification

public void handleNotification(Notification notification,
                               Object handback)
Receives JMX Notifications by handling gemfire membership notifications, gemfire alert notifications, and notifications that the gemfire health attribute has changed. This example simply prints a line to System.out and makes sure that health MBeans are registered for any host that has GemFire system member(s).

Specified by:
handleNotification in interface NotificationListener

makeCompliantMBeanNameProperty

public static String makeCompliantMBeanNameProperty(String value)
Replaces illegal characters in string with '-' to ensure that the string can be used for an MBean's ObjectName property value.


main

public static void main(String[] args)
                 throws Exception
Parses the command line and runs the HealthMonitor example.

Throws:
Exception


Copyright © 2002-2008 GemStone Systems, Inc. All Rights Reserved.