tabase Database in which to look up the user * @param username Username specified on the logon form * * @exception ModuleException if a business logic rule is violated */ public User getUser(UserDatabase database, String username) throws ModuleException {
// Force an ArithmeticException which can be handled explicitly if ("arithmetic".equals(username)) { throw new ArithmeticException(); }
// Force an application-specific exception which can be handled if ("expired".equals(username)) { throw new ExpiredPasswordException(username); }
// Look up and return the specified user return ((User) database.findUser(username));