From 5f2d88f74a626ec04f0226accbb540dd9f74af5c Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Thu, 9 Sep 2010 09:04:40 +0000 Subject: [PATCH] polishing --- .../AbstractReflectiveMBeanInfoAssembler.java | 28 ++++++++++--------- .../assembler/MetadataMBeanInfoAssembler.java | 8 +++--- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/org.springframework.context/src/main/java/org/springframework/jmx/export/assembler/AbstractReflectiveMBeanInfoAssembler.java b/org.springframework.context/src/main/java/org/springframework/jmx/export/assembler/AbstractReflectiveMBeanInfoAssembler.java index c19fbc9f576..70b52f96a6b 100644 --- a/org.springframework.context/src/main/java/org/springframework/jmx/export/assembler/AbstractReflectiveMBeanInfoAssembler.java +++ b/org.springframework.context/src/main/java/org/springframework/jmx/export/assembler/AbstractReflectiveMBeanInfoAssembler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2010 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -402,7 +402,7 @@ public abstract class AbstractReflectiveMBeanInfoAssembler extends AbstractMBean /** * Return the class to be used for the JMX descriptor field "class". * Only applied when the "exposeClassDescriptor" property is "true". - *

Default implementation returns the first implemented interface + *

The default implementation returns the first implemented interface * for a JDK proxy, and the target class else. * @param managedBean the bean instance (might be an AOP proxy) * @return the class to expose in the descriptor field "class" @@ -450,7 +450,7 @@ public abstract class AbstractReflectiveMBeanInfoAssembler extends AbstractMBean /** * Get the description for a particular attribute. - *

Default implementation returns a description for the operation + *

The default implementation returns a description for the operation * that is the name of corresponding Method. * @param propertyDescriptor the PropertyDescriptor for the attribute * @param beanKey the key associated with the MBean in the beans map @@ -463,7 +463,7 @@ public abstract class AbstractReflectiveMBeanInfoAssembler extends AbstractMBean /** * Get the description for a particular operation. - *

Default implementation returns a description for the operation + *

The default implementation returns a description for the operation * that is the name of corresponding Method. * @param method the operation method * @param beanKey the key associated with the MBean in the beans map @@ -475,8 +475,8 @@ public abstract class AbstractReflectiveMBeanInfoAssembler extends AbstractMBean } /** - * Create parameter info for the given method. Default implementation - * returns an empty arry of MBeanParameterInfo. + * Create parameter info for the given method. + *

The default implementation returns an empty arry of MBeanParameterInfo. * @param method the Method to get the parameter information for * @param beanKey the key associated with the MBean in the beans map * of the MBeanExporter @@ -488,8 +488,8 @@ public abstract class AbstractReflectiveMBeanInfoAssembler extends AbstractMBean /** - * Allows subclasses to add extra fields to the Descriptor for an - * MBean. Default implementation sets the currencyTimeLimit field to + * Allows subclasses to add extra fields to the Descriptor for an MBean. + *

The default implementation sets the currencyTimeLimit field to * the specified "defaultCurrencyTimeLimit", if any (by default none). * @param descriptor the Descriptor for the MBean resource. * @param managedBean the bean instance (might be an AOP proxy) @@ -504,8 +504,9 @@ public abstract class AbstractReflectiveMBeanInfoAssembler extends AbstractMBean } /** - * Allows subclasses to add extra fields to the Descriptor for a particular - * attribute. Default implementation sets the currencyTimeLimit field to + * Allows subclasses to add extra fields to the Descriptor for a + * particular attribute. + *

The default implementation sets the currencyTimeLimit field to * the specified "defaultCurrencyTimeLimit", if any (by default none). * @param desc the attribute descriptor * @param getter the accessor method for the attribute @@ -520,8 +521,9 @@ public abstract class AbstractReflectiveMBeanInfoAssembler extends AbstractMBean } /** - * Allows subclasses to add extra fields to the Descriptor for a particular - * operation. Default implementation sets the currencyTimeLimit field to + * Allows subclasses to add extra fields to the Descriptor for a + * particular operation. + *

The default implementation sets the currencyTimeLimit field to * the specified "defaultCurrencyTimeLimit", if any (by default none). * @param desc the operation descriptor * @param method the method corresponding to the operation @@ -548,7 +550,7 @@ public abstract class AbstractReflectiveMBeanInfoAssembler extends AbstractMBean /** * Apply the given JMX "currencyTimeLimit" value to the given descriptor. - *

Default implementation sets a value >0 as-is (as number of cache seconds), + *

The default implementation sets a value >0 as-is (as number of cache seconds), * turns a value of 0 into Integer.MAX_VALUE ("always cache") * and sets the "defaultCurrencyTimeLimit" (if any, indicating "never cache") in case of * a value <0. This follows the recommendation in the JMX 1.2 specification. diff --git a/org.springframework.context/src/main/java/org/springframework/jmx/export/assembler/MetadataMBeanInfoAssembler.java b/org.springframework.context/src/main/java/org/springframework/jmx/export/assembler/MetadataMBeanInfoAssembler.java index 9e0af17a046..9f035edc5bc 100644 --- a/org.springframework.context/src/main/java/org/springframework/jmx/export/assembler/MetadataMBeanInfoAssembler.java +++ b/org.springframework.context/src/main/java/org/springframework/jmx/export/assembler/MetadataMBeanInfoAssembler.java @@ -201,9 +201,9 @@ public class MetadataMBeanInfoAssembler extends AbstractReflectiveMBeanInfoAssem Method writeMethod = propertyDescriptor.getWriteMethod(); ManagedAttribute getter = - (readMethod != null) ? this.attributeSource.getManagedAttribute(readMethod) : null; + (readMethod != null ? this.attributeSource.getManagedAttribute(readMethod) : null); ManagedAttribute setter = - (writeMethod != null) ? this.attributeSource.getManagedAttribute(writeMethod) : null; + (writeMethod != null ? this.attributeSource.getManagedAttribute(writeMethod) : null); if (getter != null && StringUtils.hasText(getter.getDescription())) { return getter.getDescription(); @@ -212,8 +212,8 @@ public class MetadataMBeanInfoAssembler extends AbstractReflectiveMBeanInfoAssem return setter.getDescription(); } - ManagedMetric metric = (readMethod != null) ? this.attributeSource.getManagedMetric(readMethod) : null; - if(metric != null && StringUtils.hasText(metric.getDescription())) { + ManagedMetric metric = (readMethod != null ? this.attributeSource.getManagedMetric(readMethod) : null); + if (metric != null && StringUtils.hasText(metric.getDescription())) { return metric.getDescription(); }