Package javax.management

Examples of javax.management.Descriptor


        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


        // Retrieve the specified ModelMBeanNotificationInfo
        ModelMBeanNotificationInfo mmninfo = info.getNotification("Problem");
        assertNotNull("Found HttpConnector problem info", mmninfo);

        // Get the Descriptor
        Descriptor desc = mmninfo.getDescriptor();
        assertNotNull("Found HttpConnector problem descriptor", desc);

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

        // Retrieve the specified ModelMBeanOperationInfo
        ModelMBeanOperationInfo mmoinfo = info.getOperation("initialize");
        assertNotNull("Found HttpConnector initialize info", mmoinfo);

        // Get the Descriptor
        Descriptor desc = mmoinfo.getDescriptor();
        assertNotNull("Found HttpConnector initialize descriptor", desc);

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

        // Construct and return a new ModelMBeanInfo object
        info = new ModelMBeanInfoSupport
            (getClassName(), getDescription(),
             attributes, constructors, operations, notifications);
        try {
            Descriptor descriptor = info.getMBeanDescriptor();
            Iterator fields = getFields().iterator();
            while (fields.hasNext()) {
                FieldInfo field = (FieldInfo) fields.next();
                descriptor.setField(field.getName(), field.getValue());
            }
            info.setMBeanDescriptor(descriptor);
        } catch (MBeanException e) {
            ;
        }
View Full Code Here

        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)
                throw new AttributeNotFoundException("Cannot find attribute " + name + " get method name");

            Object object = null;
View Full Code Here

        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();
View Full Code Here

        MBeanNotificationInfo current[] = info.getNotifications();
        if (current == null)
            current = new MBeanNotificationInfo[0];
        MBeanNotificationInfo response[] =
            new MBeanNotificationInfo[current.length + 2];
        Descriptor descriptor = null;

        // Fill in entry for general notifications
        descriptor = new DescriptorSupport
            (new String[] { "name=GENERIC",
                            "descriptorType=notification",
View Full Code Here

            impact = ModelMBeanOperationInfo.INFO;

        info = new ModelMBeanOperationInfo
            (getName(), getDescription(), parameters,
             getReturnType(), impact);
        Descriptor descriptor = info.getDescriptor();
        descriptor.removeField("class");
        descriptor.setField("role", getRole());
        addFields(descriptor);
        info.setDescriptor(descriptor);
        return (info);

    }
View Full Code Here

            return (info);

        // Create and return a new information object
        info = new ModelMBeanNotificationInfo
            (getNotifTypes(), getName(), getDescription());
        Descriptor descriptor = info.getDescriptor();
        addFields(descriptor);
        info.setDescriptor(descriptor);
        return (info);

    }
View Full Code Here

            new MBeanParameterInfo[params.length];
        for (int i = 0; i < params.length; i++)
            parameters[i] = params[i].createParameterInfo();
        info = new ModelMBeanConstructorInfo
            (getName(), getDescription(), parameters);
        Descriptor descriptor = info.getDescriptor();
        descriptor.removeField("class");
        if (getDisplayName() != null)
            descriptor.setField("displayName", getDisplayName());
        addFields(descriptor);
        info.setDescriptor(descriptor);
        return (info);

    }
View Full Code Here

TOP

Related Classes of javax.management.Descriptor

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.