Methods Summary |
---|
public Account | createAccount(Customer customer, float balance)
try
{
Bank bank = (Bank) new InitialContext()
.lookup(Bank.JNDI_NAME);
return null;
} catch (Exception e)
{
log.debug("failed", e);
throw new BankException("Could not create account", e);
}
|
public void | excludedMethod()
|
public Account | getAccount(Customer customer, float balance)
try
{
// Check for existing account
Collection accounts = customer.getAccounts();
if (accounts.size() > 0)
{
Iterator i = accounts.iterator();
Account acct = (Account) i.next();
// Set balance
acct.withdraw(acct.getBalance() - balance);
return acct;
} else
{
// Create account
return createAccount(customer, balance);
}
} catch (Exception e)
{
log.debug("failed", e);
throw new BankException("Could not get account for " + customer, e);
}
|
public Customer | getCustomer(java.lang.String name)
try
{
// Check for existing customer
return null;
} catch (Exception e)
{
log.debug("failed", e);
throw new BankException("Could not get customer for " + name, e);
}
|
public java.lang.String | getDefaultValue()
return defaultValue;
|
public java.lang.String | greetChecked(java.lang.String greeting)
if (tm.getTransaction() == null) throw new Exception("method has no tx set");
return greeting;
|
public java.lang.String | greetUnchecked(java.lang.String greeting)
if (tm.getTransaction() == null) throw new Exception("method has no tx set");
return greeting;
|
public java.lang.String | greetWithNotSupportedTransaction(java.lang.String greeting)
if (tm.getTransaction() != null) throw new Exception("method has tx set");
return greeting;
|
public java.lang.String | greetWithRequiredTransaction(java.lang.String greeting)
if (tm.getTransaction() == null) throw new Exception("method has no tx set");
return greeting;
|
public java.lang.String | greetWithServiceTimer(java.lang.String greeting)
if (ts == null) throw new Exception("TimerService @Inject failed");
return greeting;
|
public boolean | isConstructed()
return constructed;
|
public void | postConstruct()
constructed = true;
|
public java.lang.String | retrieveCustomerId()
return bank.retrieveCustomerId();
|
public void | setTransactionManager(javax.transaction.TransactionManager tm)
this.tm = tm;
System.out.println("TransactionManager set: " + tm);
|
public void | storeCustomerId(java.lang.String customerId)
bank.storeCustomerId(customerId);
|
public void | testTransactionTimeout()
boolean exceptionCaught = false;
try
{
log.info("************* calling bank.testTransactionTimeout()");
bank.testTransactionTimeout();
log.info("************* finished calling bank.testTransactionTimeout()");
}
catch (Exception e)
{
log.info("********** caught exception");
exceptionCaught = true;
}
if (!exceptionCaught) throw new RuntimeException("Failed to catch transactionTimeout");
|
public void | transfer(Account from, Account to, float amount)
try
{
from.withdraw(amount);
to.deposit(amount);
} catch (Exception e)
{
throw new BankException("Could not transfer " + amount + " from "
+ from + " to " + to, e);
}
|
public void | transferTest(Account from, Account to, float amount, int iter)
for (int i = 0; i < iter; i++)
{
from.withdraw(amount);
to.deposit(amount);
}
|