Package javax.management.monitor

Examples of javax.management.monitor.MonitorNotification


      assertEquals(0, notifications.size());
      monitor.setObservedAttribute("rubbish");
      monitor.start();
      sync(false);
      assertEquals(1, notifications.size());
      MonitorNotification n = (MonitorNotification) notifications.get(0);
      notifications.clear();
      assertEquals(monitorName, n.getSource());
      assertEquals(monitoredName, n.getObservedObject());
      assertEquals("rubbish", n.getObservedAttribute());
      assertEquals(MonitorNotification.OBSERVED_ATTRIBUTE_ERROR, n.getType());
      n = serializeDeserialize(n);
      assertEquals(monitorName, n.getSource());
      assertEquals(monitoredName, n.getObservedObject());
      assertEquals("rubbish", n.getObservedAttribute());
      assertEquals(MonitorNotification.OBSERVED_ATTRIBUTE_ERROR, n.getType());
   }
View Full Code Here


      assertEquals(0, notifications.size());
      monitor.setObservedAttribute("WrongNull");
      monitor.start();
      sync(false);
      assertEquals(1, notifications.size());
      MonitorNotification n = (MonitorNotification) notifications.get(0);
      notifications.clear();
      assertEquals(monitorName, n.getSource());
      assertEquals(monitoredName, n.getObservedObject());
      assertEquals("WrongNull", n.getObservedAttribute());
      assertEquals(MonitorNotification.OBSERVED_ATTRIBUTE_TYPE_ERROR,
                   n.getType());
      n = serializeDeserialize(n);
      assertEquals(monitorName, n.getSource());
      assertEquals(monitoredName, n.getObservedObject());
      assertEquals("WrongNull", n.getObservedAttribute());
      assertEquals(MonitorNotification.OBSERVED_ATTRIBUTE_TYPE_ERROR,
                   n.getType());
   }
View Full Code Here

      assertEquals(0, notifications.size());
      monitor.setObservedAttribute("WrongType");
      monitor.start();
      sync(false);
      assertEquals(1, notifications.size());
      MonitorNotification n = (MonitorNotification) notifications.get(0);
      notifications.clear();
      assertEquals(monitorName, n.getSource());
      assertEquals(monitoredName, n.getObservedObject());
      assertEquals("WrongType", n.getObservedAttribute());
      assertEquals(MonitorNotification.OBSERVED_ATTRIBUTE_TYPE_ERROR,
                   n.getType());
      n = serializeDeserialize(n);
      assertEquals(monitoredName, n.getObservedObject());
      assertEquals("WrongType", n.getObservedAttribute());
      assertEquals(MonitorNotification.OBSERVED_ATTRIBUTE_TYPE_ERROR,
                   n.getType());
   }
View Full Code Here

      assertEquals(0, notifications.size());
      monitor.setObservedAttribute("WriteOnly");
      monitor.start();
      sync(false);
      assertEquals(1, notifications.size());
      MonitorNotification n = (MonitorNotification) notifications.get(0);
      notifications.clear();
      assertEquals(monitorName, n.getSource());
      assertEquals(monitoredName, n.getObservedObject());
      assertEquals("WriteOnly", n.getObservedAttribute());
      assertEquals(MonitorNotification.OBSERVED_ATTRIBUTE_ERROR,
                   n.getType());
      n = serializeDeserialize(n);
      assertEquals(monitorName, n.getSource());
      assertEquals(monitoredName, n.getObservedObject());
      assertEquals("WriteOnly", n.getObservedAttribute());
      assertEquals(MonitorNotification.OBSERVED_ATTRIBUTE_ERROR,
                   n.getType());
   }
