Package javax.management

Examples of javax.management.MBeanNotificationInfo


         "name", "description", parms,
         SimpleType.STRING, OpenMBeanOperationInfoSupport.ACTION_INFO)
      };
      MBeanNotificationInfo[] notifications = new MBeanNotificationInfo[]
      {
         new MBeanNotificationInfo(new String[] { "type1", "type" }, "name", "description")
      };
      info = new OpenMBeanInfoSupport(
         "name", "description", attributes, constructors,
         operations, notifications);
      assertEquals("name", info.getClassName());
View Full Code Here


         "name", "description", parms,
         SimpleType.STRING, OpenMBeanOperationInfoSupport.ACTION_INFO)
      };
      MBeanNotificationInfo[] notifications = new MBeanNotificationInfo[]
      {
         new MBeanNotificationInfo(new String[] { "type1", "type" }, "name", "description")
      };
      OpenMBeanInfoSupport info = new OpenMBeanInfoSupport(
         "name", "description", attributes, constructors,
         operations, notifications);

      assertTrue("Null is not equal to any instance", info.equals(null) == false);
      assertTrue("Instance is only equal another OpenMBeanInfo instance", info.equals(new Object()) == false);
      assertTrue("Instance should equal itself", info.equals(info));

      OpenMBeanInfoSupport info2 = new OpenMBeanInfoSupport(
         "name", "description", attributes, constructors,
         operations, notifications);
      assertTrue("Instances with same values should be equal", info.equals(info2));
      assertTrue("Instances with same values should be equal", info2.equals(info));

      info2 = new OpenMBeanInfoSupport(
         "name2", "description", attributes, constructors,
         operations, notifications);
      assertTrue("Instances with different class names are not equal", info.equals(info2) == false);
      assertTrue("Instances with different class names are not equal", info2.equals(info) == false);

      info2 = new OpenMBeanInfoSupport(
         "name", "description2", attributes, constructors,
         operations, notifications);
      assertTrue("Instances with different descriptions are equal", info.equals(info2));
      assertTrue("Instances with different descriptions are equal", info2.equals(info));

      OpenMBeanAttributeInfoSupport[] attributes2 = new OpenMBeanAttributeInfoSupport[]
      {
         new OpenMBeanAttributeInfoSupport(
         "name2", "description", SimpleType.STRING, true, true, false)
      };

      info2 = new OpenMBeanInfoSupport(
         "name", "description", attributes2, constructors,
         operations, notifications);
      assertTrue("Instances with different attributes are not equal", info.equals(info2) == false);
      assertTrue("Instances with different attributes are not equal", info2.equals(info) == false);

      attributes2 = new OpenMBeanAttributeInfoSupport[]
      {
         new OpenMBeanAttributeInfoSupport(
         "name2", "description", SimpleType.STRING, true, true, false),
         new OpenMBeanAttributeInfoSupport(
         "name3", "description", SimpleType.STRING, true, true, false)
      };

      info2 = new OpenMBeanInfoSupport(
         "name", "description", attributes2, constructors,
         operations, notifications);
      assertTrue("Instances with different numbers of attributes are not equal", info.equals(info2) == false);
      assertTrue("Instances with different numbers of attributes are not equal", info2.equals(info) == false);

      info2 = new OpenMBeanInfoSupport(
         "name", "description", null, constructors,
         operations, notifications);
      assertTrue("Instances with and without attributes are not equal", info.equals(info2) == false);
      assertTrue("Instances with and without attributes are not equal", info2.equals(info) == false);

      OpenMBeanConstructorInfoSupport[] constructors2 = new OpenMBeanConstructorInfoSupport[]
      {
         new OpenMBeanConstructorInfoSupport(
         "name2", "description", parms)
      };

      info2 = new OpenMBeanInfoSupport(
         "name", "description", attributes, constructors2,
         operations, notifications);
      assertTrue("Instances with different constructors are not equal", info.equals(info2) == false);
      assertTrue("Instances with different constructors are not equal", info2.equals(info) == false);

      constructors2 = new OpenMBeanConstructorInfoSupport[]
      {
         new OpenMBeanConstructorInfoSupport(
         "name2", "description", parms),
         new OpenMBeanConstructorInfoSupport(
         "name3", "description", parms)
      };

      info2 = new OpenMBeanInfoSupport(
         "name", "description", attributes, constructors2,
         operations, notifications);
      assertTrue("Instances with different numbers of constructors are not equal", info.equals(info2) == false);
      assertTrue("Instances with different numbers of constructors are not equal", info2.equals(info) == false);

      info2 = new OpenMBeanInfoSupport(
         "name", "description", attributes, null,
         operations, notifications);
      assertTrue("Instances with and without constructors are not equal", info.equals(info2) == false);
      assertTrue("Instances with and without constructors are not equal", info2.equals(info) == false);

      OpenMBeanOperationInfoSupport[] operations2 = new OpenMBeanOperationInfoSupport[]
      {
         new OpenMBeanOperationInfoSupport(
         "name2", "description", parms,
         SimpleType.STRING, OpenMBeanOperationInfoSupport.ACTION_INFO)
      };

      info2 = new OpenMBeanInfoSupport(
         "name", "description", attributes, constructors,
         operations2, notifications);
      assertTrue("Instances with different operations are not equal", info.equals(info2) == false);
      assertTrue("Instances with different operations are not equal", info2.equals(info) == false);

      operations2 = new OpenMBeanOperationInfoSupport[]
      {
         new OpenMBeanOperationInfoSupport(
         "name2", "description", parms,
         SimpleType.STRING, OpenMBeanOperationInfoSupport.ACTION_INFO),
         new OpenMBeanOperationInfoSupport(
         "name3", "description", parms,
         SimpleType.STRING, OpenMBeanOperationInfoSupport.ACTION_INFO)
      };

      info2 = new OpenMBeanInfoSupport(
         "name", "description", attributes, constructors,
         operations2, notifications);
      assertTrue("Instances with different numbers of operations are not equal", info.equals(info2) == false);
      assertTrue("Instances with different numbers of operations are not equal", info2.equals(info) == false);

      info2 = new OpenMBeanInfoSupport(
         "name", "description", attributes, constructors,
         null, notifications);
      assertTrue("Instances with and without operations are not equal", info.equals(info2) == false);
      assertTrue("Instances with and without operations are not equal", info2.equals(info) == false);

      MBeanNotificationInfo[] notifications2 = new MBeanNotificationInfo[]
      {
         new MBeanNotificationInfo(new String[] { "type", "type" }, "name2", "description")
      };

      info2 = new OpenMBeanInfoSupport(
         "name", "description", attributes, constructors,
         operations, notifications2);
      assertTrue("Instances with different notifications are not equal", info.equals(info2) == false);
      assertTrue("Instances with different notifications are not equal", info2.equals(info) == false);

      notifications2 = new MBeanNotificationInfo[]
      {
         new MBeanNotificationInfo(new String[] { "type", "type" }, "name2", "description"),
         new MBeanNotificationInfo(new String[] { "type", "type" }, "name3", "description")
      };

      info2 = new OpenMBeanInfoSupport(
         "name", "description", attributes, constructors,
         operations, notifications2);
