Examples of ModelMBeanAttributeInfo


Examples of javax.management.modelmbean.ModelMBeanAttributeInfo

                                       boolean read,
                                       boolean write,
                                       boolean is,
                                       String description,
                                       Descriptor desc) {
        attributes.put(fname, new ModelMBeanAttributeInfo(fname,
                                                           ftype,
                                                           description,
                                                           read,
                                                           write,
                                                           is,
View Full Code Here

Examples of javax.management.modelmbean.ModelMBeanAttributeInfo

            }
   
            // Ordinary property.
            String fqan = prefix + attrName;
            boolean writable = isWritable(type, pdesc);
            attributes.add(new ModelMBeanAttributeInfo(
                    fqan, convertType(
                            object.getClass(), attrName, attrType, writable).getName(),
                    pdesc.getShortDescription(), true, writable, false));
           
            propertyDescriptors.put(fqan, pdesc);
View Full Code Here

Examples of javax.management.modelmbean.ModelMBeanAttributeInfo

        List<ModelMBeanAttributeInfo> infos = new ArrayList<ModelMBeanAttributeInfo>();
        for(String name: attributes) {
            try {
                Method getter = getters.get(name);
                Method setter = setters.get(name);
                ModelMBeanAttributeInfo info = new ModelMBeanAttributeInfo(name,
                                                                           descriptions.get(name),
                                                                           getter,
                                                                           setter);
                Descriptor descriptor = info.getDescriptor();
                if(getter != null)
                    descriptor.setField("getMethod", getter.getName());
                if(setter != null)
                    descriptor.setField("setMethod", setter.getName());
                info.setDescriptor(descriptor);
                infos.add(info);
            } catch(IntrospectionException e) {
                throw new VoldemortException(e);
            }
        }
View Full Code Here

Examples of javax.management.modelmbean.ModelMBeanAttributeInfo

      for (Field field : fields) {
        field.setAccessible(true);
        CMbeanAttribute annotation = field
            .getAnnotation(CMbeanAttribute.class);
        if (annotation != null) {
          ModelMBeanAttributeInfo info = new ModelMBeanAttributeInfo(
              field.getName(), field.getType().getName(),
              annotation.description(), annotation.isReadable(),
              annotation.isWriteable(), annotation.isIs());
          lists.add(info);
        }
View Full Code Here

Examples of javax.management.modelmbean.ModelMBeanAttributeInfo

        // 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);

        // Check the configured fields
        checkDescriptor(desc, "field1", "HttpConnector.acceptCount/field1");
        checkDescriptor(desc, "field2", "HttpConnector.acceptCount/field2");
View Full Code Here

Examples of javax.management.modelmbean.ModelMBeanAttributeInfo

        if (info != null)
            return (info);

        // Create subordinate information descriptors as required
        AttributeInfo attrs[] = getAttributes();
        ModelMBeanAttributeInfo attributes[] =
            new ModelMBeanAttributeInfo[attrs.length];
        for (int i = 0; i < attrs.length; i++)
            attributes[i] = attrs[i].createAttributeInfo();
       
        ConstructorInfo consts[] = getConstructors();
View Full Code Here

Examples of javax.management.modelmbean.ModelMBeanAttributeInfo

        // Extract the method from cache
        Method m=(Method)getAttMap.get( name );

        if( m==null ) {
            // Look up the actual operation to be used
            ModelMBeanAttributeInfo attrInfo = info.getAttribute(name);
            if (attrInfo == null)
                throw new AttributeNotFoundException(" Cannot find attribute " + name);
            Descriptor attrDesc = attrInfo.getDescriptor();
            if (attrDesc == null)
                throw new AttributeNotFoundException("Cannot find attribute " + name + " descriptor");
            String getMethod = (String) attrDesc.getFieldValue("getMethod");

            if (getMethod == null)
View Full Code Here

Examples of javax.management.modelmbean.ModelMBeanAttributeInfo

        if (name == null)
            throw new RuntimeOperationsException
                (new IllegalArgumentException("Attribute name is null"),
                 "Attribute name is null");

        ModelMBeanAttributeInfo attrInfo=info.getAttribute(name);
        if (attrInfo == null)
            throw new AttributeNotFoundException("Cannot find attribute " + name);

        Descriptor attrDesc=attrInfo.getDescriptor();
        if (attrDesc == null)
            throw new AttributeNotFoundException("Cannot find attribute " + name + " descriptor");

        Object oldValue=null;
        if( getAttMap.get(name) != null )
            oldValue=getAttribute( name );


        // Extract the method from cache
        Method m=(Method)setAttMap.get( name );

        if( m==null ) {
            // Look up the actual operation to be used
            String setMethod = (String) attrDesc.getFieldValue("setMethod");
            if (setMethod == null)
                throw new AttributeNotFoundException("Cannot find attribute " + name + " set method name");

            String argType=attrInfo.getType();

            Class signature[] = new Class[] { getAttributeClass( argType ) };

            Object object = null;
            NoSuchMethodException exception = null;
View Full Code Here

Examples of javax.management.modelmbean.ModelMBeanAttributeInfo

        // Return our cached information (if any)
        if (info != null)
            return (info);
        if((getMethodObj != null) || (setMethodObj != null) ) {
            try {
                info=new ModelMBeanAttributeInfo(getName(), getDescription(),
                                        getMethodObj,  setMethodObj);
                return info;
            } catch( Exception ex) {
                ex.printStackTrace();
            }
        }

        // Create and return a new information object
        info = new ModelMBeanAttributeInfo
            (getName(), getType(), getDescription(),
             isReadable(), isWriteable(), false);
        Descriptor descriptor = info.getDescriptor();
        if (getDisplayName() != null)
            descriptor.setField("displayName", getDisplayName());
View Full Code Here

Examples of javax.management.modelmbean.ModelMBeanAttributeInfo

        // Extract the method from cache
        Method m=(Method)getAttMap.get( name );

        if( m==null ) {
            // Look up the actual operation to be used
            ModelMBeanAttributeInfo attrInfo = info.getAttribute(name);
            if (attrInfo == null)
                throw new AttributeNotFoundException(" Cannot find attribute " + name);
            Descriptor attrDesc = attrInfo.getDescriptor();
            if (attrDesc == null)
                throw new AttributeNotFoundException("Cannot find attribute " + name + " descriptor");
            String getMethod = (String) attrDesc.getFieldValue("getMethod");

            if (getMethod == null)
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.