本文整理汇总了Java中javax.management.AttributeList.remove方法的典型用法代码示例。如果您正苦于以下问题:Java AttributeList.remove方法的具体用法?Java AttributeList.remove怎么用?Java AttributeList.remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.management.AttributeList
的用法示例。
在下文中一共展示了AttributeList.remove方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setAttributes
import javax.management.AttributeList; //导入方法依赖的package包/类
/**
* Sets the values of an array of attributes of this ModelMBean.
* Executes the setAttribute() method for each attribute in the list.
*
* @param attributes A list of attributes: The identification of the
* attributes to be set and the values they are to be set to.
*
* @return The array of attributes that were set, with their new
* values in Attribute instances.
*
* @exception RuntimeOperationsException Wraps an
* {@link IllegalArgumentException}: The object name in parameter
* is null or attributes in parameter is null.
*
* @see #getAttributes
**/
public AttributeList setAttributes(AttributeList attributes) {
if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
MODELMBEAN_LOGGER.logp(Level.FINER,
RequiredModelMBean.class.getName(),
"setAttribute(Attribute)", "Entry");
}
if (attributes == null)
throw new RuntimeOperationsException(new
IllegalArgumentException("attributes must not be null"),
"Exception occurred trying to set attributes of a "+
"RequiredModelMBean");
final AttributeList responseList = new AttributeList();
// Go through the list of attributes
for (Attribute attr : attributes.asList()) {
try {
setAttribute(attr);
responseList.add(attr);
} catch (Exception excep) {
responseList.remove(attr);
}
}
return responseList;
}
示例2: setAttributes
import javax.management.AttributeList; //导入方法依赖的package包/类
/**
* Sets the values of an array of attributes of this ModelMBean.
* Executes the setAttribute() method for each attribute in the list.
*
* @param attributes A list of attributes: The identification of the
* attributes to be set and the values they are to be set to.
*
* @return The array of attributes that were set, with their new
* values in Attribute instances.
*
* @exception RuntimeOperationsException Wraps an
* {@link IllegalArgumentException}: The object name in parameter
* is null or attributes in parameter is null.
*
* @see #getAttributes
**/
public AttributeList setAttributes(AttributeList attributes) {
if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) {
MODELMBEAN_LOGGER.log(Level.TRACE, "Entry");
}
if (attributes == null)
throw new RuntimeOperationsException(new
IllegalArgumentException("attributes must not be null"),
"Exception occurred trying to set attributes of a "+
"RequiredModelMBean");
final AttributeList responseList = new AttributeList();
// Go through the list of attributes
for (Attribute attr : attributes.asList()) {
try {
setAttribute(attr);
responseList.add(attr);
} catch (Exception excep) {
responseList.remove(attr);
}
}
return responseList;
}