Package javax.management

Examples of javax.management.MBeanAttributeInfo


        return null;
    }

    public MBeanInfo getMBeanInfo() {
        System.out.println("getM");
        MBeanAttributeInfo mai = null;
        try {
            mai = new MBeanAttributeInfo("mname", "Desccasas", MBeansDiagnosisProvider.class.getMethod("test"), null);
        } catch (IntrospectionException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (SecurityException e) {
            // TODO Auto-generated catch block
View Full Code Here


      if (metric.getName() == null || parentAttributes.contains(metric.getName()))
        continue;

      // add on custom HBase metric types
      if (metric instanceof MetricsRate) {
        attributes.add( new MBeanAttributeInfo(metric.getName(),
            "java.lang.Float", metric.getDescription(), true, false, false) );
        extendedAttributes.put(metric.getName(), metric);
      } else if (metric instanceof MetricsString) {
        attributes.add( new MBeanAttributeInfo(metric.getName(),
            "java.lang.String", metric.getDescription(), true, false, false) );
        extendedAttributes.put(metric.getName(), metric);
        LOG.info("MetricsString added: " + metric.getName());
      } else if (metric instanceof MetricsHistogram) {

        String metricName = metric.getName() + MetricsHistogram.NUM_OPS_METRIC_NAME;
        attributes.add(new MBeanAttributeInfo(metricName,
            "java.lang.Long", metric.getDescription(), true, false, false));
        extendedAttributes.put(metricName, metric);

        metricName = metric.getName() + MetricsHistogram.MIN_METRIC_NAME;
        attributes.add(new MBeanAttributeInfo(metricName,
            "java.lang.Long", metric.getDescription(), true, false, false));
        extendedAttributes.put(metricName, metric);

        metricName = metric.getName() + MetricsHistogram.MAX_METRIC_NAME;
        attributes.add(new MBeanAttributeInfo(metricName,
            "java.lang.Long", metric.getDescription(), true, false, false));
        extendedAttributes.put(metricName, metric);

        metricName = metric.getName() + MetricsHistogram.MEAN_METRIC_NAME;
        attributes.add(new MBeanAttributeInfo(metricName,
            "java.lang.Float", metric.getDescription(), true, false, false));
        extendedAttributes.put(metricName, metric);

        metricName = metric.getName() + MetricsHistogram.STD_DEV_METRIC_NAME;
        attributes.add(new MBeanAttributeInfo(metricName,
            "java.lang.Float", metric.getDescription(), true, false, false));
        extendedAttributes.put(metricName, metric);

        metricName = metric.getName() + MetricsHistogram.MEDIAN_METRIC_NAME;
        attributes.add(new MBeanAttributeInfo(metricName,
            "java.lang.Float", metric.getDescription(), true, false, false));
        extendedAttributes.put(metricName, metric);

        metricName = metric.getName() + MetricsHistogram.SEVENTY_FIFTH_PERCENTILE_METRIC_NAME;
        attributes.add(new MBeanAttributeInfo(metricName,
            "java.lang.Float", metric.getDescription(), true, false, false));
        extendedAttributes.put(metricName, metric);

        metricName = metric.getName() + MetricsHistogram.NINETY_FIFTH_PERCENTILE_METRIC_NAME;
        attributes.add(new MBeanAttributeInfo(metricName,
            "java.lang.Float", metric.getDescription(), true, false, false));
        extendedAttributes.put(metricName, metric);

        metricName = metric.getName() + MetricsHistogram.NINETY_NINETH_PERCENTILE_METRIC_NAME;
        attributes.add(new MBeanAttributeInfo(metricName,
            "java.lang.Float", metric.getDescription(), true, false, false));
        extendedAttributes.put(metricName, metric);
      }
      // else, its probably a hadoop metric already registered. Skip it.
    }
View Full Code Here

        final MBeanServer mBeanServer = LocalMBeanServer.get();
        final String newValue = cmd.substring(split[0].length() + split[1].length() + 1).trim();
        try {
            final ObjectName oname = new ObjectName(split[1]);
            final MBeanInfo minfo = mBeanServer.getMBeanInfo(oname);
            final MBeanAttributeInfo attrs[] = minfo.getAttributes();

            String type = String.class.getName();
            for (int i = 0; i < attrs.length; i++) {
                if (attrs[i].getName().equals(split[0])) {
                    type = attrs[i].getType();
View Full Code Here

                if ("org.apache.commons.modeler.BaseModelMBean".equals(code)) {
                    code = (String) mBeanServer.getAttribute(oname, "modelerType");
                }
                streamManager.writeOut("  + modelerType: " + code);

                MBeanAttributeInfo attrs[] = minfo.getAttributes();
                Object value = null;

                for (int i = 0; i < attrs.length; i++) {
                    if (!attrs[i].isReadable()) {
                        continue;
View Full Code Here

        /*
        * Invocation MBeanInfo
        *
        */
        List<MBeanAttributeInfo> expectedAttributes = new ArrayList<MBeanAttributeInfo>();
        expectedAttributes.add(new MBeanAttributeInfo("InvocationCount", "long", "", true, false, false));
        expectedAttributes.add(new MBeanAttributeInfo("InvocationTime", "long", "", true, false, false));
        expectedAttributes.add(new MBeanAttributeInfo("MonitoredMethods", "long", "", true, false, false));

        Map<String, Object> expectedValues = new HashMap<String, Object>();
        expectedValues.put("InvocationCount", (long) 6);
        expectedValues.put("InvocationTime", (long) 0);
        expectedValues.put("MonitoredMethods", (long) 4);


        String[] methods = {"PostConstruct()", "blue()", "green()", "red()"};
        for (String s : methods) {
            expectedAttributes.add(new MBeanAttributeInfo(s + ".Count", "long", "", true, false, false));
            expectedAttributes.add(new MBeanAttributeInfo(s + ".GeometricMean", "double", "", true, false, false));
            expectedAttributes.add(new MBeanAttributeInfo(s + ".Kurtosis", "double", "", true, false, false));
            expectedAttributes.add(new MBeanAttributeInfo(s + ".Max", "double", "", true, false, false));
            expectedAttributes.add(new MBeanAttributeInfo(s + ".Mean", "double", "", true, false, false));
            expectedAttributes.add(new MBeanAttributeInfo(s + ".Min", "double", "", true, false, false));
            expectedAttributes.add(new MBeanAttributeInfo(s + ".Percentile01", "double", "", true, false, false));
            expectedAttributes.add(new MBeanAttributeInfo(s + ".Percentile10", "double", "", true, false, false));
            expectedAttributes.add(new MBeanAttributeInfo(s + ".Percentile25", "double", "", true, false, false));
            expectedAttributes.add(new MBeanAttributeInfo(s + ".Percentile50", "double", "", true, false, false));
            expectedAttributes.add(new MBeanAttributeInfo(s + ".Percentile75", "double", "", true, false, false));
            expectedAttributes.add(new MBeanAttributeInfo(s + ".Percentile90", "double", "", true, false, false));
            expectedAttributes.add(new MBeanAttributeInfo(s + ".Percentile99", "double", "", true, false, false));
            expectedAttributes.add(new MBeanAttributeInfo(s + ".SampleSize", "int", "", true, false, false));
            expectedAttributes.add(new MBeanAttributeInfo(s + ".Skewness", "double", "", true, false, false));
            expectedAttributes.add(new MBeanAttributeInfo(s + ".StandardDeviation", "double", "", true, false, false));
            expectedAttributes.add(new MBeanAttributeInfo(s + ".Sum", "double", "", true, false, false));
            expectedAttributes.add(new MBeanAttributeInfo(s + ".Sumsq", "double", "", true, false, false));
            expectedAttributes.add(new MBeanAttributeInfo(s + ".Variance", "double", "", true, false, false));
            if (s.equals("PostConstruct()")) {
                expectedValues.put(s + ".Count", (long) 3);
            } else {
                expectedValues.put(s + ".Count", (long) 1);
            }
View Full Code Here

        Set gbeanAttributes = gBeanInfo.getAttributes();
        MBeanAttributeInfo[] attributes = new MBeanAttributeInfo[gbeanAttributes.size()];
        int a = 0;
        for (Iterator iterator = gbeanAttributes.iterator(); iterator.hasNext();) {
            GAttributeInfo gAttributeInfo = (GAttributeInfo) iterator.next();
            attributes[a] = new MBeanAttributeInfo(gAttributeInfo.getName(), gAttributeInfo.getType(), "no description available", gAttributeInfo.isReadable(), gAttributeInfo.isWritable(), isIs(gAttributeInfo));
            a++;
        }

        //we don't expose managed constructors
        MBeanConstructorInfo[] constructors = new MBeanConstructorInfo[0];
View Full Code Here

        mBeanInfoLock.writeLock().lock();
        try {
            if (info == null) {
                // Create subordinate information descriptors as required
                AttributeInfo attrs[] = getAttributes();
                MBeanAttributeInfo attributes[] =
                    new MBeanAttributeInfo[attrs.length];
                for (int i = 0; i < attrs.length; i++)
                    attributes[i] = attrs[i].createAttributeInfo();

                OperationInfo opers[] = getOperations();
View Full Code Here

            // Return static ModelMBeanInfo information
            ModelMBeanInfo info = (ModelMBeanInfo) server.getMBeanInfo(name);
            System.out.println("  className=" + info.getClassName());
            System.out.println("  description=" + info.getDescription());
            System.out.println("  mbeanDescriptor=" + info.getMBeanDescriptor());
            MBeanAttributeInfo attrs[] = info.getAttributes();
            for (int i = 0; i < attrs.length; i++)
                System.out.println("  AttributeInfo=" + attrs[i]);
            MBeanConstructorInfo consts[] = info.getConstructors();
            for (int i = 0; i < consts.length; i++)
                System.out.println("  ConstructorInfo=" + consts[i]);
View Full Code Here

                String code = minfo.getClassName();
                if ("org.apache.commons.modeler.BaseModelMBean".equals(code)) {
                    code = (String) jmxServerConnection.getAttribute(oname,
                            "modelerType");
                }
                MBeanAttributeInfo attrs[] = minfo.getAttributes();
                Object value = null;

                for (int i = 0; i < attrs.length; i++) {
                    if (!attrs[i].isReadable())
                        continue;
View Full Code Here

                    catch (NoSuchMethodException e)
                    {
                        // ignored
                    }

                    attributeInfos.add(new MBeanAttributeInfo(
                        fieldName, type.getName(), fieldDescription, getter != null, setter != null, false));

                    fields.put(fieldName, new AttributeAccessor(getter, setter));
                }
            }
View Full Code Here

TOP

Related Classes of javax.management.MBeanAttributeInfo

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.