Examples of addObservedObject()


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

      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

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

      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

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

        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

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

  }

  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

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

            }
            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

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

            // 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

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

        mon1.setGranularityPeriod(60000); // 60 sec...
        mon1.setObservedAttribute(attr);
        mon1.setDifferenceMode(true);
        check(attr,server,mon1n,mbean);
       
        mon2.addObservedObject(mbean);
        mon2.setGranularityPeriod(60000); // 60 sec...
        mon2.setObservedAttribute(attr);
        mon2.setDifferenceMode(true);
        check(attr,server,mon2n,mbean);
       
View Full Code Here

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

            // 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

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

            final Runnable withinGetAttribute =
                (when == When.IN_GET_ATTRIBUTE) ? sensitiveThing : nothing;

            mbs.registerMBean(new Test(withinGetAttribute), observedName);
            monitorProxy.addObservedObject(observedName);
            monitorProxy.setObservedAttribute("Thing");
            monitorProxy.setThresholds(105, 100);
            monitorProxy.setGranularityPeriod(10L); // 10 ms
            monitorProxy.setNotifyHigh(true);
            monitorProxy.setNotifyLow(true);
View Full Code Here

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

      Counter counter = new Counter();
      ObjectName counterName = ObjectName.getInstance(":mbean=counter");
      server.registerMBean(counter, counterName);

      monitor.addObservedObject(counterName);
      monitor.setGranularityPeriod(1000);
      monitor.setObservedAttribute("ObjectCounter");

      final MutableInteger times = new MutableInteger(0);
      final MutableObject holder = new MutableObject(null);
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.