本文整理汇总了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()]);
}
示例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()]));
}
示例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()]);
}
示例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);
}
}
}
示例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);
}
}
}