Package javax.management.modelmbean

Examples of javax.management.modelmbean.ModelMBeanInfoSupport


      Descriptor descr4 = new DescriptorSupport();
      descr4.setField("name", RequiredModelMBean.class.getName());
      descr4.setField("descriptorType", "MBean");

      // create ModelMBeanInfo
      ModelMBeanInfo info = new ModelMBeanInfoSupport(
                               RequiredModelMBean.class.getName()// class name
                               "POJO",                              // description
                               new ModelMBeanAttributeInfo[] {      // attributes
                                     pojoAttributeInfo
                               },
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

   * @see #getNotificationInfo(Object, String)
   * @see #populateMBeanDescriptor(javax.management.Descriptor, Object, String)
   */
  public ModelMBeanInfo getMBeanInfo(Object managedBean, String beanKey) throws JMException {
    checkManagedBean(managedBean);
    ModelMBeanInfo info = new ModelMBeanInfoSupport(
        getClassName(managedBean, beanKey), getDescription(managedBean, beanKey),
        getAttributeInfo(managedBean, beanKey), getConstructorInfo(managedBean, beanKey),
        getOperationInfo(managedBean, beanKey), getNotificationInfo(managedBean, beanKey));
    Descriptor desc = info.getMBeanDescriptor();
    populateMBeanDescriptor(desc, managedBean, beanKey);
    info.setMBeanDescriptor(desc);
    return info;
  }
View Full Code Here

    assertEquals("Incorrect name on MBean", name, bean.getName());
  }

  public void testRegisterExistingMBeanWithUserSuppliedObjectName() throws Exception {
    ObjectName objectName = ObjectNameManager.getInstance("spring:name=Foo");
    ModelMBeanInfo info = new ModelMBeanInfoSupport("myClass", "myDescription", null, null, null, null);
    RequiredModelMBean bean = new RequiredModelMBean(info);

    MBeanExporter exporter = new MBeanExporter();
    exporter.setServer(getServer());
    exporter.registerManagedResource(bean, objectName);
View Full Code Here

        operations.add(new ModelMBeanOperationInfo(
                "unregisterMBean", "unregisterMBean",
                new MBeanParameterInfo[0], void.class.getName(),
                ModelMBeanOperationInfo.ACTION));

        return new ModelMBeanInfoSupport(
                className, description,
                attributes.toArray(new ModelMBeanAttributeInfo[attributes.size()]),
                constructors,
                operations.toArray(new ModelMBeanOperationInfo[operations.size()]),
                notifications);
View Full Code Here

        // load each topic
        final Configuration[] topicsConfig = config.getChildren( "topic" );
        for( int i = 0; i < topicsConfig.length; i++ )
        {
            final ModelMBeanInfoSupport topic =
                buildTopic( topicsConfig[ i ], beanInfo );
            target.addTopic( topic );
        }

        // load each proxy
        final Configuration[] proxysConfig = config.getChildren( "proxy" );
        for( int i = 0; i < proxysConfig.length; i++ )
        {
            final ModelMBeanInfoSupport topic =
                buildProxyTopic( proxysConfig[ i ], managedClass );
            target.addTopic( topic );
        }

    }
View Full Code Here

            final ModelMBeanNotificationInfo[] notifications =
                new ModelMBeanNotificationInfo[ 0 ];

            final String shortName = getShortName( interfaceClass.getName() );
            final ModelMBeanInfoSupport topic =
                new ModelMBeanInfoSupport( REQ_MODEL_MBEAN,
                                           shortName,
                                           attributes,
                                           constructors,
                                           operationList,
                                           notifications );

            // add it to target
            final String message = REZ.getString( "mxinfo.debug.adding.topic", topic.getDescription() );
            getLogger().debug( message );

            target.addTopic( topic );
        }
        catch( final Exception e )
View Full Code Here

        final ModelMBeanNotificationInfo[] notifications =
            new ModelMBeanNotificationInfo[ 0 ];

        final String name = config.getAttribute( "name" );
        final ModelMBeanInfoSupport topic =
            new ModelMBeanInfoSupport( REQ_MODEL_MBEAN,
                                       name,
                                       attributes,
                                       constructors,
                                       operations,
                                       notifications );
View Full Code Here

            final Class proxyClass = managedClass.getClassLoader().loadClass( proxyName );
            final Configuration classConfig = loadMxInfo( proxyClass );
            final Configuration topicConfig = classConfig.getChild( "topic" );
            final BeanInfo info = Introspector.getBeanInfo( proxyClass );
            final ModelMBeanInfoSupport topic = buildTopic( topicConfig, info );
            final Descriptor mBeanDescriptor = topic.getMBeanDescriptor();
            mBeanDescriptor.setField( "proxyClassName", proxyName );
            topic.setMBeanDescriptor( mBeanDescriptor );

            return topic;
        }
        catch( final Exception e )
        {
View Full Code Here

        operations.add(new ModelMBeanOperationInfo(
                "unregisterMBean", "unregisterMBean",
                new MBeanParameterInfo[0], void.class.getName(),
                ModelMBeanOperationInfo.ACTION));

        return new ModelMBeanInfoSupport(
                className, description,
                attributes.toArray(new ModelMBeanAttributeInfo[attributes.size()]),
                constructors,
                operations.toArray(new ModelMBeanOperationInfo[operations.size()]),
                notifications);
View Full Code Here

TOP

Related Classes of javax.management.modelmbean.ModelMBeanInfoSupport

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.