View Full Code Here

      monitoredName = new ObjectName("rubbish:type=pants");
      monitor.setObservedObject(monitoredName);
      monitor.start();
      sync(false);
      assertEquals(1, notifications.size());
      MonitorNotification n = (MonitorNotification) notifications.get(0);
      notifications.clear();
      assertEquals(monitorName, n.getSource());
      assertEquals(monitoredName, n.getObservedObject());
      assertEquals("Value", n.getObservedAttribute());
      assertEquals(MonitorNotification.OBSERVED_OBJECT_ERROR,
                   n.getType());
      n = serializeDeserialize(n);
      assertEquals(monitorName, n.getSource());
      assertEquals(monitoredName, n.getObservedObject());
      assertEquals("Value", n.getObservedAttribute());
      assertEquals(MonitorNotification.OBSERVED_OBJECT_ERROR,
                   n.getType());
   }
View Full Code Here

   {
      assertEquals(0, notifications.size());
      monitor.start();
      sync(false);
      assertEquals(1, notifications.size());
      MonitorNotification n = (MonitorNotification) notifications.get(0);
      notifications.clear();
      assertEquals(monitorName, n.getSource());
      assertEquals(monitoredName, n.getObservedObject());
      assertEquals("Value", n.getObservedAttribute());
      assertEquals(MonitorNotification.THRESHOLD_ERROR,
                   n.getType());
      n = serializeDeserialize(n);
      assertEquals(monitorName, n.getSource());
      assertEquals(monitoredName, n.getObservedObject());
      assertEquals("Value", n.getObservedAttribute());
      assertEquals(MonitorNotification.THRESHOLD_ERROR,
                   n.getType());
   }
View Full Code Here

      monitor.start();
      sync(false);
      if (notifications.size() != 1)
         fail ("FAILS IN RI: Does not notify of error thrown by getter");
      assertEquals(1, notifications.size());
      MonitorNotification n = (MonitorNotification) notifications.get(0);
      notifications.clear();
      assertEquals(monitorName, n.getSource());
      assertEquals(monitoredName, n.getObservedObject());
      assertEquals("WrongException", n.getObservedAttribute());
      assertEquals(MonitorNotification.RUNTIME_ERROR,
                   n.getType());
      n = serializeDeserialize(n);
      assertEquals(monitorName, n.getSource());
      assertEquals(monitoredName, n.getObservedObject());
      assertEquals("WrongException", n.getObservedAttribute());
      assertEquals(MonitorNotification.RUNTIME_ERROR,
                   n.getType());
   }
View Full Code Here

      sync(true);

      // Check the result
      checkGauge(expected);
      assertEquals(1, notifications.size());
      MonitorNotification n = (MonitorNotification) notifications.get(0);
      notifications.clear();
      assertEquals(monitorName, n.getSource());
      assertEquals(monitoredName, n.getObservedObject());
      assertEquals("Value", n.getObservedAttribute());
      assertEquals(type, n.getType());
      assertEquals(expected, n.getDerivedGauge());
      n = serializeDeserialize(n);
      assertEquals(monitorName, n.getSource());
      assertEquals(monitoredName, n.getObservedObject());
      assertEquals("Value", n.getObservedAttribute());
      assertEquals(type, n.getType());
      assertEquals(expected, n.getDerivedGauge());
   }
View Full Code Here

      sync(true);

      // Check the result
      checkGauge(gauge);
      assertEquals(1, notifications.size());
      MonitorNotification n = (MonitorNotification) notifications.get(0);
      notifications.clear();
      assertEquals(monitorName, n.getSource());
      assertEquals(monitoredName, n.getObservedObject());
      assertEquals("Value", n.getObservedAttribute());
      assertEquals(type, n.getType());
      assertEquals(gauge, n.getDerivedGauge());
   }
View Full Code Here

      sync(true);

      // Check the result
      checkGauge(sub(value2, value1));
      assertEquals(1, notifications.size());
      MonitorNotification n = (MonitorNotification) notifications.get(0);
      notifications.clear();
      assertEquals(monitorName, n.getSource());
      assertEquals(monitoredName, n.getObservedObject());
      assertEquals("Value", n.getObservedAttribute());
      assertEquals(type, n.getType());
      assertEquals(sub(value2, value1), n.getDerivedGauge());
   }
View Full Code Here

TOP

Related Classes of javax.management.monitor.MonitorNotification

Copyright © 2018 www.massapicom. 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.