View Full Code Here

         "name", "description", parms,
         SimpleType.STRING, OpenMBeanOperationInfoSupport.ACTION_INFO)
      };
      MBeanNotificationInfo[] notifications = new MBeanNotificationInfo[]
      {
         new MBeanNotificationInfo(
         new String[] { "type1", "type" }, "name", "description")
      };
      OpenMBeanInfoSupport info = new OpenMBeanInfoSupport(
         "name", "description", attributes, constructors,
         operations, notifications);
View Full Code Here

         "name", "description", parms,
         SimpleType.STRING, OpenMBeanOperationInfoSupport.ACTION_INFO)
      };
      MBeanNotificationInfo[] notifications = new MBeanNotificationInfo[]
      {
         new MBeanNotificationInfo(
         new String[] { "type1", "type" }, "name", "description")
      };
      OpenMBeanInfoSupport info = new OpenMBeanInfoSupport(
         "NAME", "DESCRIPTION", attributes, constructors,
         operations, notifications);
View Full Code Here

         "name", "description", parms,
         SimpleType.STRING, OpenMBeanOperationInfoSupport.ACTION_INFO)
      };
      MBeanNotificationInfo[] notifications = new MBeanNotificationInfo[]
      {
         new MBeanNotificationInfo(
         new String[] { "type1", "type" }, "name", "description")
      };
      OpenMBeanInfoSupport info = new OpenMBeanInfoSupport(
         "name", "description", attributes, constructors,
         operations, notifications);
      // Serialize it
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      ObjectOutputStream oos = new ObjectOutputStream(baos);
      oos.writeObject(info);
   
      // Deserialize it
      ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
      ObjectInputStream ois = new ObjectInputStream(bais);
      OpenMBeanInfoSupport result = (OpenMBeanInfoSupport) ois.readObject();

      assertEquals(info.getClassName(), result.getClassName());
      assertEquals(Arrays.asList(info.getAttributes()), Arrays.asList(result.getAttributes()));
      assertEquals(Arrays.asList(info.getConstructors()), Arrays.asList(result.getConstructors()));
      assertEquals(Arrays.asList(info.getOperations()), Arrays.asList(result.getOperations()));

      // UGLY!
      MBeanNotificationInfo origNotification = info.getNotifications()[0];
      MBeanNotificationInfo resultNotification = result.getNotifications()[0];
      assertEquals(origNotification.getName(), resultNotification.getName());
      assertEquals(origNotification.getDescription(), resultNotification.getDescription());
      assertEquals(Arrays.asList(origNotification.getNotifTypes()), Arrays.asList(resultNotification.getNotifTypes()));
   }
