コード例 #1
0
  /**
   * Create a new User and return the corresponding MBean Name.
   *
   * @param username User name of the new user
   * @param password Password for the new user
   * @param fullName Full name for the new user
   */
  public String createUser(String username, String password, String fullName) {

    UserDatabase database = (UserDatabase) this.resource;
    User user = database.createUser(username, password, fullName);
    try {
      MBeanUtils.createMBean(user);
    } catch (Exception e) {
      IllegalArgumentException iae =
          new IllegalArgumentException("Exception creating user [" + username + "] MBean");
      iae.initCause(e);
      throw iae;
    }
    return (findUser(username));
  }