Examples of addObservedObject()


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

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

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

            // MANAGEMENT OF A STANDARD MBEAN
            //

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

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

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

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

        // Add observed object name1
        //
        System.out.println("\nObservedObject \"" + name1 +
            "\" registered before starting the monitor");
        cm.addObservedObject(name1);

        // Start the monitor
        //
        System.out.println("\nStart monitoring...");
        cm.start();
View Full Code Here

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

        // Add observed object name2
        //
        System.out.println("\nObservedObject \"" + name2 +
            "\" registered after starting the monitor");
        cm.addObservedObject(name2);

        // Play with counter for name2
        //
        System.out.println("\nTest ObservedObject \"" + name2 + "\"");
        for (int i = 0; i < 4; i++) {
View Full Code Here

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

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

            mbs.registerMBean(new Test(withinGetAttribute), observedName);
            monitorProxy.addObservedObject(observedName);
            monitorProxy.setObservedAttribute("Thing");
            monitorProxy.setInitThreshold(100);
            monitorProxy.setGranularityPeriod(10L); // 10 ms
            monitorProxy.setNotify(true);
            monitorProxy.start();
View Full Code Here

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

        CounterMonitorMBean cm = (CounterMonitorMBean)
            MBeanServerInvocationHandler.newProxyInstance(
                mbs, cmn, CounterMonitorMBean.class, true);
        ((NotificationEmitter) cm).addNotificationListener(
            new Listener(), null, null);
        cm.addObservedObject(name);
        cm.setObservedAttribute("Counter");
        cm.setGranularityPeriod(100);
        cm.setInitThreshold(1);
        cm.setOffset(offset);
        cm.setModulus(5);
View Full Code Here

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

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()

      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

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(10);
      Integer low = new Integer(5);
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.