Package javax.management.monitor

Examples of javax.management.monitor.GaugeMonitor.addObservedObject()


      e.printStackTrace();
    }   
  }
  public void createGaugeMonitor(ObjectName objectName,String serviceName,Long monitoringFrequency,Long thresholdHigh,Long thresholdLow){
    GaugeMonitor gm = new GaugeMonitor();
    gm.addObservedObject(objectName);
    gm.setObservedAttribute("LastResponseTime");
    gm.setGranularityPeriod(monitoringFrequency);
    gm.setNotifyHigh(true);
    gm.setNotifyLow(true);
    gm.setThresholds(thresholdHigh,thresholdLow);
View Full Code Here


        monitorMBean.setNotifyHigh(true);
        monitorMBean.setNotifyLow(true);

        monitorMBean.setDifferenceMode(false);
        // Setup the monitor: link to the service MBean
        monitorMBean.addObservedObject(serviceName);
        monitorMBean.setObservedAttribute("SimpleCounter");
        // Setup the monitor: a short granularity period
        monitorMBean.setGranularityPeriod(50L);
        // Setup the monitor: register a listener
        MBeanServerConnection connection = connector.getMBeanServerConnection();
View Full Code Here

      monitorMBean.setNotifyHigh(true);
      monitorMBean.setNotifyLow(true);
      // Setup the monitor: we're interested in absolute values of the number of clients
      monitorMBean.setDifferenceMode(false);
      // Setup the monitor: link to the service MBean
      monitorMBean.addObservedObject(serviceName);
      monitorMBean.setObservedAttribute("ConcurrentClients");
      // Setup the monitor: a short granularity period
      monitorMBean.setGranularityPeriod(50L);
      // Setup the monitor: register a listener
      monitorMBean.addNotificationListener(new NotificationListener()
View Full Code Here

      ObjectName monitorName = new ObjectName(":monitor=gauge");

      MBeanServer server = newMBeanServer();
      GaugeMonitor monitor = (GaugeMonitor)createMonitor();
      monitor.setDifferenceMode(true);
      monitor.addObservedObject(name);
      monitor.setObservedAttribute("Integer");
      int period = 1000;
      monitor.setGranularityPeriod(period);
      Integer high = new Integer(10);
      Integer low = new Integer(5);
View Full Code Here

      ObjectName monitorName = new ObjectName(":monitor=gauge");

      MBeanServer server = newMBeanServer();
      GaugeMonitor monitor = (GaugeMonitor)createMonitor();
      monitor.setDifferenceMode(true);
      monitor.addObservedObject(name);
      monitor.setObservedAttribute("Integer");
      int period = 1000;
      monitor.setGranularityPeriod(period);
      Integer high = new Integer(5);
      Integer low = new Integer(0);
View Full Code Here

      ObjectName monitorName = new ObjectName(":monitor=gauge");

      MBeanServer server = newMBeanServer();
      GaugeMonitor monitor = (GaugeMonitor)createMonitor();
      monitor.setDifferenceMode(false);
      monitor.addObservedObject(name);
      monitor.setObservedAttribute("Integer");
      int period = 1000;
      monitor.setGranularityPeriod(period);
      server.registerMBean(monitor, monitorName);
View Full Code Here

        monitorMBean.setNotifyHigh(true);
        monitorMBean.setNotifyLow(true);

        monitorMBean.setDifferenceMode(false);
        // Setup the monitor: link to the service MBean
        monitorMBean.addObservedObject(serviceName);
        monitorMBean.setObservedAttribute("SimpleCounter");
        // Setup the monitor: a short granularity period
        monitorMBean.setGranularityPeriod(50L);
        // Setup the monitor: register a listener
        MBeanServerConnection connection = connector.getMBeanServerConnection();
View Full Code Here

  }

  public GaugeMonitor getObject() throws Exception {
    GaugeMonitor monitor = new GaugeMonitor();
    monitor.setNotifyHigh(true);
    monitor.addObservedObject(new ObjectName(String.format("%s:type=JobExecution,name=%s,step=%s", defaultDomain,
        jobName, stepName)));
    monitor.setObservedAttribute(observedAttribute);
    if (observedAttribute.endsWith("Duration")) {
      monitor.setThresholds(new Double(upperThreshold), new Double(lowerThreshold));
    }
View Full Code Here

            }
            server.registerMBean(obsObj, obsObjName);

            echo(">>> SET the attributes of the GaugeMonitor:");

            gaugeMonitor.addObservedObject(obsObjName);
            echo("\tATTRIBUTE \"ObservedObject\"    = " + obsObjName);

            switch (testCase) {
                case 1:
                    gaugeMonitor.setObservedAttribute(
View Full Code Here

            // MANAGEMENT OF A STANDARD MBEAN
            //

            echo(">>> SET the attributes of the GaugeMonitor:");

            gaugeMonitor.addObservedObject(obsObjName);
            echo("\tATTRIBUTE \"ObservedObject\"    = " + obsObjName);

            gaugeMonitor.setObservedAttribute("IntegerAttribute");
            echo("\tATTRIBUTE \"ObservedAttribute\" = IntegerAttribute");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.