dk.netarkivet.monitor.distribute
Class JMSMonitorRegistryClient

java.lang.Object
  extended by dk.netarkivet.monitor.distribute.JMSMonitorRegistryClient
All Implemented Interfaces:
MonitorRegistryClient, CleanupIF

public class JMSMonitorRegistryClient
extends java.lang.Object
implements MonitorRegistryClient, CleanupIF

The monitor registry client sends messages with JMS to register the host for JMX monitoring.


Method Summary
 void cleanup()
          Used to clean up a class from within a shutdown hook.
static JMSMonitorRegistryClient getInstance()
          Get the registry client singleton.
 void register(java.lang.String localHostName, int jmxPort, int rmiPort)
          Register this host for monitoring.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static JMSMonitorRegistryClient getInstance()
Get the registry client singleton.

Returns:
The registry client.

register

public void register(java.lang.String localHostName,
                     int jmxPort,
                     int rmiPort)
Register this host for monitoring. Once this method is called it will reregister for monitoring every minute, to ensure the scheduling is done. If called again, it will restart the timer that registers the host.

Specified by:
register in interface MonitorRegistryClient
Parameters:
localHostName - The name of the host.
jmxPort - The port for JMX connections to the host.
rmiPort - The port for RMI connections for JMX communication.
Throws:
ArgumentNotValid - on null or empty hostname, or negative port numbers.

cleanup

public void cleanup()
Used to clean up a class from within a shutdown hook. Must not do any logging. Program defensively, please.

Specified by:
cleanup in interface CleanupIF