Package javax.management.openmbean

Examples of javax.management.openmbean.OpenMBeanParameterInfoSupport


    private void addChildAddOperations(List<OpenMBeanOperationInfo> ops, ImmutableManagementResourceRegistration resourceRegistration) {
        for (Map.Entry<PathElement, ChildAddOperationEntry> entry : ChildAddOperationFinder.findAddChildOperations(resourceRegistration).entrySet()) {
            OpenMBeanParameterInfo addWildcardChildName = null;
            if (entry.getValue().getElement().isWildcard()) {
                addWildcardChildName = new OpenMBeanParameterInfoSupport("name", "The name of the " + entry.getValue().getElement().getKey() + " to add.", SimpleType.STRING);
            }

            ops.add(getOperation(NameConverter.createValidAddOperationName(entry.getKey()), addWildcardChildName, entry.getValue().getOperationEntry()));
        }
    }
View Full Code Here


        List<OpenMBeanParameterInfo> params = new ArrayList<OpenMBeanParameterInfo>();
        for (Property prop : opNode.get(REQUEST_PROPERTIES).asPropertyList()) {
            ModelNode value = prop.getValue();
            final String paramName = NameConverter.convertToCamelCase(prop.getName());
            params.add(
                    new OpenMBeanParameterInfoSupport(
                            paramName,
                            getDescription(prop.getValue()),
                            TypeConverter.convertToMBeanType(value)));
        }
        return params.toArray(new OpenMBeanParameterInfo[params.size()]);
View Full Code Here

    private void addChildAddOperations(List<OpenMBeanOperationInfo> ops, ImmutableManagementResourceRegistration resourceRegistration) {
        for (Map.Entry<PathElement, ChildAddOperationEntry> entry : ChildAddOperationFinder.findAddChildOperations(resourceRegistration).entrySet()) {
            OpenMBeanParameterInfo addWildcardChildName = null;
            if (entry.getValue().getElement().isWildcard()) {
                addWildcardChildName = new OpenMBeanParameterInfoSupport("name", "The name of the " + entry.getValue().getElement().getKey() + " to add.", SimpleType.STRING);
            }

            ops.add(getOperation(NameConverter.createValidAddOperationName(entry.getKey()), addWildcardChildName, entry.getValue().getOperationEntry()));
        }
    }
View Full Code Here

        List<OpenMBeanParameterInfo> params = new ArrayList<OpenMBeanParameterInfo>();
        for (Property prop : opNode.get(REQUEST_PROPERTIES).asPropertyList()) {
            ModelNode value = prop.getValue();
            final String paramName = NameConverter.convertToCamelCase(prop.getName());
            params.add(
                    new OpenMBeanParameterInfoSupport(
                            paramName,
                            getDescription(prop.getValue()),
                            TypeConverter.convertToMBeanType(value)));
        }
        return params.toArray(new OpenMBeanParameterInfo[params.size()]);
