Package javax.management.modelmbean

Examples of javax.management.modelmbean.ModelMBeanInfo


         List attributes = root.getChildren("attribute");
         List notifications = root.getChildren("notifications");

         Descriptor descr = getDescriptor(root, resourceClassName, "mbean");

         ModelMBeanInfo info = buildMBeanMetaData(
            description, constructors, operations,
            attributes, notifications, descr
         );

         return (MBeanInfo) info;
View Full Code Here


      ModelMBeanConstructorInfo[] constrInfo =
         buildConstructorInfo(constructors);
      ModelMBeanNotificationInfo[] notifInfo =
         buildNotificationInfo(notifications);

      ModelMBeanInfo info = new ModelMBeanInfoSupport(
         mmbClassName, description, attrInfo, constrInfo,
         operInfo, notifInfo, descr
      );

      return info;
View Full Code Here

         if (persistName != null)
            descr.setField(PERSIST_NAME, persistName.getValue());
         if (currTimeLimit != null)
            descr.setField(CURRENCY_TIME_LIMIT, currTimeLimit.getValue());

         ModelMBeanInfo info = buildMBeanMetaData(
            description, constructors, operations,
            attributes, notifications, descr
         );

         return (MBeanInfo) info;
View Full Code Here

      ModelMBeanOperationInfo[] operInfo     = buildOperationInfo(operations);
      ModelMBeanAttributeInfo[] attrInfo     = buildAttributeInfo(attributes);
      ModelMBeanConstructorInfo[] constrInfo = buildConstructorInfo(constructors);
      ModelMBeanNotificationInfo[] notifInfo = buildNotificationInfo(notifications);

      ModelMBeanInfo info = new ModelMBeanInfoSupport(
         mmbClassName, description, attrInfo, constrInfo, operInfo, notifInfo, descr
      );

      return info;
   }
View Full Code Here

               !IS_WRITABLE,
               !IS_IS,
               descriptor
         );
        
         ModelMBeanInfo info = new ModelMBeanInfoSupport(
               Resource.class.getName(),
               "Test Resource",
               new ModelMBeanAttributeInfo[] { attrInfo },
               null,                      // constructors
               null,                      // operations
View Full Code Here

   {
     if(!(info instanceof ModelMBeanInfo))
     {
         return;
     }
     ModelMBeanInfo mmbInfo = (ModelMBeanInfo) info;
     Descriptor[] descriptors;
     try { descriptors = mmbInfo.getDescriptors(ModelMBeanConstants.MBEAN_DESCRIPTOR); }
     catch(MBeanException cause)
     {
       log.error("Error trying to get descriptors.", cause);
       return;
     }
View Full Code Here

            System.out.println("Dump ModelMBeanInfo for Server:");
            ObjectName name =
                new ObjectName(server.getDefaultDomain() + ":type=Server");

            // Return static ModelMBeanInfo information
            ModelMBeanInfo info = (ModelMBeanInfo) server.getMBeanInfo(name);
            System.out.println("  className=" + info.getClassName());
            System.out.println("  description=" + info.getDescription());
            System.out.println("  mbeanDescriptor=" + info.getMBeanDescriptor());
            MBeanAttributeInfo attrs[] = info.getAttributes();
            for (int i = 0; i < attrs.length; i++)
                System.out.println("  AttributeInfo=" + attrs[i]);
            MBeanConstructorInfo consts[] = info.getConstructors();
            for (int i = 0; i < consts.length; i++)
                System.out.println("  ConstructorInfo=" + consts[i]);
            Descriptor descs[] = info.getDescriptors(null);
            for (int i = 0; i < descs.length; i++)
                System.out.println("  Descriptor=" + descs[i]);
            MBeanNotificationInfo notifs[] = info.getNotifications();
            for (int i = 0; i < notifs.length; i++)
                System.out.println("  Notification=" + notifs[i]);
            MBeanOperationInfo opers[] = info.getOperations();
            for (int i = 0; i < opers.length; i++)
                System.out.println("  Operation=" + opers[i]);

        } catch (MBeanException t) {
View Full Code Here

        // Retrieve a ManagedBean
        ManagedBean http = registry.findManagedBean("HttpConnector");
        assertNotNull("Found HttpConnector managed bean");

        // Create the associated ModelMBeanInfo
        ModelMBeanInfo info = http.createMBeanInfo();
        assertNotNull("Found HttpConnector ModelMBeanInfo", info);

        // Retrieve the specified ModelMBeanAttributeInfo
        ModelMBeanAttributeInfo mmainfo = info.getAttribute("acceptCount");
        assertNotNull("Found HttpConnector acceptCount info", mmainfo);

        // Get the Descriptor
        Descriptor desc = mmainfo.getDescriptor();
        assertNotNull("Found HttpConnector acceptCount descriptor", desc);
View Full Code Here

        // Retrieve a ManagedBean
        ManagedBean http = registry.findManagedBean("HttpConnector");
        assertNotNull("Found HttpConnector managed bean");

        // Create the associated ModelMBeanInfo
        ModelMBeanInfo info = http.createMBeanInfo();
        assertNotNull("Found HttpConnector ModelMBeanInfo", info);

        // Retrieve the relevant MBeanConstructorInfo array
        MBeanConstructorInfo mcinfo[] = info.getConstructors();
        assertNotNull("Found HttpConnector MBeanConstructorInfo array", mcinfo);
        assertEquals("Found HttpConnector MBeanConstructorInfo entry",
                     1, mcinfo.length);

        // Cast first entry to ModelMBeanConstructorInfo
View Full Code Here

        // Retrive a ManagedBean
        ManagedBean http = registry.findManagedBean("HttpConnector");
        assertNotNull("Found HttpConnector managed bean");

        // Create the associated ModelMBeanInfo
        ModelMBeanInfo info = http.createMBeanInfo();
        assertNotNull("Found HttpConnector ModelMBeanInfo", info);

        // Check the basic properties
        assertEquals("Correct className",
                     "org.apache.catalina.mbeans.HttpConnectorModelMBean",
                     info.getClassName());
        assertEquals("Correct description",
                     "HTTP/1.1 Connector for Tomcat Standalone",
                     info.getDescription());

        // Get the Descriptor
        Descriptor desc = info.getMBeanDescriptor();
        assertNotNull("Found HttpConnector MBeanDescriptor", desc);

        // Check the configured fields
        checkDescriptor(desc, "field1", "HttpConnector/field1");
        checkDescriptor(desc, "field2", "HttpConnector/field2");
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.