Examples of ManagedAttribute


Examples of org.springframework.jmx.export.metadata.ManagedAttribute

   * metadata. Uses the method name is no description is present in the metadata.
   */
  protected String getOperationDescription(Method method, String beanKey) {
    PropertyDescriptor pd = BeanUtils.findPropertyForMethod(method);
    if (pd != null) {
      ManagedAttribute ma = this.attributeSource.getManagedAttribute(method);
      if (ma != null && StringUtils.hasText(ma.getDescription())) {
        return ma.getDescription();
      }
      return method.getName();
    }
    else {
      ManagedOperation mo = this.attributeSource.getManagedOperation(method);
View Full Code Here

Examples of org.springframework.jmx.export.metadata.ManagedAttribute

   * to the attribute descriptor. Specifically, adds the <code>currencyTimeLimit</code>,
   * <code>default</code>, <code>persistPolicy</code> and <code>persistPeriod</code>
   * descriptor fields if they are present in the metadata.
   */
  protected void populateAttributeDescriptor(Descriptor desc, Method getter, Method setter, String beanKey) {
    ManagedAttribute gma =
        (getter == null) ? ManagedAttribute.EMPTY : this.attributeSource.getManagedAttribute(getter);
    ManagedAttribute sma =
        (setter == null) ? ManagedAttribute.EMPTY : this.attributeSource.getManagedAttribute(setter);

    applyCurrencyTimeLimit(desc, resolveIntDescriptor(gma.getCurrencyTimeLimit(), sma.getCurrencyTimeLimit()));

    Object defaultValue = resolveObjectDescriptor(gma.getDefaultValue(), sma.getDefaultValue());
    desc.setField(FIELD_DEFAULT, defaultValue);

    String persistPolicy = resolveStringDescriptor(gma.getPersistPolicy(), sma.getPersistPolicy());
    if (StringUtils.hasLength(persistPolicy)) {
      desc.setField(FIELD_PERSIST_POLICY, persistPolicy);
    }
    int persistPeriod = resolveIntDescriptor(gma.getPersistPeriod(), sma.getPersistPeriod());
    if (persistPeriod >= 0) {
      desc.setField(FIELD_PERSIST_PERIOD, Integer.toString(persistPeriod));
    }
  }
View Full Code Here

Examples of org.springframework.jmx.export.metadata.ManagedAttribute

    org.springframework.jmx.export.annotation.ManagedAttribute ann =
            AnnotationUtils.getAnnotation(method, org.springframework.jmx.export.annotation.ManagedAttribute.class);
    if (ann == null) {
      return null;
    }
    ManagedAttribute managedAttribute = new ManagedAttribute();
    AnnotationBeanUtils.copyPropertiesToBean(ann, managedAttribute, "defaultValue");
    if (ann.defaultValue().length() > 0) {
      managedAttribute.setDefaultValue(ann.defaultValue());
    }
    return managedAttribute;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.