Package javax.management.modelmbean

Examples of javax.management.modelmbean.ModelMBeanInfo


    assertTrue("Age is not readable", attr.isReadable());
    assertTrue("Age is not writable", attr.isWritable());
  }

  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());
  }
View Full Code Here


public class MethodNameBasedMBeanInfoAssemblerMappedTests extends AbstractJmxAssemblerTests {

  protected static final String OBJECT_NAME = "bean:name=testBean4";

  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());
  }
View Full Code Here

  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);
  }
View Full Code Here

    assertNickName(attr);
  }

  public void testNickNameIsExposed() throws Exception {
    ModelMBeanInfo inf = (ModelMBeanInfo) getMBeanInfo();
    MBeanAttributeInfo attr = inf.getAttribute("NickName");

    assertNickName(attr);
  }
View Full Code Here

public class InterfaceBasedMBeanInfoAssemblerMappedTests extends AbstractJmxAssemblerTests {

  protected static final String OBJECT_NAME = "bean:name=testBean4";

  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());
  }
View Full Code Here

  public void testWithFallThrough() throws Exception {
    InterfaceBasedMBeanInfoAssembler assembler =
        getWithMapping("foobar", "org.springframework.jmx.export.assembler.ICustomJmxBean");
    assembler.setManagedInterfaces(new Class[] {IAdditionalTestMethods.class});

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

    assertNickName(attr);
  }
View Full Code Here

    assertNickName(attr);
  }

  public void testNickNameIsExposed() throws Exception {
    ModelMBeanInfo inf = (ModelMBeanInfo) getMBeanInfo();
    MBeanAttributeInfo attr = inf.getAttribute("NickName");

    assertNickName(attr);
  }
View Full Code Here

    assembler.setIgnoredMethods(new String[] {"dontExposeMe", "setSuperman"});
    return assembler;
  }

  public void testSupermanIsReadOnly() throws Exception {
    ModelMBeanInfo info = getMBeanInfoFromAssembler();
    ModelMBeanAttributeInfo attr = info.getAttribute("Superman");

    assertTrue(attr.isReadable());
    assertFalse(attr.isWritable());
  }
View Full Code Here

        this.assembler = new MetadataMBeanInfoAssembler();
        this.assembler.setAttributeSource(new AnnotationJmxAttributeSource());
    }

    public RequiredModelMBean assemble(Object obj, ObjectName name) throws JMException {
        ModelMBeanInfo mbi = null;

        // prefer to use the managed instance if it has been annotated with Spring JMX annotations
        if (obj instanceof ManagedInstance) {
            Object custom = ((ManagedInstance) obj).getInstance();
            if (custom != null && ObjectHelper.hasAnnotation(custom.getClass().getAnnotations(), ManagedResource.class)) {
View Full Code Here

        try {
            registerMBeanWithServer(obj, persist(name), forceRegistration);          
        } catch (NotCompliantMBeanException e) {       
            //If this is not a "normal" MBean, then try to deploy it using JMX annotations
            ModelMBeanAssembler assembler = new ModelMBeanAssembler();
            ModelMBeanInfo mbi = assembler.getModelMbeanInfo(obj.getClass());
            register(obj, name, mbi, forceRegistration);
        }               
    }
View Full Code Here

TOP

Related Classes of javax.management.modelmbean.ModelMBeanInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.