GroupMBean.java 文件源码

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

项目:apache-tomcat-7.0.73-with-comment 作者:
/**
 * Return the MBean Names of all authorized roles for this group.
 */
public String[] getRoles() {

    Group group = (Group) this.resource;
    ArrayList<String> results = new ArrayList<String>();
    Iterator<Role> roles = group.getRoles();
    while (roles.hasNext()) {
        Role role = null;
        try {
            role = roles.next();
            ObjectName oname =
                MBeanUtils.createObjectName(managed.getDomain(), role);
            results.add(oname.toString());
        } catch (MalformedObjectNameException e) {
            IllegalArgumentException iae = new IllegalArgumentException
                ("Cannot create object name for role " + role);
            iae.initCause(e);
            throw iae;
        }
    }
    return results.toArray(new String[results.size()]);

}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号