本文整理汇总了Java中org.apache.catalina.UserDatabase.getUsers方法的典型用法代码示例。如果您正苦于以下问题:Java UserDatabase.getUsers方法的具体用法?Java UserDatabase.getUsers怎么用?Java UserDatabase.getUsers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.catalina.UserDatabase
的用法示例。
在下文中一共展示了UserDatabase.getUsers方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getUsers
import org.apache.catalina.UserDatabase; //导入方法依赖的package包/类
/**
* Return the MBean Names of all users defined in this database.
*/
public String[] getUsers() {
UserDatabase database = (UserDatabase) this.resource;
ArrayList<String> results = new ArrayList<String>();
Iterator<User> users = database.getUsers();
while (users.hasNext()) {
User user = users.next();
results.add(findUser(user.getUsername()));
}
return results.toArray(new String[results.size()]);
}
示例2: getUsers
import org.apache.catalina.UserDatabase; //导入方法依赖的package包/类
/**
* Return the MBean Names of all users defined in this database.
*/
public String[] getUsers() {
UserDatabase database = (UserDatabase) this.resource;
ArrayList results = new ArrayList();
Iterator users = database.getUsers();
while (users.hasNext()) {
User user = (User) users.next();
results.add(findUser(user.getUsername()));
}
return ((String[]) results.toArray(new String[results.size()]));
}
示例3: getUsers
import org.apache.catalina.UserDatabase; //导入方法依赖的package包/类
/**
* Return the MBean Names of all users defined in this database.
*/
public String[] getUsers() {
UserDatabase database = (UserDatabase) this.resource;
ArrayList<String> results = new ArrayList<String>();
Iterator<User> users = database.getUsers();
while (users.hasNext()) {
User user = users.next();
results.add(findUser(user.getUsername()));
}
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);
}
}
}