View Javadoc
1   package ejava.projects.esales.blimpl;
2   
3   import java.util.List;
4   
5   import ejava.projects.esales.bl.AccountMgmt;
6   import ejava.projects.esales.bl.AccountMgmtException;
7   import ejava.projects.esales.bo.Account;
8   import ejava.projects.esales.dao.AccountDAO;
9   
10  /**
11   * This class provides a simple example of the account mgmt implementation.
12   * 
13   * @author jcstaff
14   *
15   */
16  public class AccountMgmtImpl implements AccountMgmt {
17  	private AccountDAO accountDAO;
18  	
19  	public void setAccountDAO(AccountDAO accountDAO) {
20  		this.accountDAO = accountDAO;;
21  	}
22  
23  	public List<Account> getAccounts(int index, int count) 
24  	    throws AccountMgmtException {
25  		
26  		if (count < 0) {
27  			throw new AccountMgmtException("count must be >= 0");
28  		}
29  		return accountDAO.getAccounts(index, count);
30  	}
31  }