Examples of ManagedAttribute


Examples of org.objectweb.celtix.bus.management.jmx.export.annotation.ManagedAttribute

        }
       
        Method[] methods = clazz.getDeclaredMethods();
       
        for (int i = 0; i < methods.length; i++) {
            ManagedAttribute ma = getManagedAttribute(methods[i]);
            //add Attribute to the ModelMBean
            if (ma != null) {
                String attributeName = getAttributeName(methods[i].getName());               
                if (!supporter.checkAttribute(attributeName)) {
                    String attributeType = getAttributeType(methods, attributeName);
View Full Code Here

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

    org.springframework.jmx.export.annotation.ManagedAttribute ann =
        AnnotationUtils.findAnnotation(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

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

  @Override
  protected String getAttributeDescription(PropertyDescriptor propertyDescriptor, String beanKey) {
    Method readMethod = propertyDescriptor.getReadMethod();
    Method writeMethod = propertyDescriptor.getWriteMethod();

    ManagedAttribute getter =
        (readMethod != null ? this.attributeSource.getManagedAttribute(readMethod) : null);
    ManagedAttribute setter =
        (writeMethod != null ? this.attributeSource.getManagedAttribute(writeMethod) : null);

    if (getter != null && StringUtils.hasText(getter.getDescription())) {
      return getter.getDescription();
    }
    else if (setter != null && StringUtils.hasText(setter.getDescription())) {
      return setter.getDescription();
    }

    ManagedMetric metric = (readMethod != null ? this.attributeSource.getManagedMetric(readMethod) : null);
    if (metric != null && StringUtils.hasText(metric.getDescription())) {
      return metric.getDescription();
View Full Code Here

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

   */
  @Override
  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();
      }
      ManagedMetric metric = this.attributeSource.getManagedMetric(method);
      if (metric != null && StringUtils.hasText(metric.getDescription())) {
        return metric.getDescription();
      }
View Full Code Here

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

  protected void populateAttributeDescriptor(Descriptor desc, Method getter, Method setter, String beanKey) {
    if(getter != null && hasManagedMetric(getter)) {
      populateMetricDescriptor(desc, this.attributeSource.getManagedMetric(getter));
    }
    else {
      ManagedAttribute gma =
        (getter == null) ? ManagedAttribute.EMPTY : this.attributeSource.getManagedAttribute(getter);
      ManagedAttribute sma =
        (setter == null) ? ManagedAttribute.EMPTY : this.attributeSource.getManagedAttribute(setter);
      populateAttributeDescriptor(desc,gma,sma);
    }
  }
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

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

   */
  protected String getAttributeDescription(PropertyDescriptor propertyDescriptor, String beanKey) {
    Method readMethod = propertyDescriptor.getReadMethod();
    Method writeMethod = propertyDescriptor.getWriteMethod();

    ManagedAttribute getter =
        (readMethod != null) ? this.attributeSource.getManagedAttribute(readMethod) : null;
    ManagedAttribute setter =
        (writeMethod != null) ? this.attributeSource.getManagedAttribute(writeMethod) : null;

    if (getter != null && StringUtils.hasText(getter.getDescription())) {
      return getter.getDescription();
    }
    else if (setter != null && StringUtils.hasText(setter.getDescription())) {
      return setter.getDescription();
    }
    return propertyDescriptor.getDisplayName();
  }
View Full Code Here

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

   */
  protected String getAttributeDescription(PropertyDescriptor propertyDescriptor, String beanKey) {
    Method readMethod = propertyDescriptor.getReadMethod();
    Method writeMethod = propertyDescriptor.getWriteMethod();

    ManagedAttribute getter =
        (readMethod != null) ? this.attributeSource.getManagedAttribute(readMethod) : null;
    ManagedAttribute setter =
        (writeMethod != null) ? this.attributeSource.getManagedAttribute(writeMethod) : null;

    if (getter != null && StringUtils.hasText(getter.getDescription())) {
      return getter.getDescription();
    }
    else if (setter != null && StringUtils.hasText(setter.getDescription())) {
      return setter.getDescription();
    }
    return propertyDescriptor.getDisplayName();
  }
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.