当前位置: 首页>>代码示例>>Java>>正文


Java UserDatabase.getGroups方法代码示例

本文整理汇总了Java中org.apache.catalina.UserDatabase.getGroups方法的典型用法代码示例。如果您正苦于以下问题:Java UserDatabase.getGroups方法的具体用法?Java UserDatabase.getGroups怎么用?Java UserDatabase.getGroups使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.catalina.UserDatabase的用法示例。


在下文中一共展示了UserDatabase.getGroups方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getGroups

import org.apache.catalina.UserDatabase; //导入方法依赖的package包/类
/**
 * Return the MBean Names of all groups defined in this database.
 */
public String[] getGroups() {

    UserDatabase database = (UserDatabase) this.resource;
    ArrayList<String> results = new ArrayList<String>();
    Iterator<Group> groups = database.getGroups();
    while (groups.hasNext()) {
        Group group = groups.next();
        results.add(findGroup(group.getGroupname()));
    }
    return results.toArray(new String[results.size()]);

}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:16,代码来源:MemoryUserDatabaseMBean.java

示例2: getGroups

import org.apache.catalina.UserDatabase; //导入方法依赖的package包/类
/**
 * Return the MBean Names of all groups defined in this database.
 */
public String[] getGroups() {

    UserDatabase database = (UserDatabase) this.resource;
    ArrayList results = new ArrayList();
    Iterator groups = database.getGroups();
    while (groups.hasNext()) {
        Group group = (Group) groups.next();
        results.add(findGroup(group.getGroupname()));
    }
    return ((String[]) results.toArray(new String[results.size()]));

}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:16,代码来源:MemoryUserDatabaseMBean.java

示例3: getGroups

import org.apache.catalina.UserDatabase; //导入方法依赖的package包/类
/**
 * Return the MBean Names of all groups defined in this database.
 */
public String[] getGroups() {

	UserDatabase database = (UserDatabase) this.resource;
	ArrayList<String> results = new ArrayList<String>();
	Iterator<Group> groups = database.getGroups();
	while (groups.hasNext()) {
		Group group = groups.next();
		results.add(findGroup(group.getGroupname()));
	}
	return results.toArray(new String[results.size()]);

}
 
开发者ID:how2j,项目名称:lazycat,代码行数:16,代码来源:MemoryUserDatabaseMBean.java

示例4: createMBeans

import org.apache.catalina.UserDatabase; //导入方法依赖的package包/类
/**
 * Create the MBeans for the specified UserDatabase and its contents.
 *
 * @param name Complete resource name of this UserDatabase
 * @param database The UserDatabase to be processed
 *
 * @exception Exception if an exception occurs while creating MBeans
 */
protected void createMBeans(String name, UserDatabase database)
    throws Exception {

    // Create the MBean for the UserDatabase itself
    if (debug >= 2) {
        log("Creating UserDatabase MBeans for resource " + name);
        log("Database=" + database);
    }
    if (MBeanUtils.createMBean(database) == null) {
        throw new IllegalArgumentException
            ("Cannot create UserDatabase MBean for resource " + name);
    }

    // Create the MBeans for each defined Role
    Iterator roles = database.getRoles();
    while (roles.hasNext()) {
        Role role = (Role) roles.next();
        if (debug >= 3) {
            log("  Creating Role MBean for role " + role);
        }
        if (MBeanUtils.createMBean(role) == null) {
            throw new IllegalArgumentException
                ("Cannot create Role MBean for role " + role);
        }
    }

    // Create the MBeans for each defined Group
    Iterator groups = database.getGroups();
    while (groups.hasNext()) {
        Group group = (Group) groups.next();
        if (debug >= 3) {
            log("  Creating Group MBean for group " + group);
        }
        if (MBeanUtils.createMBean(group) == null) {
            throw new IllegalArgumentException
                ("Cannot create Group MBean for group " + group);
        }
    }

    // Create the MBeans for each defined User
    Iterator users = database.getUsers();
    while (users.hasNext()) {
        User user = (User) users.next();
        if (debug >= 3) {
            log("  Creating User MBean for user " + user);
        }
        if (MBeanUtils.createMBean(user) == null) {
            throw new IllegalArgumentException
                ("Cannot create User MBean for user " + user);
        }
    }

}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:62,代码来源:GlobalResourcesLifecycleListener.java

示例5: createMBeans

import org.apache.catalina.UserDatabase; //导入方法依赖的package包/类
/**
 * Create the MBeans for the specified UserDatabase and its contents.
 *
 * @param name Complete resource name of this UserDatabase
 * @param database The UserDatabase to be processed
 *
 * @exception Exception if an exception occurs while creating MBeans
 */
protected void createMBeans(String name, UserDatabase database)
    throws Exception {

    // Create the MBean for the UserDatabase itself
    if (log.isDebugEnabled()) {
        log.debug("Creating UserDatabase MBeans for resource " + name);
        log.debug("Database=" + database);
    }
    if (MBeanUtils.createMBean(database) == null) {
        throw new IllegalArgumentException
            ("Cannot create UserDatabase MBean for resource " + name);
    }

    // Create the MBeans for each defined Role
    Iterator<Role> roles = database.getRoles();
    while (roles.hasNext()) {
        Role role = roles.next();
        if (log.isDebugEnabled()) {
            log.debug("  Creating Role MBean for role " + role);
        }
        if (MBeanUtils.createMBean(role) == null) {
            throw new IllegalArgumentException
                ("Cannot create Role MBean for role " + role);
        }
    }

    // Create the MBeans for each defined Group
    Iterator<Group> groups = database.getGroups();
    while (groups.hasNext()) {
        Group group = groups.next();
        if (log.isDebugEnabled()) {
            log.debug("  Creating Group MBean for group " + group);
        }
        if (MBeanUtils.createMBean(group) == null) {
            throw new IllegalArgumentException
                ("Cannot create Group MBean for group " + group);
        }
    }

    // Create the MBeans for each defined User
    Iterator<User> users = database.getUsers();
    while (users.hasNext()) {
        User user = users.next();
        if (log.isDebugEnabled()) {
            log.debug("  Creating User MBean for user " + user);
        }
        if (MBeanUtils.createMBean(user) == null) {
            throw new IllegalArgumentException
                ("Cannot create User MBean for user " + user);
        }
    }

}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:62,代码来源:GlobalResourcesLifecycleListener.java


注:本文中的org.apache.catalina.UserDatabase.getGroups方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。