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


Java ModelMBeanInfo.getAttribute方法代码示例

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


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

示例1: testAttributeFromInterface

import javax.management.modelmbean.ModelMBeanInfo; //导入方法依赖的package包/类
@Test
public void testAttributeFromInterface() throws Exception {
	ModelMBeanInfo inf = getMBeanInfoFromAssembler();
	ModelMBeanAttributeInfo attr = inf.getAttribute("Colour");
	assertTrue("The name attribute should be writable", attr.isWritable());
	assertTrue("The name attribute should be readable", attr.isReadable());
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:8,代码来源:AnnotationMetadataAssemblerTests.java

示例2: testGetAgeIsReadOnly

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

	assertTrue(attr.isReadable());
	assertFalse(attr.isWritable());
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:9,代码来源:MethodNameBasedMBeanInfoAssemblerTests.java

示例3: testAttributeDescriptionOnGetter

import javax.management.modelmbean.ModelMBeanInfo; //导入方法依赖的package包/类
@Test
public void testAttributeDescriptionOnGetter() throws Exception {
	ModelMBeanInfo inf = getMBeanInfoFromAssembler();
	ModelMBeanAttributeInfo attr = inf.getAttribute(NAME_ATTRIBUTE);
	assertEquals("The description for the name attribute is incorrect",
			"The Name Attribute", attr.getDescription());
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:8,代码来源:AbstractMetadataAssemblerTests.java

示例4: testReadOnlyAttribute

import javax.management.modelmbean.ModelMBeanInfo; //导入方法依赖的package包/类
/**
 * Tests the situation where the attribute is only defined on the getter.
 */
@Test
public void testReadOnlyAttribute() throws Exception {
	ModelMBeanInfo inf = getMBeanInfoFromAssembler();
	ModelMBeanAttributeInfo attr = inf.getAttribute(AGE_ATTRIBUTE);
	assertFalse("The age attribute should not be writable", attr.isWritable());
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:10,代码来源:AbstractMetadataAssemblerTests.java

示例5: testReadWriteAttribute

import javax.management.modelmbean.ModelMBeanInfo; //导入方法依赖的package包/类
@Test
public void testReadWriteAttribute() throws Exception {
	ModelMBeanInfo inf = getMBeanInfoFromAssembler();
	ModelMBeanAttributeInfo attr = inf.getAttribute(NAME_ATTRIBUTE);
	assertTrue("The name attribute should be writable", attr.isWritable());
	assertTrue("The name attribute should be readable", attr.isReadable());
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:8,代码来源:AbstractMetadataAssemblerTests.java

示例6: testWithOnlySetter

import javax.management.modelmbean.ModelMBeanInfo; //导入方法依赖的package包/类
/**
 * Tests the situation where the property only has a getter.
 */
@Test
public void testWithOnlySetter() throws Exception {
	ModelMBeanInfo inf = getMBeanInfoFromAssembler();
	ModelMBeanAttributeInfo attr = inf.getAttribute("NickName");
	assertNotNull("Attribute should not be null", attr);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:10,代码来源:AbstractMetadataAssemblerTests.java

示例7: testWithOnlyGetter

import javax.management.modelmbean.ModelMBeanInfo; //导入方法依赖的package包/类
/**
 * Tests the situation where the property only has a setter.
 */
@Test
public void testWithOnlyGetter() throws Exception {
	ModelMBeanInfo info = getMBeanInfoFromAssembler();
	ModelMBeanAttributeInfo attr = info.getAttribute("Superman");
	assertNotNull("Attribute should not be null", attr);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:10,代码来源:AbstractMetadataAssemblerTests.java

示例8: 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

示例9: testAttributeInfoHasDescriptors

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

	ModelMBeanAttributeInfo attr = info.getAttribute(NAME_ATTRIBUTE);
	Descriptor desc = attr.getDescriptor();
	assertNotNull("getMethod field should not be null",
			desc.getFieldValue("getMethod"));
	assertNotNull("setMethod field should not be null",
			desc.getFieldValue("setMethod"));
	assertEquals("getMethod field has incorrect value", "getName",
			desc.getFieldValue("getMethod"));
	assertEquals("setMethod field has incorrect value", "setName",
			desc.getFieldValue("setMethod"));
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:16,代码来源:AbstractJmxAssemblerTests.java

示例10: testSupermanIsReadOnly

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

	assertTrue(attr.isReadable());
	assertFalse(attr.isWritable());
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:9,代码来源:MethodExclusionMBeanInfoAssemblerTests.java

示例11: testWithFallThrough

import javax.management.modelmbean.ModelMBeanInfo; //导入方法依赖的package包/类
@Test
public void testWithFallThrough() throws Exception {
	MethodNameBasedMBeanInfoAssembler assembler =
			getWithMapping("foobar", "add,myOperation,getName,setName,getAge");
	assembler.setManagedMethods(new String[]{"getNickName", "setNickName"});

	ModelMBeanInfo inf = assembler.getMBeanInfo(getBean(), getObjectName());
	MBeanAttributeInfo attr = inf.getAttribute("NickName");

	assertNickName(attr);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:12,代码来源:MethodNameBasedMBeanInfoAssemblerMappedTests.java

示例12: testNickNameIsExposed

import javax.management.modelmbean.ModelMBeanInfo; //导入方法依赖的package包/类
@Test
public void testNickNameIsExposed() throws Exception {
	ModelMBeanInfo inf = (ModelMBeanInfo) getMBeanInfo();
	MBeanAttributeInfo attr = inf.getAttribute("NickName");

	assertNickName(attr);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:8,代码来源:MethodNameBasedMBeanInfoAssemblerMappedTests.java

示例13: testGetAgeIsReadOnly

import javax.management.modelmbean.ModelMBeanInfo; //导入方法依赖的package包/类
@Test
public void testGetAgeIsReadOnly() throws Exception {
	ModelMBeanInfo info = getMBeanInfoFromAssembler();
	ModelMBeanAttributeInfo attr = info.getAttribute(AGE_ATTRIBUTE);
	assertTrue("Age is not readable", attr.isReadable());
	assertFalse("Age is not writable", attr.isWritable());
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:8,代码来源:MethodExclusionMBeanInfoAssemblerComboTests.java

示例14: testNickNameIsExposed

import javax.management.modelmbean.ModelMBeanInfo; //导入方法依赖的package包/类
@Test
public void testNickNameIsExposed() throws Exception {
	ModelMBeanInfo inf = (ModelMBeanInfo) getMBeanInfo();
	MBeanAttributeInfo attr = inf.getAttribute("NickName");
	assertNotNull("Nick Name should not be null", attr);
	assertTrue("Nick Name should be writable", attr.isWritable());
	assertTrue("Nick Name should be readable", attr.isReadable());
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:9,代码来源:MethodExclusionMBeanInfoAssemblerComboTests.java

示例15: testGetAgeIsReadOnly

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

	assertTrue("Age is not readable", attr.isReadable());
	assertFalse("Age is not writable", attr.isWritable());
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:9,代码来源:InterfaceBasedMBeanInfoAssemblerMappedTests.java


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