Package javax.management

Examples of javax.management.AttributeList.asList()


        Attribute mockAttribute2 = createMock(Attribute.class);

        attributeList.add(mockAttribute1);
        attributeList.add(mockAttribute2);

        expect(mockAttributeList.asList()).andReturn(attributeList);

        String name1 = "name 1";
        String value1 = "value 1";
        expect(mockAttribute1.getName()).andReturn(name1);
        expect(mockAttribute1.getValue()).andReturn(value1);
View Full Code Here


        String type = (String) handlerCtx.getInputValue("type");
        Map valueMap = new HashMap();
        try {
            String objectName = getJmsDestinationObjectName(SUBTYPE_CONFIG, name, type);
            AttributeList attributes = (AttributeList) JMXUtil.getMBeanServer().getAttributes(new ObjectName(objectName), ATTRS_CONFIG);
            for (Attribute attribute : attributes.asList()) {
                valueMap.put(attribute.getName(), (attribute.getValue() != null) ? attribute.getValue().toString() : null);
            }

            handlerCtx.setOutputValue("destData", valueMap);
        } catch (Exception ex) {
View Full Code Here

            String objectName = getJmsDestinationObjectName(SUBTYPE_MONITOR, name, type);
            AttributeList attributes = (AttributeList) getMBeanServerConnection(target).getAttributes(new ObjectName(objectName), ATTRS_MONITOR);
            ResourceBundle bundle = GuiUtil.getBundle("org.glassfish.jms.admingui.Strings");
            statsList.add(createRow("Name", name, ""));
            statsList.add(createRow("Type", type.substring(0, 1).toUpperCase() + type.substring(1), ""));
            for (Attribute attribute : attributes.asList()) {
                statsList.add(
                        createRow(
                        GuiUtil.getMessage(bundle, "jmsPhysDestinations." + attribute.getName()),
                        attribute.getValue(),
                        GuiUtil.getMessage(bundle, "jmsPhysDestinations." + attribute.getName() + "Help")));
View Full Code Here

      for(int i=0;i<attrs.length;i++){
        attrNames[i] = attrs[i].getName();
      }
      try {
        AttributeList attributes = connection.getAttributes(name, attrNames);
        for(Attribute attribute: attributes.asList()){ 
          output(name.getCanonicalName()+"%"+attribute.getName(),attribute.getValue());
        }       
      } catch (Exception e) {
        System.err.println("error getting "+name+":"+e.getMessage());
      }
View Full Code Here

                for (MBeanAttributeInfo attr : attrs) {
                    attrNames.add(attr.getName());
                }
                AttributeList attrList = mBeanServer.getAttributes(objName,
                        attrNames.toArray(new String[0]));
                for (Attribute attr : attrList.asList()) {
                    Object value = attr.getValue();
                    String attrName = attr.getName();
                    if (attrName != null && value != null) {
                        String attrValue = null;
View Full Code Here

                    attrNames.add(attr.getName());
                }
                AttributeList attrList = mBeanServer.getAttributes(objName, attrNames.toArray(new String[0]));
               
                // Process each attribute
                for (Attribute attr : attrList.asList()) {
                    String attrName = attr.getName();
                    Object value    = attr.getValue();
                    String attrValue = null;
                   
                    // Attribute has data
View Full Code Here

            final ObjectName on = LogStoreResource.getObjectName(resource);
            final ModelNode model = resource.getModel().clone();

            AttributeList attributes = mbs.getAttributes(on, LogStoreConstants.PARTICIPANT_JMX_NAMES);

            for (javax.management.Attribute attribute : attributes.asList()) {
                String modelName = LogStoreConstants.jmxNameToModelName(LogStoreConstants.MODEL_TO_JMX_PARTICIPANT_NAMES, attribute.getName());

                if (modelName != null) {
                    ModelNode aNode = model.get(modelName);
                    Object value = attribute.getValue();
View Full Code Here

        }

        AttributeList attributes = cnx.getAttributes(on, attributeNames);
        Map<String, String> values = new HashMap<String, String>();

        for (javax.management.Attribute attribute : attributes.asList()) {
            Object value = attribute.getValue();

            values.put(attribute.getName(), value == null ? "" : value.toString());
        }
View Full Code Here

        String type = (String) handlerCtx.getInputValue("type");
        Map valueMap = new HashMap();
        try {
            String objectName = getJmsDestinationObjectName(SUBTYPE_CONFIG, name, type);
            AttributeList attributes = (AttributeList) JMXUtil.getMBeanServer().getAttributes(new ObjectName(objectName), ATTRS_CONFIG);
            for (Attribute attribute : attributes.asList()) {
                valueMap.put(attribute.getName(), (attribute.getValue() != null) ? attribute.getValue().toString() : null);
            }

            handlerCtx.setOutputValue("destData", valueMap);
        } catch (Exception ex) {
View Full Code Here

            String objectName = getJmsDestinationObjectName(SUBTYPE_MONITOR, name, type);
            AttributeList attributes = (AttributeList) getMBeanServerConnection(target).getAttributes(new ObjectName(objectName), ATTRS_MONITOR);
            ResourceBundle bundle = GuiUtil.getBundle("org.glassfish.jms.admingui.Strings");
            statsList.add(createRow("Name", name, ""));
            statsList.add(createRow("Type", type.substring(0, 1).toUpperCase(GuiUtil.guiLocale) + type.substring(1), ""));
            for (Attribute attribute : attributes.asList()) {
                statsList.add(
                        createRow(
                        GuiUtil.getMessage(bundle, "jmsPhysDestinations." + attribute.getName()),
                        attribute.getValue(),
                        GuiUtil.getMessage(bundle, "jmsPhysDestinations." + attribute.getName() + "Help")));
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.