Package javax.management

Examples of javax.management.AttributeList


               
        setNamedAttribute(attribute);
  }

  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);
      }
    }
        return al;
View Full Code Here


    }
        return al;
  }

  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

        if (attributeNames == null) {
            throw new IllegalArgumentException(
                "attributeNames[] cannot be null");
        }

        AttributeList resultList = new AttributeList();
        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

        if (attributes == null) {
            throw new RuntimeOperationsException(new IllegalArgumentException(
                "AttributeList attributes cannot be null"),
                "Cannot invoke a setter of " + m_className);
        }
        AttributeList resultList = new AttributeList();

        // if attributeNames is empty, nothing more to do
        if (attributes.isEmpty()) {
            return resultList;
        }

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

            throw new RuntimeErrorException(x);
         }
      }
      else
      {
         AttributeList list = new AttributeList();
         for (int i = 0; i < attributes.length; ++i)
         {
            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();
               if (logger.isEnabledFor(Logger.DEBUG)) logger.debug("Exception caught from getAttributes(), ignoring attribute " + name);
View Full Code Here

            throw new RuntimeErrorException(x);
         }
      }
      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);
            }
            catch (Exception ignored)
            {
               Logger logger = getLogger();
               if (logger.isEnabledFor(Logger.DEBUG)) logger.debug("Exception caught from setAttributes(), ignoring attribute " + attr, ignored);
View Full Code Here

   }

   public AttributeList setAttributes(MBeanMetaData metadata, AttributeList attributes)
   {
      Object[] secured = filterAttributes(metadata.info.getClassName(), metadata.name, attributes.toArray(), false);
      AttributeList list = new AttributeList();
      for (int i = 0; i < secured.length; ++i) list.add(secured[i]);
      return super.setAttributes(metadata, list);
   }
View Full Code Here

   /**
    * Returns the manageable attributes, as specified by the DynamicMBean interface.
    */
   public AttributeList getAttributes(String[] attributes)
   {
      AttributeList list = new AttributeList();

      if (attributes != null)
      {
         for (int i = 0; i < attributes.length; ++i)
         {
            String attribute = attributes[i];
            try
            {
               Object result = getAttribute(attribute);
               list.add(new Attribute(attribute, result));
            }
            catch (AttributeNotFoundException ignored)
            {
            }
            catch (MBeanException ignored)
View Full Code Here

   /**
    * Sets the manageable attributes, as specified by the DynamicMBean interface.
    */
   public AttributeList setAttributes(AttributeList attributes)
   {
      AttributeList list = new AttributeList();

      if (attributes != null)
      {
         for (int i = 0; i < attributes.size(); ++i)
         {
            Attribute attribute = (Attribute)attributes.get(i);
            try
            {
               setAttribute(attribute);
               list.add(attribute);
            }
            catch (AttributeNotFoundException ignored)
            {
            }
            catch (InvalidAttributeValueException ignored)
View Full Code Here

   public AttributeList setAttributes(ObjectName name, MarshalledObject attributes, Subject delegate)
           throws InstanceNotFoundException,
           ReflectionException,
           IOException
   {
      AttributeList attribs = (AttributeList)RMIMarshaller.unmarshal(attributes, server.getClassLoaderFor(name), defaultLoader);
      return server.setAttributes(name, attribs);
   }
View Full Code Here

TOP

Related Classes of javax.management.AttributeList

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.