/** * Retrieves the description for the supplied {@code Method} from the * metadata. Uses the method name is no description is present in the metadata. */ @Override protected String getOperationDescription(Method method, String beanKey) { PropertyDescriptor pd = BeanUtils.findPropertyForMethod(method); if (pd != null) { ManagedAttribute ma = obtainAttributeSource().getManagedAttribute(method); if (ma != null && StringUtils.hasText(ma.getDescription())) { return ma.getDescription(); } ManagedMetric metric = obtainAttributeSource().getManagedMetric(method); if (metric != null && StringUtils.hasText(metric.getDescription())) { return metric.getDescription(); } return method.getName(); } else { ManagedOperation mo = obtainAttributeSource().getManagedOperation(method); if (mo != null && StringUtils.hasText(mo.getDescription())) { return mo.getDescription(); } return method.getName(); } }
/** * Retrieves the description for the supplied {@code Method} from the * metadata. Uses the method name is no description is present in the metadata. */ @Override protected String getOperationDescription(Method method, String beanKey) { PropertyDescriptor pd = BeanUtils.findPropertyForMethod(method); if (pd != null) { ManagedAttribute ma = obtainAttributeSource().getManagedAttribute(method); if (ma != null && StringUtils.hasText(ma.getDescription())) { return ma.getDescription(); } ManagedMetric metric = obtainAttributeSource().getManagedMetric(method); if (metric != null && StringUtils.hasText(metric.getDescription())) { return metric.getDescription(); } return method.getName(); } else { ManagedOperation mo = obtainAttributeSource().getManagedOperation(method); if (mo != null && StringUtils.hasText(mo.getDescription())) { return mo.getDescription(); } return method.getName(); } }
private String getDescription(Method method, Supplier<String> fallback) { ManagedOperation managed = jmxAttributeSource.getManagedOperation(method); if (managed != null && StringUtils.hasText(managed.getDescription())) { return managed.getDescription(); } return fallback.get(); }
/** * Retrieves the description for the supplied {@code Method} from the * metadata. Uses the method name is no description is present in the metadata. */ @Override @Nonnull protected String getOperationDescription(Method method, String beanKey) { PropertyDescriptor pd = BeanUtils.findPropertyForMethod(method); Method resolvedMethod = findJmxMethod(method, beanKey); if (pd != null) { ManagedAttribute ma = this.attributeSource.getManagedAttribute(resolvedMethod); if (ma != null && StringUtils.hasText(ma.getDescription())) { return ma.getDescription(); } ManagedMetric metric = this.attributeSource.getManagedMetric(resolvedMethod); if (metric != null && StringUtils.hasText(metric.getDescription())) { return metric.getDescription(); } } ManagedOperation mo = this.attributeSource.getManagedOperation(resolvedMethod); if (mo != null && StringUtils.hasText(mo.getDescription())) { return mo.getDescription(); } return ""; // no operation description by default }
/** * Retrieves the description for the supplied {@code Method} from the * metadata. Uses the method name is no description is present in the metadata. */ @Override protected String getOperationDescription(Method method, String beanKey) { PropertyDescriptor pd = BeanUtils.findPropertyForMethod(method); if (pd != null) { ManagedAttribute ma = obtainAttributeSource().getManagedAttribute(method); if (ma != null && StringUtils.hasText(ma.getDescription())) { return ma.getDescription(); } ManagedMetric metric = obtainAttributeSource().getManagedMetric(method); if (metric != null && StringUtils.hasText(metric.getDescription())) { return metric.getDescription(); } return method.getName(); } else { ManagedOperation mo = obtainAttributeSource().getManagedOperation(method); if (mo != null && StringUtils.hasText(mo.getDescription())) { return mo.getDescription(); } return method.getName(); } }