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 Teller
BankException
public Account closeAccount(String acctNum) throws BankException
closeAccount
in interface Teller
BankException
public Account getAccount(String acctNum) throws BankException
getAccount
in interface Teller
BankException
public List<Account> getOverdrawnAccounts(int index, int count) throws BankException
getOverdrawnAccounts
in interface Teller
BankException
public List<Account> getAccounts(int index, int count) throws BankException
getAccounts
in interface Teller
BankException
public void updateAccount(Account account) throws BankException
updateAccount
in interface Teller
BankException
public Ledger getLedger() throws BankException
getLedger
in interface Teller
BankException
public Ledger getLedger2() throws BankException
getLedger2
in interface TellerRemote
BankException
public double getLedgerAveBalance() throws BankException
getLedgerAveBalance
in interface Teller
BankException
public long getLedgerCount() throws BankException
getLedgerCount
in interface Teller
BankException
public double getLedgerSum() throws BankException
getLedgerSum
in interface Teller
BankException
private void debug()
public Owner addOwner(long ownerId, String accountNumber) throws BankException
addOwner
in interface Teller
BankException
public Owner createOwner(String firstName, String lastName, String ssn) throws BankException
createOwner
in interface Teller
BankException
public Owner openAccount(long ownerId, String accountNumber) throws BankException
openAccount
in interface Teller
BankException
public void removeOwner(long ownerId) throws BankException
removeOwner
in interface Teller
BankException
public List<Owner> getOwners(int index, int count) throws BankException
getOwners
in interface Teller
BankException
public List<Owner> getOwnersLoaded(int index, int count) throws BankException
getOwnersLoaded
in interface TellerRemote
BankException
public List<Owner> getOwnersPOJO(int index, int count) throws BankException
getOwnersPOJO
in interface TellerRemote
BankException
public List<OwnerDTO> getOwnersDTO(int index, int count) throws BankException
getOwnersDTO
in interface TellerRemote
BankException
public String whoAmI()
whoAmI
in interface TellerRemote
Copyright © 2015 John's Hopkins University, Engineering Programs for Professionals. All rights reserved.