Search in sources :

Example 56 with AttributeList

use of javax.management.AttributeList in project sling by apache.

the class MBeanResource method getPropertiesMap.

private Map<String, Object> getPropertiesMap() {
    final Map<String, Object> result = new HashMap<String, Object>();
    result.put(Constants.PROP_RESOURCE_TYPE, this.getResourceType());
    result.put(Constants.PROP_RESOURCE_SUPER_TYPE, this.getResourceSuperType());
    if (this.info.getDescription() != null) {
        result.put(Constants.PROP_DESCRIPTION, this.info.getDescription());
    }
    result.put(Constants.PROP_CLASSNAME, this.info.getClassName());
    result.put(Constants.PROP_OBJECTNAME, this.objectName.getCanonicalName());
    final AttributeList values = this.getAttributes();
    final Iterator iter = values.iterator();
    while (iter.hasNext()) {
        final Attribute a = (Attribute) iter.next();
        final Object value = a.getValue();
        if (value != null) {
            result.put(a.getName(), value);
        }
    }
    return result;
}
Also used : HashMap(java.util.HashMap) Attribute(javax.management.Attribute) AttributeList(javax.management.AttributeList) Iterator(java.util.Iterator)

Aggregations

AttributeList (javax.management.AttributeList)56 Attribute (javax.management.Attribute)46 ReflectionException (javax.management.ReflectionException)22 AttributeNotFoundException (javax.management.AttributeNotFoundException)16 InstanceNotFoundException (javax.management.InstanceNotFoundException)16 MBeanException (javax.management.MBeanException)15 InvalidAttributeValueException (javax.management.InvalidAttributeValueException)14 ObjectName (javax.management.ObjectName)14 MBeanAttributeInfo (javax.management.MBeanAttributeInfo)10 MBeanServer (javax.management.MBeanServer)8 IOException (java.io.IOException)7 InvocationTargetException (java.lang.reflect.InvocationTargetException)7 MBeanInfo (javax.management.MBeanInfo)7 RuntimeOperationsException (javax.management.RuntimeOperationsException)7 HashMap (java.util.HashMap)6 MalformedObjectNameException (javax.management.MalformedObjectNameException)6 ListenerNotFoundException (javax.management.ListenerNotFoundException)5 MBeanRegistrationException (javax.management.MBeanRegistrationException)5 NotCompliantMBeanException (javax.management.NotCompliantMBeanException)5 ArrayList (java.util.ArrayList)4