当前位置: 首页>>代码示例>>Java>>正文


Java ModelMBeanInfo.getOperation方法代码示例

本文整理汇总了Java中javax.management.modelmbean.ModelMBeanInfo.getOperation方法的典型用法代码示例。如果您正苦于以下问题:Java ModelMBeanInfo.getOperation方法的具体用法?Java ModelMBeanInfo.getOperation怎么用?Java ModelMBeanInfo.getOperation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.management.modelmbean.ModelMBeanInfo的用法示例。


在下文中一共展示了ModelMBeanInfo.getOperation方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testAttributeHasCorrespondingOperations

import javax.management.modelmbean.ModelMBeanInfo; //导入方法依赖的package包/类
@Test
public void testAttributeHasCorrespondingOperations() throws Exception {
	ModelMBeanInfo info = getMBeanInfoFromAssembler();

	ModelMBeanOperationInfo get = info.getOperation("getName");
	assertNotNull("get operation should not be null", get);
	assertEquals("get operation should have visibility of four",
			get.getDescriptor().getFieldValue("visibility"),
			new Integer(4));
	assertEquals("get operation should have role \"getter\"", "getter", get.getDescriptor().getFieldValue("role"));

	ModelMBeanOperationInfo set = info.getOperation("setName");
	assertNotNull("set operation should not be null", set);
	assertEquals("set operation should have visibility of four",
			set.getDescriptor().getFieldValue("visibility"),
			new Integer(4));
	assertEquals("set operation should have role \"setter\"", "setter", set.getDescriptor().getFieldValue("role"));
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:19,代码来源:AbstractJmxAssemblerTests.java

示例2: testOperationParameterMetadata

import javax.management.modelmbean.ModelMBeanInfo; //导入方法依赖的package包/类
@Test
public void testOperationParameterMetadata() throws Exception {
	ModelMBeanInfo info = getMBeanInfoFromAssembler();
	ModelMBeanOperationInfo oper = info.getOperation("add");
	MBeanParameterInfo[] params = oper.getSignature();

	assertEquals("Invalid number of params", 2, params.length);
	assertEquals("Incorrect name for x param", "x", params[0].getName());
	assertEquals("Incorrect type for x param", int.class.getName(), params[0].getType());

	assertEquals("Incorrect name for y param", "y", params[1].getName());
	assertEquals("Incorrect type for y param", int.class.getName(), params[1].getType());
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:14,代码来源:AbstractMetadataAssemblerTests.java

示例3: testMetricDescription

import javax.management.modelmbean.ModelMBeanInfo; //导入方法依赖的package包/类
@Test
public void testMetricDescription() throws Exception {
	ModelMBeanInfo inf = getMBeanInfoFromAssembler();
	ModelMBeanAttributeInfo metric = inf.getAttribute(QUEUE_SIZE_METRIC);
	ModelMBeanOperationInfo operation = inf.getOperation("getQueueSize");
	assertEquals("The description for the queue size metric is incorrect",
			"The QueueSize metric", metric.getDescription());
	assertEquals("The description for the getter operation of the queue size metric is incorrect",
			"The QueueSize metric", operation.getDescription());
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:11,代码来源:AbstractMetadataAssemblerTests.java

示例4: testSetNameParameterIsNamed

import javax.management.modelmbean.ModelMBeanInfo; //导入方法依赖的package包/类
@Test
public void testSetNameParameterIsNamed() throws Exception {
	ModelMBeanInfo info = getMBeanInfoFromAssembler();

	MBeanOperationInfo operationSetAge = info.getOperation("setName");
	assertEquals("name", operationSetAge.getSignature()[0].getName());
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:8,代码来源:MethodNameBasedMBeanInfoAssemblerTests.java

示例5: testOperationFromInterface

import javax.management.modelmbean.ModelMBeanInfo; //导入方法依赖的package包/类
@Test
public void testOperationFromInterface() throws Exception {
	ModelMBeanInfo inf = getMBeanInfoFromAssembler();
	ModelMBeanOperationInfo op = inf.getOperation("fromInterface");
	assertNotNull(op);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:7,代码来源:AnnotationMetadataAssemblerTests.java

示例6: testOperationOnGetter

import javax.management.modelmbean.ModelMBeanInfo; //导入方法依赖的package包/类
@Test
public void testOperationOnGetter() throws Exception {
	ModelMBeanInfo inf = getMBeanInfoFromAssembler();
	ModelMBeanOperationInfo op = inf.getOperation("getExpensiveToCalculate");
	assertNotNull(op);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:7,代码来源:AnnotationMetadataAssemblerTests.java


注:本文中的javax.management.modelmbean.ModelMBeanInfo.getOperation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。