Package javax.management

Examples of javax.management.Attribute


                        public void remove() {
                            throw new UnsupportedOperationException("remove");
                        }

                        public Resource next() {
                            final Attribute attr = (Attribute)iter.next();
                            return new AttributeResource(parent.getResourceResolver(),
                                    parent.getPath() + "/" + attr.getName(),
                                    infoMap.get(attr.getName()),
                                    attr.getValue(),
                                    parentResource);
                        }

                        public boolean hasNext() {
                            return iter.hasNext();
View Full Code Here


    log.info("info1");
    log.debug("debug1");

    // Set to debug.
    mbserver.setAttribute(objectName, new Attribute("Level", "debug"));

    // Check DEBUG is set.
    level = (String) mbserver.getAttribute(objectName, "Level");
    assertEquals("DEBUG", level);
View Full Code Here

   
    if(name == null || name.length() == 0){
      throw new NullPointerException("Invalid attribute requested " + name);
    }
   
    Attribute attr = getNamedAttribute(name);
        return attr.getValue();
  }
View Full Code Here

  }

  public synchronized AttributeList getAttributes(String[] names) {
    AttributeList al = new AttributeList();
    for (String name : names) {
      Attribute attr = getNamedAttribute(name);
      if (attr != null) {
        al.add(attr);
      } else {
        log.warn("Did not find attribute " + name);
      }
View Full Code Here

  }

  public synchronized AttributeList setAttributes(AttributeList list) {
    AttributeList results = new AttributeList();
    for (int i = 0; i < list.size(); i++) {
      Attribute attr = (Attribute) list.get(i);

      if (setNamedAttribute(attr)) {
        results.add(attr);
      } else {
        log.warn("Failed to update attribute name " + attr.getName() + " with value " + attr.getValue());
            }
        }
        return results;
  }
View Full Code Here

        }
        return result;
    }
 
  private Attribute getNamedAttribute(String name) {
    Attribute result = null;
    if (name.equals(ResourceMBean.MBEAN_DESCRITION)) {
      result = new Attribute(ResourceMBean.MBEAN_DESCRITION, this.description);
    } else {
      AttributeEntry entry = atts.get(name);
      if (entry != null) {
        try {
          result = new Attribute(name, entry.invoke(null));
        } catch (Exception e) {
          log.warn("Exception while reading value of attribute " + name, e);
        }
      } else {
        log.warn("Did not find queried attribute with name " + name);
View Full Code Here

        for (int i = 0; i < attributeNames.length; i++) {
            PropertyField propertyField = (PropertyField) m_configMap
                .getPropertyFromField((String) attributeNames[i]);

            if (propertyField != null) {
                resultList.add(new Attribute(attributeNames[i], propertyField
                    .getValue()));
            }
        }
        return resultList;
    }
View Full Code Here

        }

        // for each attribute, try to set it and add to the result list if
        // successful
        for (Iterator i = attributes.iterator(); i.hasNext();) {
            Attribute attr = (Attribute) i.next();
            try {
                setAttribute(attr);
                String name = attr.getName();
                Object value = getAttribute(name);
                resultList.add(new Attribute(name, value));
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return resultList;
View Full Code Here

         {
            String name = attributes[i];
            try
            {
               Object value = getAttribute(metadata, name);
               Attribute attr = new Attribute(name, value);
               list.add(attr);
            }
            catch (Exception ignored)
            {
               Logger logger = getLogger();
View Full Code Here

      else
      {
         AttributeList list = new AttributeList();
         for (int i = 0; i < attributes.size(); ++i)
         {
            Attribute attr = (Attribute)attributes.get(i);
            try
            {
               setAttribute(metadata, attr);
               list.add(attr);
            }
View Full Code Here

TOP

Related Classes of javax.management.Attribute

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.