View Full Code Here

      assertEquals(0, info.getNotifications().length);
      assertEquals(0, info.getOperations().length);

      OpenMBeanParameterInfoSupport[] parms = new OpenMBeanParameterInfoSupport[]
      {
         new OpenMBeanParameterInfoSupport(
            "name", "description", SimpleType.STRING)
      };

      OpenMBeanAttributeInfoSupport[] attributes = new OpenMBeanAttributeInfoSupport[]
      {
View Full Code Here

   public void testEquals()
      throws Exception
   {
      OpenMBeanParameterInfoSupport[] parms = new OpenMBeanParameterInfoSupport[]
      {
         new OpenMBeanParameterInfoSupport(
            "name", "description", SimpleType.STRING)
      };

      OpenMBeanAttributeInfoSupport[] attributes = new OpenMBeanAttributeInfoSupport[]
      {
View Full Code Here

   public void testHashCode()
      throws Exception
   {
      OpenMBeanParameterInfoSupport[] parms = new OpenMBeanParameterInfoSupport[]
      {
         new OpenMBeanParameterInfoSupport(
            "name", "description", SimpleType.STRING)
      };

      OpenMBeanAttributeInfoSupport[] attributes = new OpenMBeanAttributeInfoSupport[]
      {
View Full Code Here

   public void testToString()
      throws Exception
   {
      OpenMBeanParameterInfoSupport[] parms = new OpenMBeanParameterInfoSupport[]
      {
         new OpenMBeanParameterInfoSupport(
            "name", "description", SimpleType.STRING)
      };

      OpenMBeanAttributeInfoSupport[] attributes = new OpenMBeanAttributeInfoSupport[]
      {
View Full Code Here

   public void testSerialization()
      throws Exception
   {
      OpenMBeanParameterInfoSupport[] parms = new OpenMBeanParameterInfoSupport[]
      {
         new OpenMBeanParameterInfoSupport(
            "name", "description", SimpleType.STRING)
      };

      OpenMBeanAttributeInfoSupport[] attributes = new OpenMBeanAttributeInfoSupport[]
      {
View Full Code Here

   // Tests ---------------------------------------------------------------------

   public void testOpenMBeanParameterInfoSupport()
      throws Exception
   {
      OpenMBeanParameterInfoSupport info = new OpenMBeanParameterInfoSupport(
         "name", "description", SimpleType.STRING);
      assertEquals("name", info.getName());
      assertEquals("description", info.getDescription());
      assertEquals("java.lang.String", info.getType());

      info = new OpenMBeanParameterInfoSupport(
         "name", "description", SimpleType.STRING, "default");
      assertEquals("name", info.getName());
      assertEquals("description", info.getDescription());
      assertEquals("java.lang.String", info.getType());
      assertEquals("default", info.getDefaultValue());
      assertEquals(true, info.hasDefaultValue());

      info = new OpenMBeanParameterInfoSupport(
         "name", "description", SimpleType.STRING, null);
      assertEquals("name", info.getName());
      assertEquals("description", info.getDescription());
      assertEquals("java.lang.String", info.getType());
      assertEquals(null, info.getDefaultValue());
      assertEquals(false, info.hasDefaultValue());

      info = new OpenMBeanParameterInfoSupport(
         "name", "description", SimpleType.INTEGER, new Integer(3), new Integer(2), new Integer(4));
      assertEquals("name", info.getName());
      assertEquals("description", info.getDescription());
      assertEquals("java.lang.Integer", info.getType());
      assertEquals(new Integer(3), info.getDefaultValue());
      assertEquals(new Integer(2), info.getMinValue());
      assertEquals(new Integer(4), info.getMaxValue());

      info = new OpenMBeanParameterInfoSupport(
         "name", "description", SimpleType.INTEGER, null, new Integer(2), new Integer(4));
      assertEquals("name", info.getName());
      assertEquals("description", info.getDescription());
      assertEquals("java.lang.Integer", info.getType());
      assertEquals(null, info.getDefaultValue());
      assertEquals(new Integer(2), info.getMinValue());
      assertEquals(new Integer(4), info.getMaxValue());

      info = new OpenMBeanParameterInfoSupport(
         "name", "description", SimpleType.INTEGER, new Integer(3), null, new Integer(4));
      assertEquals("name", info.getName());
      assertEquals("description", info.getDescription());
      assertEquals("java.lang.Integer", info.getType());
      assertEquals(new Integer(3), info.getDefaultValue());
      assertEquals(null, info.getMinValue());
      assertEquals(new Integer(4), info.getMaxValue());

      info = new OpenMBeanParameterInfoSupport(
         "name", "description", SimpleType.INTEGER, new Integer(3), new Integer(2), null);
      assertEquals("name", info.getName());
      assertEquals("description", info.getDescription());
      assertEquals("java.lang.Integer", info.getType());
      assertEquals(new Integer(3), info.getDefaultValue());
      assertEquals(new Integer(2), info.getMinValue());
      assertEquals(null, info.getMaxValue());

      info = new OpenMBeanParameterInfoSupport(
         "name", "description", SimpleType.INTEGER, null, null, new Integer(4));
      assertEquals("name", info.getName());
      assertEquals("description", info.getDescription());
      assertEquals("java.lang.Integer", info.getType());
      assertEquals(null, info.getDefaultValue());
      assertEquals(null, info.getMinValue());
      assertEquals(new Integer(4), info.getMaxValue());

      info = new OpenMBeanParameterInfoSupport(
         "name", "description", SimpleType.INTEGER, null, new Integer(2), null);
      assertEquals("name", info.getName());
      assertEquals("description", info.getDescription());
      assertEquals("java.lang.Integer", info.getType());
      assertEquals(null, info.getDefaultValue());
      assertEquals(new Integer(2), info.getMinValue());
      assertEquals(null, info.getMaxValue());

      info = new OpenMBeanParameterInfoSupport(
         "name", "description", SimpleType.INTEGER, new Integer(3), null, null);
      assertEquals("name", info.getName());
      assertEquals("description", info.getDescription());
      assertEquals("java.lang.Integer", info.getType());
      assertEquals(new Integer(3), info.getDefaultValue());
      assertEquals(null, info.getMinValue());
      assertEquals(null, info.getMaxValue());

      info = new OpenMBeanParameterInfoSupport(
         "name", "description", SimpleType.INTEGER, null, null, null);
      assertEquals("name", info.getName());
      assertEquals("description", info.getDescription());
      assertEquals("java.lang.Integer", info.getType());
      assertEquals(null, info.getDefaultValue());
      assertEquals(null, info.getMinValue());
      assertEquals(null, info.getMaxValue());

      info = new OpenMBeanParameterInfoSupport(
         "name", "description", SimpleType.STRING, "default",
         new Object[] { "legal1", "legal2", "default" });
      assertEquals("name", info.getName());
      assertEquals("description", info.getDescription());
      assertEquals("java.lang.String", info.getType());
      assertEquals("default", info.getDefaultValue());
      assertEquals(3, info.getLegalValues().size());
      assertTrue("legal1 should be a legal value", info.getLegalValues().contains("legal1"));
      assertTrue("legal2 should be a legal value", info.getLegalValues().contains("legal2"));
      assertTrue("default should be a legal value", info.getLegalValues().contains("default"));

      info = new OpenMBeanParameterInfoSupport(
         "name", "description", SimpleType.STRING, null,
         new Object[] { "legal1", "legal2", "default" });
      assertEquals("name", info.getName());
      assertEquals("description", info.getDescription());
      assertEquals("java.lang.String", info.getType());
      assertEquals(null, info.getDefaultValue());
      assertEquals(3, info.getLegalValues().size());
      assertTrue("legal1 should be a legal value", info.getLegalValues().contains("legal1"));
      assertTrue("legal2 should be a legal value", info.getLegalValues().contains("legal2"));
      assertTrue("default should be a legal value", info.getLegalValues().contains("default"));

      info = new OpenMBeanParameterInfoSupport(
         "name", "description", SimpleType.STRING, "default", null);
      assertEquals("name", info.getName());
      assertEquals("description", info.getDescription());
      assertEquals("java.lang.String", info.getType());
      assertEquals("default", info.getDefaultValue());
      assertEquals(null, info.getLegalValues());

      info = new OpenMBeanParameterInfoSupport(
         "name", "description", SimpleType.STRING, null, null);
      assertEquals("name", info.getName());
      assertEquals("description", info.getDescription());
      assertEquals("java.lang.String", info.getType());
      assertEquals(null, info.getDefaultValue());
      assertEquals(null, info.getLegalValues());
   }
View Full Code Here

TOP

Related Classes of javax.management.openmbean.OpenMBeanParameterInfoSupport

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.