本文整理汇总了Java中javax.management.AttributeList.size方法的典型用法代码示例。如果您正苦于以下问题:Java AttributeList.size方法的具体用法?Java AttributeList.size怎么用?Java AttributeList.size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.management.AttributeList
的用法示例。
在下文中一共展示了AttributeList.size方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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));
}
示例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));
}
示例3: 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));
}
示例4: setAttributes
import javax.management.AttributeList; //导入方法依赖的package包/类
public final AttributeList setAttributes(AttributeList attributes) {
final AttributeList result = new AttributeList(attributes.size());
for (Object attrObj : attributes) {
// We can't use AttributeList.asList because it has side-effects
Attribute attr = (Attribute) attrObj;
try {
setAttribute(attr);
result.add(new Attribute(attr.getName(), attr.getValue()));
} catch (Exception e) {
// OK: attribute is not included in returned list, per spec
// XXX: log the exception
}
}
return result;
}