Java Code Examples for javax.management.MBeanAttributeInfo.getDescription()

The following are Jave code examples for showing how to use getDescription() of the javax.management.MBeanAttributeInfo class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: metrics-tomcat   File: AnnotatedStandardMBean.java   Source Code and License Vote up 6 votes
/** {@inheritDoc} */
@Override
protected String getDescription(final MBeanAttributeInfo info) {
	String descr = info.getDescription();
	Method m = getMethod(getMBeanInterface(),
			"get" + info.getName().substring(0, 1).toUpperCase() + info.getName().substring(1));
	if (m == null) {
		m = getMethod(getMBeanInterface(),
				"is" + info.getName().substring(0, 1).toUpperCase() + info.getName().substring(1));
	}
	if (m == null) {
		m = getMethod(getMBeanInterface(),
				"does" + info.getName().substring(0, 1).toUpperCase() + info.getName().substring(1));
	}
	if (m != null) {
		Description d = m.getAnnotation(Description.class);
		if (d != null) {
			descr = d.value();
		}
	}
	return descr;
}
 
Example 2
Project: eZooKeeper   File: MBeanAttributeModelElementType.java   Source Code and License Vote up 5 votes
@Override
public String getColumnText(Object element, int columnIndex) {

    // 0:Name | 1:Value | 2:Type | 3:Description

    MBeanAttributeModel model = (MBeanAttributeModel) element;
    MBeanAttribute mbeanAttribute = model.getData();
    MBeanAttributeInfo info = mbeanAttribute.getInfo();
    switch (columnIndex) {

    case 0:
        return mbeanAttribute.getName();

    case 1:

        String valueError = mbeanAttribute.getValueRetrievalErrorMessage();
        if (valueError != null) {
            return valueError;
        }
        else {
            return mbeanAttribute.getValueAsString();
        }

    case 2:
        return info.getType();

    case 3:
        return info.getDescription();

    }

    return null;
}