Java MBean getAttribute(MBeanInfo info, String attrName)

Here you can find the source of getAttribute(MBeanInfo info, String attrName)

Description

Returns the attribute with the specified name.

License

LGPL

Declaration

public static MBeanAttributeInfo getAttribute(MBeanInfo info,
        String attrName) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import javax.management.MBeanInfo;
import javax.management.MBeanAttributeInfo;

public class Main {
    /**// www  .  java  2s .c om
     * Returns the attribute with the specified name.
     */
    public static MBeanAttributeInfo getAttribute(MBeanInfo info,
            String attrName) {
        MBeanAttributeInfo[] attrs = info.getAttributes();
        for (int i = 0; i < attrs.length; i++) {
            if (attrs[i].getName().equals(attrName))
                return attrs[i];
        }
        return null;
    }
}

Related

  1. findAttribute(MBeanAttributeInfo[] attributes, String name)
  2. findFirstMBeanServer()
  3. findMBean(MBeanServer mbs, ObjectName queryName)
  4. findMBeanServer(String agentId)
  5. findMBeanServerForAgentId(String agentId)
  6. getAttribute(MBeanServer mbeanServer, ObjectName objectName, String attributeName)
  7. getAttribute(MBeanServerConnection connection, ObjectName objectName, String attribute)
  8. getAttribute(ObjectName on, MBeanServerConnection server, String name)
  9. getClassFromInfo(MBeanAttributeInfo attributeInfo)