View Full Code Here

  }

  @Override
  public MBeanNotificationInfo[] getNotificationInfo() {
        return new MBeanNotificationInfo[] {
                new MBeanNotificationInfo(new String[] {SERVICE_TIME_NOTIFICATION_TYPE, SERVICE_LENGTH_NOTIFICATION_TYPE, ACTION_TIME_NOTIFICATION_TYPE, ACTION_LENGTH_NOTIFICATION_TYPE},
                    "javax.management.Notification", "JBoss ESB message alert notification")
        };
  }
View Full Code Here

      MonitorNotification.OBSERVED_ATTRIBUTE_ERROR,
      MonitorNotification.OBSERVED_ATTRIBUTE_TYPE_ERROR,
      MonitorNotification.THRESHOLD_ERROR,
      MonitorNotification.THRESHOLD_VALUE_EXCEEDED
    };
    result[0] = new MBeanNotificationInfo(types,
      "javax.management.monitor.MonitorNotification",
      "Notifications sent by the Counter Monitor Service MBean");
    return result;
  }
View Full Code Here

      RelationNotification.RELATION_BASIC_UPDATE,
      RelationNotification.RELATION_MBEAN_CREATION,
      RelationNotification.RELATION_MBEAN_REMOVAL,
      RelationNotification.RELATION_MBEAN_UPDATE
    };
    result[0] = new MBeanNotificationInfo(types,
      "javax.management.relation.RelationNotification",
      "Notifications sent by the Relation Service MBean");
    return result;
  }
View Full Code Here

      MonitorNotification.OBSERVED_ATTRIBUTE_TYPE_ERROR,
      MonitorNotification.THRESHOLD_ERROR,
      MonitorNotification.THRESHOLD_HIGH_VALUE_EXCEEDED,
      MonitorNotification.THRESHOLD_LOW_VALUE_EXCEEDED
    };
    result[0] = new MBeanNotificationInfo(types,
      "javax.management.monitor.MonitorNotification",
      "Notifications sent by the Gauge Monitor Service MBean");
    return result;
  }
View Full Code Here

   public MBeanNotificationInfo[] getNotificationInfo()
   {
      if (info == null)
      {
         info = new MBeanNotificationInfo[]{
            new MBeanNotificationInfo(new String[]{"CLASSLOADER_ADDED"},
                                      "javax.management.Notification",
                                      "Notification that a classloader has been added to the extensible classloader"),
            new MBeanNotificationInfo(new String[]{"CLASS_REMOVED"},
                                      "javax.management.Notification",
                                      "Notification that a class has been removed from the extensible classloader")

         };
      }
View Full Code Here

TOP

Related Classes of javax.management.MBeanNotificationInfo

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.