BaseModelMBean.java 文件源码

java
阅读 27 收藏 0 点赞 0 评论 0

项目:tomcat7 作者:
/**
 * Obtain and return the values of several attributes of this MBean.
 *
 * @param names Names of the requested attributes
 */
@Override
public AttributeList getAttributes(String names[]) {

    // Validate the input parameters
    if (names == null)
        throw new RuntimeOperationsException
            (new IllegalArgumentException("Attribute names list is null"),
             "Attribute names list is null");

    // Prepare our response, eating all exceptions
    AttributeList response = new AttributeList();
    for (int i = 0; i < names.length; i++) {
        try {
            response.add(new Attribute(names[i],getAttribute(names[i])));
        } catch (Exception e) {
            // Not having a particular attribute in the response
            // is the indication of a getter problem
        }
    }
    return (response);

}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号