Package org.apache.qpid.management.ui.model

Examples of org.apache.qpid.management.ui.model.ManagedAttributeModel


     * @return attribute data for the given mbean attribute
     */
    public static AttributeData getAttributeData(ManagedBean mbean, String attribute) throws Exception
    {
        JMXServerRegistry serverRegistry = (JMXServerRegistry)ApplicationRegistry.getServerRegistry(mbean);
        ManagedAttributeModel attributeModel = serverRegistry.getAttributeModel(mbean);
        if (attributeModel == null)
        {
            // If process is here, it means the mbeanInfo is not retrieved from mbean server even once for this mbean
            getMBeanInfo(mbean);
        }
        else
        {
            // refresh attribute value from mbean server
            refreshAttribute(mbean, attribute);
        }
        attributeModel = serverRegistry.getAttributeModel(mbean);
        return attributeModel.getAttribute(attribute);
    }
View Full Code Here


            throw new ManagementConsoleException("Server connection is broken");
        }
       
        Object value = mbsc.getAttribute(((JMXManagedObject)mbean).getObjectName(), attribute);
        // update the attribute data in server registry for this attribute
        ManagedAttributeModel attributeModel = serverRegistry.getAttributeModel(mbean);
        attributeModel.setAttributeValue(attribute, value);
        return value;
    }
View Full Code Here

        AttributeList list = null;
       
        JMXServerRegistry serverRegistry = (JMXServerRegistry)ApplicationRegistry.getServerRegistry(mbean);
        MBeanServerConnection mbsc = serverRegistry.getServerConnection();
        MBeanAttributeInfo[] attributesInfo = null;
        ManagedAttributeModel attributeModel = serverRegistry.getAttributeModel(mbean);
       
        if (attributeModel == null)
        {
            // If the process is here, then it means the attribute values are not retrieved from mbean server
            // even once for this mbean. Create attribute model, retrieve values from mbean server and
            // set the attribute model in server registry for this mbean
            attributeModel = new ManagedAttributeModel();
            attributesInfo = serverRegistry.getMBeanInfo(mbean).getAttributes();
            attributes = new String[attributesInfo.length];
            for (int i = 0; i< attributesInfo.length ; i++)
            {
                attributes[i] = attributesInfo[i].getName();
                attributeModel.setAttributeDescription(attributes[i], attributesInfo[i].getDescription());
                attributeModel.setAttributeWritable(attributes[i], attributesInfo[i].isWritable());
                attributeModel.setAttributeReadable(attributes[i], attributesInfo[i].isReadable());
            }
        } 
        else
        {
            attributes = attributeModel.getAttributeNames().toArray(new String[0]);
        }
       
        if (attributes.length != 0)
        {
            list = mbsc.getAttributes(objName, attributes);
            for (Iterator itr = list.iterator(); itr.hasNext();)
            {
                Attribute attrib = (Attribute)itr.next();
                attributeModel.setAttributeValue(attrib.getName(), attrib.getValue());
            }
        }              
       
        serverRegistry.setAttributeModel(mbean, attributeModel);      
        return attributeModel;
View Full Code Here

            newValue = Boolean.valueOf(value);
        }
       
        mbsc.setAttribute(jmxbean.getObjectName(), new Attribute(attribute.getName(), newValue));          
        // Update the value in the registry, to avoid refreshing from mbsc
        ManagedAttributeModel attributeModel = serverRegistry.getAttributeModel(mbean);
        attributeModel.setAttributeValue(attribute.getName(), newValue);
    }
View Full Code Here

        if (_mbean == null)
        {
            _tableViewer.setInput(null);
            return;
        }
        ManagedAttributeModel attributesList = null;
        try
        {
            attributesList = MBeanUtility.getAttributes(mbean);
        }
        catch(Exception ex)
View Full Code Here

     * @return attribute data for the given mbean attribute
     */
    public static AttributeData getAttributeData(ManagedBean mbean, String attribute) throws Exception
    {
        JMXServerRegistry serverRegistry = (JMXServerRegistry)ApplicationRegistry.getServerRegistry(mbean);
        ManagedAttributeModel attributeModel = serverRegistry.getAttributeModel(mbean);
        if (attributeModel == null)
        {
            // If process is here, it means the mbeanInfo is not retrieved from mbean server even once for this mbean
            getMBeanInfo(mbean);
        }
        else
        {
            // refresh attribute value from mbean server
            refreshAttribute(mbean, attribute);
        }
        attributeModel = serverRegistry.getAttributeModel(mbean);
        return attributeModel.getAttribute(attribute);
    }
View Full Code Here

            throw new ManagementConsoleException("Server connection is broken");
        }
       
        Object value = mbsc.getAttribute(((JMXManagedObject)mbean).getObjectName(), attribute);
        // update the attribute data in server registry for this attribute
        ManagedAttributeModel attributeModel = serverRegistry.getAttributeModel(mbean);
        attributeModel.setAttributeValue(attribute, value);
        return value;
    }
View Full Code Here

        AttributeList list = null;
       
        JMXServerRegistry serverRegistry = (JMXServerRegistry)ApplicationRegistry.getServerRegistry(mbean);
        MBeanServerConnection mbsc = serverRegistry.getServerConnection();
        MBeanAttributeInfo[] attributesInfo = null;
        ManagedAttributeModel attributeModel = serverRegistry.getAttributeModel(mbean);
       
        if (attributeModel == null)
        {
            // If the process is here, then it means the attribute values are not retrieved from mbean server
            // even once for this mbean. Create attribute model, retrieve values from mbean server and
            // set the attribute model in server registry for this mbean
            attributeModel = new ManagedAttributeModel();
            attributesInfo = serverRegistry.getMBeanInfo(mbean).getAttributes();
            attributes = new String[attributesInfo.length];
            for (int i = 0; i< attributesInfo.length ; i++)
            {
                attributes[i] = attributesInfo[i].getName();
                attributeModel.setAttributeDescription(attributes[i], attributesInfo[i].getDescription());
                attributeModel.setAttributeWritable(attributes[i], attributesInfo[i].isWritable());
                attributeModel.setAttributeReadable(attributes[i], attributesInfo[i].isReadable());
            }
        } 
        else
        {
            attributes = attributeModel.getAttributeNames().toArray(new String[0]);
        }
       
        if (attributes.length != 0)
        {
            list = mbsc.getAttributes(objName, attributes);
            for (Iterator itr = list.iterator(); itr.hasNext();)
            {
                Attribute attrib = (Attribute)itr.next();
                attributeModel.setAttributeValue(attrib.getName(), attrib.getValue());
            }
        }              
       
        serverRegistry.setAttributeModel(mbean, attributeModel);      
        return attributeModel;
View Full Code Here

            newValue = new Integer(Integer.parseInt(value));
        }
       
        mbsc.setAttribute(jmxbean.getObjectName(), new Attribute(attribute.getName(), newValue));          
        // Update the value in the registry, to avoid refreshing from mbsc
        ManagedAttributeModel attributeModel = serverRegistry.getAttributeModel(mbean);
        attributeModel.setAttributeValue(attribute.getName(), newValue);
    }
View Full Code Here

    // Refresh from the server registry
    public void refresh()
    {
        JMXServerRegistry serverRegistry = (JMXServerRegistry)ApplicationRegistry.getServerRegistry(_mbean);
        ManagedAttributeModel attributesList = serverRegistry.getAttributeModel(_mbean);
        _tableViewer.setInput(attributesList);
    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.management.ui.model.ManagedAttributeModel

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.