Package javax.management.modelmbean

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


        return (IoFilter) object;
    }

    @Override
    protected void addExtraAttributes(List<ModelMBeanAttributeInfo> attributes) {
        attributes.add(new ModelMBeanAttributeInfo(
                "attributes", Map.class.getName(), "attributes",
                true, false, false));
    }
View Full Code Here

            throw new RuntimeOperationsException
                (new IllegalArgumentException("Attribute name is null"),
                 "Attribute name is 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

            throw new RuntimeOperationsException
                (new IllegalArgumentException("Attribute name is null"),
                 "Attribute name is 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 setMethod = (String) attrDesc.getFieldValue("setMethod");
        if (setMethod == null)
            throw new AttributeNotFoundException
                ("Cannot find attribute " + name + " set method name");

        // Invoke the specified set method and ignore any results
        invoke(setMethod,
               new Object[] { value },
               new String[] { attrInfo.getType() });

    }
View Full Code Here

        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();
        ModelMBeanConstructorInfo constructors[] =
View Full Code Here

        // Return our cached information (if any)
        if (info != null)
            return (info);

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

            }

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

        }

        final boolean isIs =
            (readMethod != null) && readMethod.getName().startsWith( "is" );

        final ModelMBeanAttributeInfo info =
            new ModelMBeanAttributeInfo( name, type, description, isReadable, isWriteable, isIs );

        // additional info needed for modelMbean to work
        final Descriptor descriptor = info.getDescriptor();
        descriptor.setField( "currencyTimeLimit", new Integer( 1 ) );
        if( isReadable )
        {
            descriptor.setField( "getMethod", readMethod.getName() );
        }
        if( isWriteable )
        {
            descriptor.setField( "setMethod", writeMethod.getName() );
        }
        info.setDescriptor( descriptor );

        return info;
    }
View Full Code Here

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

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

Related Classes of javax.management.modelmbean.ModelMBeanAttributeInfo

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.