當前位置: 首頁>>代碼示例>>Java>>正文


Java AttributeList.iterator方法代碼示例

本文整理匯總了Java中javax.management.AttributeList.iterator方法的典型用法代碼示例。如果您正苦於以下問題:Java AttributeList.iterator方法的具體用法?Java AttributeList.iterator怎麽用?Java AttributeList.iterator使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.management.AttributeList的用法示例。


在下文中一共展示了AttributeList.iterator方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setAttributes

import javax.management.AttributeList; //導入方法依賴的package包/類
/**
 * Set the values of several attributes of this MBean.
 *
 * @param attributes THe names and values to be set
 *
 * @return The list of attributes that were set and their new values
 */
@Override
public AttributeList setAttributes(AttributeList attributes) {
    AttributeList response = new AttributeList();

    // Validate the input parameters
    if (attributes == null)
        return response;
    
    // Prepare and return our response, eating all exceptions
    String names[] = new String[attributes.size()];
    int n = 0;
    Iterator<?> items = attributes.iterator();
    while (items.hasNext()) {
        Attribute item = (Attribute) items.next();
        names[n++] = item.getName();
        try {
            setAttribute(item);
        } catch (Exception e) {
            // Ignore all exceptions
        }
    }

    return (getAttributes(names));

}
 
開發者ID:liaokailin,項目名稱:tomcat7,代碼行數:33,代碼來源:BaseModelMBean.java

示例2: setAttributes

import javax.management.AttributeList; //導入方法依賴的package包/類
/**
 * Set the values of several attributes of this MBean.
 *
 * @param attributes THe names and values to be set
 *
 * @return The list of attributes that were set and their new values
 */
public AttributeList setAttributes(AttributeList attributes) {
    AttributeList response = new AttributeList();

    // Validate the input parameters
    if (attributes == null)
        return response;
    
    // Prepare and return our response, eating all exceptions
    String names[] = new String[attributes.size()];
    int n = 0;
    Iterator items = attributes.iterator();
    while (items.hasNext()) {
        Attribute item = (Attribute) items.next();
        names[n++] = item.getName();
        try {
            setAttribute(item);
        } catch (Exception e) {
            ; // Ignore all exceptions
        }
    }

    return (getAttributes(names));

}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:32,代碼來源:BaseModelMBean.java

示例3: setAttributes

import javax.management.AttributeList; //導入方法依賴的package包/類
public AttributeList setAttributes(AttributeList attributes) {
  if (attributes == null)
    throw new RuntimeOperationsException(new IllegalArgumentException(
        LocalizedStrings.MX4JModelMBean_ATTRIBUTE_LIST_CANNOT_BE_NULL.toLocalizedString()));

  Logger logger = getLogger();

  AttributeList list = new AttributeList();
  for (Iterator i = attributes.iterator(); i.hasNext();) {
    Attribute attribute = (Attribute) i.next();
    String name = attribute.getName();
    try {
      setAttribute(attribute);
      list.add(attribute);
    } catch (Exception x) {
      if (logger.isEnabledFor(Logger.TRACE))
        logger.trace("setAttribute for attribute " + name + " failed", x);
      // And go on with the next one
    }
  }
  return list;
}
 
開發者ID:ampool,項目名稱:monarch,代碼行數:23,代碼來源:MX4JModelMBean.java

示例4: setAttributes

import javax.management.AttributeList; //導入方法依賴的package包/類
/**
 * Set the values of several attributes of this MBean.
 *
 * @param attributes
 *            THe names and values to be set
 *
 * @return The list of attributes that were set and their new values
 */
@Override
public AttributeList setAttributes(AttributeList attributes) {
	AttributeList response = new AttributeList();

	// Validate the input parameters
	if (attributes == null)
		return response;

	// Prepare and return our response, eating all exceptions
	String names[] = new String[attributes.size()];
	int n = 0;
	Iterator<?> items = attributes.iterator();
	while (items.hasNext()) {
		Attribute item = (Attribute) items.next();
		names[n++] = item.getName();
		try {
			setAttribute(item);
		} catch (Exception e) {
			// Ignore all exceptions
		}
	}

	return (getAttributes(names));

}
 
開發者ID:how2j,項目名稱:lazycat,代碼行數:34,代碼來源:BaseModelMBean.java

示例5: setAttributes

import javax.management.AttributeList; //導入方法依賴的package包/類
public AttributeList setAttributes(AttributeList attributes) 
 {
       // Check attributes is not null to avoid NullPointerException later on
       //
       if (attributes != null) 
       {
        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
        // successfull
        //
        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;
   	}
       return null;
}
 
開發者ID:costea7,項目名稱:ChronoBike,代碼行數:36,代碼來源:BaseCloseMBean.java

示例6: setAttributes

import javax.management.AttributeList; //導入方法依賴的package包/類
public AttributeList setAttributes(AttributeList attributes) {
    AttributeList list = new AttributeList();
    // We carefully avoid using any new stuff from AttributeList here!
    for (Iterator<?> it = attributes.iterator(); it.hasNext(); ) {
        Attribute attr = (Attribute) it.next();
        try {
            setAttribute(attr);
            list.add(attr);
        } catch (Exception e) {
            // OK: ignore per spec
        }
    }
    return list;
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:15,代碼來源:OldMBeanServerTest.java


注:本文中的javax.management.AttributeList.iterator方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。