org.springframework.jmx.export.metadata.ManagedOperation Java Examples

The following examples show how to use org.springframework.jmx.export.metadata.ManagedOperation. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MetadataMBeanInfoAssembler.java    From spring-analysis-note with MIT License 6 votes vote down vote up
/**
 * 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();
	}
}
 
Example #2
Source File: MetadataMBeanInfoAssembler.java    From java-technology-stack with MIT License 6 votes vote down vote up
/**
 * 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();
	}
}
 
Example #3
Source File: MetadataMBeanInfoAssembler.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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 = 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();
		}
		return method.getName();
	}
	else {
		ManagedOperation mo = this.attributeSource.getManagedOperation(method);
		if (mo != null && StringUtils.hasText(mo.getDescription())) {
			return mo.getDescription();
		}
		return method.getName();
	}
}
 
Example #4
Source File: MetadataMBeanInfoAssembler.java    From spring4-understanding with Apache License 2.0 6 votes vote down vote up
/**
 * 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 = 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();
		}
		return method.getName();
	}
	else {
		ManagedOperation mo = this.attributeSource.getManagedOperation(method);
		if (mo != null && StringUtils.hasText(mo.getDescription())) {
			return mo.getDescription();
		}
		return method.getName();
	}
}
 
Example #5
Source File: MetadataMBeanInfoAssembler.java    From spring-analysis-note with MIT License 5 votes vote down vote up
/**
 * Adds descriptor fields from the {@code ManagedAttribute} attribute
 * to the attribute descriptor. Specifically, adds the {@code currencyTimeLimit}
 * descriptor field if it is present in the metadata.
 */
@Override
protected void populateOperationDescriptor(Descriptor desc, Method method, String beanKey) {
	ManagedOperation mo = obtainAttributeSource().getManagedOperation(method);
	if (mo != null) {
		applyCurrencyTimeLimit(desc, mo.getCurrencyTimeLimit());
	}
}
 
Example #6
Source File: MetadataMBeanInfoAssembler.java    From java-technology-stack with MIT License 5 votes vote down vote up
/**
 * Adds descriptor fields from the {@code ManagedAttribute} attribute
 * to the attribute descriptor. Specifically, adds the {@code currencyTimeLimit}
 * descriptor field if it is present in the metadata.
 */
@Override
protected void populateOperationDescriptor(Descriptor desc, Method method, String beanKey) {
	ManagedOperation mo = obtainAttributeSource().getManagedOperation(method);
	if (mo != null) {
		applyCurrencyTimeLimit(desc, mo.getCurrencyTimeLimit());
	}
}
 
Example #7
Source File: MetadataMBeanInfoAssembler.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Adds descriptor fields from the {@code ManagedAttribute} attribute
 * to the attribute descriptor. Specifically, adds the {@code currencyTimeLimit}
 * descriptor field if it is present in the metadata.
 */
@Override
protected void populateOperationDescriptor(Descriptor desc, Method method, String beanKey) {
	ManagedOperation mo = this.attributeSource.getManagedOperation(method);
	if (mo != null) {
		applyCurrencyTimeLimit(desc, mo.getCurrencyTimeLimit());
	}
}
 
Example #8
Source File: MetadataMBeanInfoAssembler.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
/**
 * Adds descriptor fields from the {@code ManagedAttribute} attribute
 * to the attribute descriptor. Specifically, adds the {@code currencyTimeLimit}
 * descriptor field if it is present in the metadata.
 */
@Override
protected void populateOperationDescriptor(Descriptor desc, Method method, String beanKey) {
	ManagedOperation mo = this.attributeSource.getManagedOperation(method);
	if (mo != null) {
		applyCurrencyTimeLimit(desc, mo.getCurrencyTimeLimit());
	}
}