Examples of ModelMBeanInfo


Examples of javax.management.modelmbean.ModelMBeanInfo

        if (meFilter.isEventEnabled(event)) {
            Instrumentation instrumentation = (Instrumentation)event.getSource();
               
            if (meFilter.isCreateEvent(event)) {
                   
                ModelMBeanInfo mbi = mbAssembler.getModelMbeanInfo(instrumentation.getClass());
               
                if (mbi != null) {                   
                    RequiredModelMBean rtMBean;
                    try {
                                               
View Full Code Here

Examples of javax.management.modelmbean.ModelMBeanInfo

            e.printStackTrace();
        }
      
       
        //create the mbean and register it
        ModelMBeanInfo mbi = getMBeanInfoFromAssembler();
       
        RequiredModelMBean rtMBean;
       
        rtMBean = (RequiredModelMBean)server.instantiate(
            "javax.management.modelmbean.RequiredModelMBean");
View Full Code Here

Examples of javax.management.modelmbean.ModelMBeanInfo

    }
   
    //the client get and set the ModelObject and setup the ManagerBean
   
    public void testRegisterOperations() throws Exception {
        ModelMBeanInfo info = getMBeanInfoFromAssembler();
        assertEquals("Incorrect number of operations registered",
                      10, info.getOperations().length);
    }
View Full Code Here

Examples of javax.management.modelmbean.ModelMBeanInfo

        assertEquals("Incorrect number of operations registered",
                      10, info.getOperations().length);
    }
      
    public void testGetMBeanInfo() throws Exception {
        ModelMBeanInfo info = getMBeanInfoFromAssembler();
        assertNotNull("MBeanInfo should not be null", info);
    }
View Full Code Here

Examples of javax.management.modelmbean.ModelMBeanInfo

        ModelMBeanInfo info = getMBeanInfoFromAssembler();
        assertNotNull("MBeanInfo should not be null", info);
    }

    public void testGetMBeanAttributeInfo() throws Exception {
        ModelMBeanInfo info = getMBeanInfoFromAssembler();
        MBeanAttributeInfo[] inf = info.getAttributes();
        assertEquals("Invalid number of Attributes returned",
                       4, inf.length);

        for (int x = 0; x < inf.length; x++) {
            assertNotNull("MBeanAttributeInfo should not be null", inf[x]);
View Full Code Here

Examples of javax.management.modelmbean.ModelMBeanInfo

                            inf[x].getDescription());
        }
    }

    public void testGetMBeanOperationInfo() throws Exception {
        ModelMBeanInfo info = getMBeanInfoFromAssembler();
        MBeanOperationInfo[] inf = info.getOperations();
        assertEquals("Invalid number of Operations returned",
                               10, inf.length);

        for (int x = 0; x < inf.length; x++) {
            assertNotNull("MBeanOperationInfo should not be null", inf[x]);
View Full Code Here

Examples of javax.management.modelmbean.ModelMBeanInfo

                           inf[x].getDescription());
        }
    }

    public void testDescriptionNotNull() throws Exception {
        ModelMBeanInfo info = getMBeanInfoFromAssembler();
        assertNotNull("The MBean description should not be null",
                                info.getDescription());
    }
View Full Code Here

Examples of javax.management.modelmbean.ModelMBeanInfo

                                new Object[] {new Integer(20), new Integer(30)}, new String[] {"int", "int"});
        assertEquals("Incorrect result", new Integer(50), result);
    }
   
    public void testAttributeHasCorrespondingOperations() throws Exception {
        ModelMBeanInfo info = getMBeanInfoFromAssembler();

        ModelMBeanOperationInfo myOperation = info.getOperation("myOperation");
        assertNotNull("get operation should not be null", myOperation);
        assertEquals("Incorrect myOperation return type", "long", myOperation.getReturnType());
               
        ModelMBeanOperationInfo add = info.getOperation("add");               
        assertNotNull("set operation should not be null", add);
        assertEquals("Incorrect add method description", "Add Two Numbers Together", add.getDescription());
               
    }
View Full Code Here

Examples of javax.management.modelmbean.ModelMBeanInfo

        assertEquals("Incorrect add method description", "Add Two Numbers Together", add.getDescription());
               
    }

    public void testNotificationMetadata() throws Exception {
        ModelMBeanInfo info = getMBeanInfoFromAssembler();
        MBeanNotificationInfo[] notifications = info.getNotifications();
        assertEquals("Incorrect number of notifications", 1, notifications.length);
        assertEquals("Incorrect notification name", "My Notification", notifications[0].getName());

        String[] notifTypes = notifications[0].getNotifTypes();
View Full Code Here

Examples of javax.management.modelmbean.ModelMBeanInfo

    public static ModelMBean createModelMBean(Object o) {
        try {
            ModelMBean mbean = new RequiredModelMBean();
            JmxManaged annotation = o.getClass().getAnnotation(JmxManaged.class);
            String description = annotation == null ? "" : annotation.description();
            ModelMBeanInfo info = new ModelMBeanInfoSupport(o.getClass().getName(),
                                                            description,
                                                            extractAttributeInfo(o),
                                                            new ModelMBeanConstructorInfo[0],
                                                            extractOperationInfo(o),
                                                            new ModelMBeanNotificationInfo[0]);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.