public class TellerEJB extends Object implements TellerLocal, TellerRemote
| Modifier and Type | Field and Description |
|---|---|
protected SessionContext |
ctx |
protected String |
daoClassName |
protected EntityManager |
em
The peristence context will be defined as a property to allow a
derived class to override this value and assist in unit testing.
|
private static org.apache.commons.logging.Log |
log |
private StatsLocal |
stats |
protected Teller |
teller |
| Constructor and Description |
|---|
TellerEJB() |
| Modifier and Type | Method and Description |
|---|---|
Owner |
addOwner(long ownerId,
String accountNumber) |
void |
close()
This method will perform one-time cleanup for the object.
|
Account |
closeAccount(String acctNum) |
Account |
createAccount(String accountNumber) |
Owner |
createOwner(String firstName,
String lastName,
String ssn) |
private void |
debug() |
Account |
getAccount(String acctNum) |
List<Account> |
getAccounts(int index,
int count) |
Ledger |
getLedger() |
Ledger |
getLedger2()
This method takes advantage of the DAO/Business logic knowledge
of how to create a DTO.
|
double |
getLedgerAveBalance()
This method is and example of a method that may be too fine for a
remote method and should be encapsulated in a remote facade call.
|
long |
getLedgerCount()
This method is and example of a method that may be too fine for a
remote method and should be encapsulated in a remote facade call.
|
double |
getLedgerSum()
This method is and example of a method that may be too fine for a
remote method and should be encapsulated in a remote facade call.
|
List<Account> |
getOverdrawnAccounts(int index,
int count) |
List<Owner> |
getOwners(int index,
int count) |
List<OwnerDTO> |
getOwnersDTO(int index,
int count) |
List<Owner> |
getOwnersLoaded(int index,
int count) |
List<Owner> |
getOwnersPOJO(int index,
int count) |
void |
init()
This method performs one-time initialization for the session bean.
|
Owner |
openAccount(long ownerId,
String accountNumber) |
void |
removeOwner(long ownerId) |
void |
updateAccount(Account account) |
String |
whoAmI() |
private static final org.apache.commons.logging.Log log
protected SessionContext ctx
protected EntityManager em
protected String daoClassName
private StatsLocal stats
protected Teller teller
@PostConstruct public void init()
@PreDestroy public void close()
public Account createAccount(String accountNumber) throws BankException
createAccount in interface TellerBankExceptionpublic Account closeAccount(String acctNum) throws BankException
closeAccount in interface TellerBankExceptionpublic Account getAccount(String acctNum) throws BankException
getAccount in interface TellerBankExceptionpublic List<Account> getOverdrawnAccounts(int index, int count) throws BankException
getOverdrawnAccounts in interface TellerBankExceptionpublic List<Account> getAccounts(int index, int count) throws BankException
getAccounts in interface TellerBankExceptionpublic void updateAccount(Account account) throws BankException
updateAccount in interface TellerBankExceptionpublic Ledger getLedger() throws BankException
getLedger in interface TellerBankExceptionpublic Ledger getLedger2() throws BankException
getLedger2 in interface TellerRemoteBankExceptionpublic double getLedgerAveBalance()
throws BankException
getLedgerAveBalance in interface TellerBankExceptionpublic long getLedgerCount()
throws BankException
getLedgerCount in interface TellerBankExceptionpublic double getLedgerSum()
throws BankException
getLedgerSum in interface TellerBankExceptionprivate void debug()
public Owner addOwner(long ownerId, String accountNumber) throws BankException
addOwner in interface TellerBankExceptionpublic Owner createOwner(String firstName, String lastName, String ssn) throws BankException
createOwner in interface TellerBankExceptionpublic Owner openAccount(long ownerId, String accountNumber) throws BankException
openAccount in interface TellerBankExceptionpublic void removeOwner(long ownerId)
throws BankException
removeOwner in interface TellerBankExceptionpublic List<Owner> getOwners(int index, int count) throws BankException
getOwners in interface TellerBankExceptionpublic List<Owner> getOwnersLoaded(int index, int count) throws BankException
getOwnersLoaded in interface TellerRemoteBankExceptionpublic List<Owner> getOwnersPOJO(int index, int count) throws BankException
getOwnersPOJO in interface TellerRemoteBankExceptionpublic List<OwnerDTO> getOwnersDTO(int index, int count) throws BankException
getOwnersDTO in interface TellerRemoteBankExceptionpublic String whoAmI()
whoAmI in interface TellerRemoteCopyright © 2015 John's Hopkins University, Engineering Programs for Professionals. All rights reserved.