Search in sources :

Example 11 with ModelMBeanAttributeInfo

use of javax.management.modelmbean.ModelMBeanAttributeInfo in project orientdb by orientechnologies.

the class OPerformanceStatisticManagerMBean method populateWALSize.

private void populateWALSize(List<MBeanAttributeInfo> performanceAttributes) {
    final MBeanAttributeInfo walSize = new ModelMBeanAttributeInfo(WAL_SIZE, long.class.getName(), "WAL size in bytes", true, false, false);
    performanceAttributes.add(walSize);
}
Also used : ModelMBeanAttributeInfo(javax.management.modelmbean.ModelMBeanAttributeInfo) ModelMBeanAttributeInfo(javax.management.modelmbean.ModelMBeanAttributeInfo)

Example 12 with ModelMBeanAttributeInfo

use of javax.management.modelmbean.ModelMBeanAttributeInfo in project orientdb by orientechnologies.

the class OPerformanceStatisticManagerMBean method populateWALLogTime.

private void populateWALLogTime(List<MBeanAttributeInfo> performanceAttributes) {
    final MBeanAttributeInfo walLogTime = new ModelMBeanAttributeInfo(WAL_LOG_TIME, long.class.getName(), "Time which is spent to log single record in WAL", true, false, false);
    performanceAttributes.add(walLogTime);
}
Also used : ModelMBeanAttributeInfo(javax.management.modelmbean.ModelMBeanAttributeInfo) ModelMBeanAttributeInfo(javax.management.modelmbean.ModelMBeanAttributeInfo)

Example 13 with ModelMBeanAttributeInfo

use of javax.management.modelmbean.ModelMBeanAttributeInfo in project spring-framework by spring-projects.

the class AnnotationMetadataAssemblerTests method testRegistrationOnInterface.

@Test
public void testRegistrationOnInterface() throws Exception {
    Object bean = getContext().getBean("testInterfaceBean");
    ModelMBeanInfo inf = getAssembler().getMBeanInfo(bean, "bean:name=interfaceTestBean");
    assertNotNull(inf);
    assertEquals("My Managed Bean", inf.getDescription());
    ModelMBeanOperationInfo op = inf.getOperation("foo");
    assertNotNull("foo operation not exposed", op);
    assertEquals("invoke foo", op.getDescription());
    assertNull("doNotExpose operation should not be exposed", inf.getOperation("doNotExpose"));
    ModelMBeanAttributeInfo attr = inf.getAttribute("Bar");
    assertNotNull("bar attribute not exposed", attr);
    assertEquals("Bar description", attr.getDescription());
    ModelMBeanAttributeInfo attr2 = inf.getAttribute("CacheEntries");
    assertNotNull("cacheEntries attribute not exposed", attr2);
    assertEquals("Metric Type should be COUNTER", "COUNTER", attr2.getDescriptor().getFieldValue("metricType"));
}
Also used : ModelMBeanOperationInfo(javax.management.modelmbean.ModelMBeanOperationInfo) ModelMBeanAttributeInfo(javax.management.modelmbean.ModelMBeanAttributeInfo) ModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo) Test(org.junit.Test)

Example 14 with ModelMBeanAttributeInfo

use of javax.management.modelmbean.ModelMBeanAttributeInfo in project spring-framework by spring-projects.

the class AnnotationMetadataAssemblerTests method testAttributeFromInterface.

@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());
}
Also used : ModelMBeanAttributeInfo(javax.management.modelmbean.ModelMBeanAttributeInfo) ModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo) Test(org.junit.Test)

Example 15 with ModelMBeanAttributeInfo

use of javax.management.modelmbean.ModelMBeanAttributeInfo in project spring-framework by spring-projects.

the class MethodNameBasedMBeanInfoAssemblerTests method testGetAgeIsReadOnly.

@Test
public void testGetAgeIsReadOnly() throws Exception {
    ModelMBeanInfo info = getMBeanInfoFromAssembler();
    ModelMBeanAttributeInfo attr = info.getAttribute(AGE_ATTRIBUTE);
    assertTrue(attr.isReadable());
    assertFalse(attr.isWritable());
}
Also used : ModelMBeanAttributeInfo(javax.management.modelmbean.ModelMBeanAttributeInfo) ModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo) Test(org.junit.Test)

Aggregations

ModelMBeanAttributeInfo (javax.management.modelmbean.ModelMBeanAttributeInfo)55 ModelMBeanInfo (javax.management.modelmbean.ModelMBeanInfo)25 Test (org.junit.Test)18 Descriptor (javax.management.Descriptor)15 ModelMBeanOperationInfo (javax.management.modelmbean.ModelMBeanOperationInfo)9 DescriptorSupport (javax.management.modelmbean.DescriptorSupport)6 ModelMBeanInfoSupport (javax.management.modelmbean.ModelMBeanInfoSupport)6 Method (java.lang.reflect.Method)4 RuntimeOperationsException (javax.management.RuntimeOperationsException)4 FileLogger (mx4j.log.FileLogger)4 Logger (mx4j.log.Logger)4 MBeanLogger (mx4j.log.MBeanLogger)4 Attribute (javax.management.Attribute)3 MBeanAttributeInfo (javax.management.MBeanAttributeInfo)3 MBeanServer (javax.management.MBeanServer)3 ObjectName (javax.management.ObjectName)3 ModelMBean (javax.management.modelmbean.ModelMBean)3 ModelMBeanNotificationInfo (javax.management.modelmbean.ModelMBeanNotificationInfo)3 RequiredModelMBean (javax.management.modelmbean.RequiredModelMBean)3 ArrayList (java.util.ArrayList)2