Package javax.management

Examples of javax.management.MBeanConstructorInfo


    //enumerate all constructors
    Constructor[] ctrs = configuringMBeanClass.getConstructors();
    MBeanConstructorInfo[] infos = new MBeanConstructorInfo[ctrs.length];
    for(int i=0; i<ctrs.length; i++)
      {
        infos[i] = new MBeanConstructorInfo(constructorDescr, ctrs[i]);
      }
    return  infos;
 
View Full Code Here


  }
 
    public String
  stringify( Object o )
  {
    final MBeanConstructorInfo  constructor  = (MBeanConstructorInfo)o;
   
    final String  name  = constructor.getName();
    final int    lastDot  =   name.lastIndexOf( "." );
    final String  abbreviatedName  = name.substring( lastDot + 1, name.length() );
   
    final String params  = "(" +
      ParamsToString( constructor.getSignature(), mOptions ) + ")";
   
    return( abbreviatedName + params );
  }
View Full Code Here

      //dumpConstructors(info);

      Map mapCstrForDesc = makeFeatureMap(cstrs);

      // no args constructor
      MBeanConstructorInfo cstr =
              (MBeanConstructorInfo)mapCstrForDesc.get("The no-args constructor");
      assertNotNull(cstr);
      assertEquals(cstr.getSignature().length, 0);

      // Locale constructor
      cstr =
      (MBeanConstructorInfo)mapCstrForDesc.get("The Locale specific constructor");
      assertNotNull(cstr);
      assertEquals(cstr.getSignature().length, 1);
      paramInfo = cstr.getSignature()[0];
      checkParam(paramInfo, "The locale", "locale");
   }
View Full Code Here

      MBeanConstructorInfo[] cstrs = info.getConstructors();
      assertEquals(cstrs.length, 6);
      Map mapCstrForDesc = makeFeatureMap(cstrs);

      // no args constructor
      MBeanConstructorInfo cstr =
              (MBeanConstructorInfo)mapCstrForDesc.get("The no-args constructor");
      assertNotNull(cstr);
      assertEquals(cstr.getSignature().length, 0);

      // Object constuctor
      cstr =
      (MBeanConstructorInfo)mapCstrForDesc.get("The Object constructor");
      assertNotNull(cstr);
      assertEquals(cstr.getSignature().length, 1);
      checkParam(cstr.getSignature()[0], "an object", "obj");

      // int constructor
      cstr = (MBeanConstructorInfo)mapCstrForDesc.get("The int constructor");
      assertNotNull(cstr);
      assertEquals(cstr.getSignature().length, 1);
      checkParam(cstr.getSignature()[0], "a number", "value");

      // int[] constructor
      cstr =
      (MBeanConstructorInfo)mapCstrForDesc.get("The int[] constructor");
      assertNotNull(cstr);
      assertEquals(cstr.getSignature().length, 1);
      checkParam(cstr.getSignature()[0], "an array of int", "intArray");

      // Object[] constructor
      cstr =
      (MBeanConstructorInfo)mapCstrForDesc.get("The Object[] constructor");
      assertNotNull(cstr);
      assertEquals(cstr.getSignature().length, 1);
      checkParam(cstr.getSignature()[0], "an array of Object", "objArray");

      // int,Object constructor
      cstr =
      (MBeanConstructorInfo)mapCstrForDesc.get("A two parameter int,Object constructor");
      assertNotNull(cstr);
      assertEquals(cstr.getSignature().length, 2);
      checkParam(cstr.getSignature()[0], "a number", "a");
      checkParam(cstr.getSignature()[1], "an object", "b");
   }
View Full Code Here

      assertEquals(cstrs.length, 7);
      Map mapCstrForDesc = makeFeatureMap(cstrs);
      assertEquals(mapCstrForDesc.size(), 3); // 5 ambiguous mapped to same

      // no args constructor
      MBeanConstructorInfo cstr =
              (MBeanConstructorInfo)mapCstrForDesc.get("The no-args constructor");
      assertNotNull(cstr);
      assertEquals(cstr.getSignature().length, 0);

      // Amiguous constuctors
      cstr =
      (MBeanConstructorInfo)mapCstrForDesc.get("ambiguous constructor");
      assertNotNull(cstr);

      // int,Object constructor
      cstr =
      (MBeanConstructorInfo)mapCstrForDesc.get("The two parameter constructor");
      assertNotNull(cstr);
      assertEquals(cstr.getSignature().length, 2);
      checkParam(cstr.getSignature()[0], "a number", "a");
      checkParam(cstr.getSignature()[1], "another number", "b");
   }
View Full Code Here

      assertEquals(cstrs.length, 2);
      dumpConstructors(info);

      Map mapCstrForDesc = makeFeatureMap(cstrs);
      assertEquals(mapCstrForDesc.size(), 1); // ambiguous
      MBeanConstructorInfo cstr =
              (MBeanConstructorInfo)mapCstrForDesc.get("ambiguous constructor");
      assertNotNull(cstr);
   }
View Full Code Here

      Object mbean = new ComplianceSupport.BasicStandard();
      MBeanMetaData md = createMBeanMetaData(mbean);
      introspector.introspect(md);
      MBeanConstructorInfo[] constructors = md.getMBeanInfo().getConstructors();
      assertEquals(1, constructors.length);
      MBeanConstructorInfo info = constructors[0];
      assertEquals(mbean.getClass().getName(), info.getName());
   }
View Full Code Here

   }

   public void testValidMBeanStarInfoNullName() throws Exception
   {
      new MBeanAttributeInfo(null, "java.lang.String", "description", true, false, false);
      new MBeanConstructorInfo(null, "description", null);
      new MBeanOperationInfo(null, "description", null, "java.lang.String", MBeanOperationInfo.UNKNOWN);
      new MBeanParameterInfo(null, "java.lang.String", "description");
   }
View Full Code Here

   }

   public void testValidMBeanStarInfoEmptyName() throws Exception
   {
      new MBeanAttributeInfo("", "java.lang.String", "description", true, false, false);
      new MBeanConstructorInfo("", "description", null);
      new MBeanOperationInfo("", "description", null, "java.lang.String", MBeanOperationInfo.UNKNOWN);
      new MBeanParameterInfo("", "java.lang.String", "description");
   }
View Full Code Here

   }

   public void testValidMBeanStarInfoInvalidName1() throws Exception
   {
      new MBeanAttributeInfo("123", "java.lang.String", "description", true, false, false);
      new MBeanConstructorInfo("123", "description", null);
      new MBeanOperationInfo("123", "description", null, "java.lang.String", MBeanOperationInfo.UNKNOWN);
      new MBeanParameterInfo("123", "java.lang.String", "description");
   }
View Full Code Here

TOP

Related Classes of javax.management.MBeanConstructorInfo

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.