• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java ManagedOperationParameter类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中org.springframework.jmx.export.metadata.ManagedOperationParameter的典型用法代码示例。如果您正苦于以下问题:Java ManagedOperationParameter类的具体用法?Java ManagedOperationParameter怎么用?Java ManagedOperationParameter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

ManagedOperationParameter类属于org.springframework.jmx.export.metadata包,在下文中一共展示了ManagedOperationParameter类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getManagedOperationParameters

点赞 3

import org.springframework.jmx.export.metadata.ManagedOperationParameter; //导入依赖的package包/类
@Override
public ManagedOperationParameter[] getManagedOperationParameters(Method method)
		throws InvalidMetadataException {

	ManagedOperationParameters params = AnnotationUtils.findAnnotation(method, ManagedOperationParameters.class);
	ManagedOperationParameter[] result = null;
	if (params == null) {
		result = new ManagedOperationParameter[0];
	}
	else {
		Annotation[] paramData = params.value();
		result = new ManagedOperationParameter[paramData.length];
		for (int i = 0; i < paramData.length; i++) {
			Annotation annotation = paramData[i];
			ManagedOperationParameter managedOperationParameter = new ManagedOperationParameter();
			AnnotationBeanUtils.copyPropertiesToBean(annotation, managedOperationParameter);
			result[i] = managedOperationParameter;
		}
	}
	return result;
}
 

开发者ID:lamsfoundation,
项目名称:lams,
代码行数:22,
代码来源:AnnotationJmxAttributeSource.java

示例2: getOperationParameters

点赞 3

import org.springframework.jmx.export.metadata.ManagedOperationParameter; //导入依赖的package包/类
/**
 * Reads {@code MBeanParameterInfo} from the {@code ManagedOperationParameter}
 * attributes attached to a method. Returns an empty array of {@code MBeanParameterInfo}
 * if no attributes are found.
 */
@Override
protected MBeanParameterInfo[] getOperationParameters(Method method, String beanKey) {
	ManagedOperationParameter[] params = this.attributeSource.getManagedOperationParameters(method);
	if (ObjectUtils.isEmpty(params)) {
		return super.getOperationParameters(method, beanKey);
	}

	MBeanParameterInfo[] parameterInfo = new MBeanParameterInfo[params.length];
	Class<?>[] methodParameters = method.getParameterTypes();
	for (int i = 0; i < params.length; i++) {
		ManagedOperationParameter param = params[i];
		parameterInfo[i] =
				new MBeanParameterInfo(param.getName(), methodParameters[i].getName(), param.getDescription());
	}
	return parameterInfo;
}
 

开发者ID:lamsfoundation,
项目名称:lams,
代码行数:22,
代码来源:MetadataMBeanInfoAssembler.java

示例3: getManagedOperationParameters

点赞 3

import org.springframework.jmx.export.metadata.ManagedOperationParameter; //导入依赖的package包/类
public ManagedOperationParameter[] getManagedOperationParameters(Method method)
		throws InvalidMetadataException {

	ManagedOperationParameters params = AnnotationUtils.findAnnotation(method, ManagedOperationParameters.class);
	ManagedOperationParameter[] result = null;
	if (params == null) {
		result = new ManagedOperationParameter[0];
	}
	else {
		Annotation[] paramData = params.value();
		result = new ManagedOperationParameter[paramData.length];
		for (int i = 0; i < paramData.length; i++) {
			Annotation annotation = paramData[i];
			ManagedOperationParameter managedOperationParameter = new ManagedOperationParameter();
			AnnotationBeanUtils.copyPropertiesToBean(annotation, managedOperationParameter);
			result[i] = managedOperationParameter;
		}
	}
	return result;
}
 

开发者ID:deathspeeder,
项目名称:class-guard,
代码行数:21,
代码来源:AnnotationJmxAttributeSource.java

示例4: getOperationParameters

点赞 3

import org.springframework.jmx.export.metadata.ManagedOperationParameter; //导入依赖的package包/类
/**
 * Reads {@code MBeanParameterInfo} from the {@code ManagedOperationParameter}
 * attributes attached to a method. Returns an empty array of {@code MBeanParameterInfo}
 * if no attributes are found.
 */
@Override
protected MBeanParameterInfo[] getOperationParameters(Method method, String beanKey) {
	ManagedOperationParameter[] params = this.attributeSource.getManagedOperationParameters(method);
	if (ObjectUtils.isEmpty(params)) {
		return super.getOperationParameters(method, beanKey);
	}

	MBeanParameterInfo[] parameterInfo = new MBeanParameterInfo[params.length];
	Class[] methodParameters = method.getParameterTypes();
	for (int i = 0; i < params.length; i++) {
		ManagedOperationParameter param = params[i];
		parameterInfo[i] =
				new MBeanParameterInfo(param.getName(), methodParameters[i].getName(), param.getDescription());
	}
	return parameterInfo;
}
 

开发者ID:deathspeeder,
项目名称:class-guard,
代码行数:22,
代码来源:MetadataMBeanInfoAssembler.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)