etm.core.jmx
Class AbstractJmxRegistry

java.lang.Object
  extended by etm.core.jmx.AbstractJmxRegistry
All Implemented Interfaces:
AggregationListener, AggregationStateListener, EtmMonitorListener
Direct Known Subclasses:
EtmMonitorJmxPlugin

public class AbstractJmxRegistry
extends java.lang.Object
implements AggregationStateListener, AggregationListener

JMX base class. Registers an EtmMonitor on startup and performance measurements mbeans on demand.

By default the monitor will be available at DEFAULT_ETM_MONITOR_OBJECT_NAME and register performance details in the domain DEFAULT_ETM_POINT_DOMAIN. You may disable this behavior by setting setOverwrite(boolean) to true.

Since:
1.2.0
Version:
$Revision: 232 $
Author:
void.fm

Field Summary
static java.lang.String DEFAULT_ETM_MONITOR_OBJECT_NAME
           
static java.lang.String DEFAULT_ETM_POINT_DOMAIN
           
protected  EtmMonitor etmMonitor
           
protected  javax.management.MBeanServer mbeanServer
           
protected  java.lang.String mbeanServerName
           
protected  java.lang.String measurementDomain
           
protected  EtmMonitorMBean monitorMBean
           
protected  java.lang.String monitorObjectName
           
protected  boolean overwrite
           
 
Constructor Summary
AbstractJmxRegistry()
           
 
Method Summary
protected  javax.management.ObjectName calculateObjectName(java.lang.String measurementDomain, Aggregate aAggregate)
           
protected  void deregisterPerformanceResults()
           
 void onRootCreate(RootCreateEvent event)
           
 void onRootReset(RootResetEvent event)
           
 void onStateLoaded(AggregationStateLoadedEvent event)
           
 void onStateReset(MonitorResetEvent event)
           
 void preRootReset(PreRootResetEvent event)
           
 void preStateReset(PreMonitorResetEvent event)
           
protected  void registerMBean(javax.management.MBeanServer mbeanServer, javax.management.ObjectName objectName, java.lang.Object object, boolean overwrite)
           
 void setMbeanServerName(java.lang.String aMbeanServerName)
          Sets the name of the MBeanServer to use.
 void setMeasurementDomain(java.lang.String aMeasurementDomain)
          Sets the prefix for measurement results.
 void setMonitorObjectName(java.lang.String aMonitorObjectName)
          Sets the name to be used for Monitor registration.
 void setOverwrite(boolean flag)
          If a MBean is found under the given name the existing instance will be overwritten.
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_ETM_MONITOR_OBJECT_NAME

public static final java.lang.String DEFAULT_ETM_MONITOR_OBJECT_NAME
See Also:
Constant Field Values

DEFAULT_ETM_POINT_DOMAIN

public static final java.lang.String DEFAULT_ETM_POINT_DOMAIN
See Also:
Constant Field Values

monitorObjectName

protected java.lang.String monitorObjectName

measurementDomain

protected java.lang.String measurementDomain

mbeanServerName

protected java.lang.String mbeanServerName

overwrite

protected boolean overwrite

mbeanServer

protected javax.management.MBeanServer mbeanServer

etmMonitor

protected EtmMonitor etmMonitor

monitorMBean

protected EtmMonitorMBean monitorMBean
Constructor Detail

AbstractJmxRegistry

public AbstractJmxRegistry()
Method Detail

setMbeanServerName

public void setMbeanServerName(java.lang.String aMbeanServerName)
Sets the name of the MBeanServer to use. Default is null.

Parameters:
aMbeanServerName - The name.

setMonitorObjectName

public void setMonitorObjectName(java.lang.String aMonitorObjectName)
Sets the name to be used for Monitor registration. Default is DEFAULT_ETM_MONITOR_OBJECT_NAME

Parameters:
aMonitorObjectName - The JMX Object name to be used for registration.

setMeasurementDomain

public void setMeasurementDomain(java.lang.String aMeasurementDomain)
Sets the prefix for measurement results. Default is DEFAULT_ETM_POINT_DOMAIN

Parameters:
aMeasurementDomain - The prefix.

setOverwrite

public void setOverwrite(boolean flag)
If a MBean is found under the given name the existing instance will be overwritten. This behavior is enabled by default.

Parameters:
flag - True to overwrite, otherwhise false.

start

public void start()

stop

public void stop()

onStateLoaded

public void onStateLoaded(AggregationStateLoadedEvent event)
Specified by:
onStateLoaded in interface AggregationStateListener

onRootCreate

public void onRootCreate(RootCreateEvent event)
Specified by:
onRootCreate in interface AggregationListener

onStateReset

public void onStateReset(MonitorResetEvent event)
Specified by:
onStateReset in interface AggregationListener

onRootReset

public void onRootReset(RootResetEvent event)
Specified by:
onRootReset in interface AggregationListener

preRootReset

public void preRootReset(PreRootResetEvent event)
Specified by:
preRootReset in interface AggregationListener

preStateReset

public void preStateReset(PreMonitorResetEvent event)
Specified by:
preStateReset in interface AggregationListener

deregisterPerformanceResults

protected void deregisterPerformanceResults()
                                     throws javax.management.MalformedObjectNameException,
                                            javax.management.InstanceNotFoundException,
                                            javax.management.MBeanRegistrationException
Throws:
javax.management.MalformedObjectNameException
javax.management.InstanceNotFoundException
javax.management.MBeanRegistrationException

registerMBean

protected void registerMBean(javax.management.MBeanServer mbeanServer,
                             javax.management.ObjectName objectName,
                             java.lang.Object object,
                             boolean overwrite)
                      throws javax.management.JMException
Throws:
javax.management.JMException

calculateObjectName

protected javax.management.ObjectName calculateObjectName(java.lang.String measurementDomain,
                                                          Aggregate aAggregate)
                                                   throws javax.management.JMException
Throws:
javax.management.JMException


Copyright © 2004,2005, 2006, 2007 void.fm. All Rights Reserved.