com.ibm.websphere.samples.i18nctx.currencyexchangeejb
Class ExchangeBean

java.lang.Object
  extended by com.ibm.websphere.samples.i18nctx.currencyexchangeejb.ExchangeBean
All Implemented Interfaces:
java.io.Serializable, javax.ejb.EnterpriseBean, javax.ejb.SessionBean

public class ExchangeBean
extends java.lang.Object
implements javax.ejb.SessionBean

A remote Session Bean.

See Also:
Serialized Form

Field Summary
static java.lang.String CUSTOMER_EJBHOME
           
protected  LocalCustomerHome customerHome
           
 
Constructor Summary
ExchangeBean()
           
 
Method Summary
 CustomerJBean deposit(java.lang.String account, double depositAmt)
          Add depositAmt to Customer balance when exchange other currencies to US dollars.
 void ejbActivate()
          Session EJB lifecycle callback methods
 void ejbCreate()
           
 void ejbPassivate()
           
 void ejbRemove()
           
 void setSessionContext(javax.ejb.SessionContext ctx)
           
 CustomerJBean updateCustomer(java.lang.String account)
          update the customer information when the user want to do more exchange
 CustomerJBean verifyPrincipal(java.lang.String account, java.lang.String password)
          Verify Customer's principal
 CustomerJBean withdraw(java.lang.String account, double withdrawAmt)
          Withdraw withdrawAmt from Customer balance when exchange US dollars to other currencies
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

customerHome

protected LocalCustomerHome customerHome

CUSTOMER_EJBHOME

public static final java.lang.String CUSTOMER_EJBHOME
See Also:
Constant Field Values
Constructor Detail

ExchangeBean

public ExchangeBean()
Method Detail

ejbActivate

public void ejbActivate()
Session EJB lifecycle callback methods

Specified by:
ejbActivate in interface javax.ejb.SessionBean

ejbPassivate

public void ejbPassivate()
Specified by:
ejbPassivate in interface javax.ejb.SessionBean

ejbCreate

public void ejbCreate()
               throws javax.ejb.CreateException
Throws:
javax.ejb.CreateException

ejbRemove

public void ejbRemove()
Specified by:
ejbRemove in interface javax.ejb.SessionBean

setSessionContext

public void setSessionContext(javax.ejb.SessionContext ctx)
Specified by:
setSessionContext in interface javax.ejb.SessionBean

verifyPrincipal

public CustomerJBean verifyPrincipal(java.lang.String account,
                                     java.lang.String password)
Verify Customer's principal

Parameters:
account - java.lang.String
password - java.lang.String
Returns:
com.ibm.websphere.samples.i18nctx.currencyexchangelibrary.CustomerJBean

deposit

public CustomerJBean deposit(java.lang.String account,
                             double depositAmt)
Add depositAmt to Customer balance when exchange other currencies to US dollars.

Parameters:
account - java.lang.String
depositAmt - double
Returns:
com.ibm.websphere.samples.i18nctx.currencyexchangelibrary.CustomerJBean

withdraw

public CustomerJBean withdraw(java.lang.String account,
                              double withdrawAmt)
Withdraw withdrawAmt from Customer balance when exchange US dollars to other currencies

Parameters:
account - java.lang.String
withdrawAmt - double
Returns:
com.ibm.websphere.samples.i18nctx.currencyexchangelibrary.CustomerJBean

updateCustomer

public CustomerJBean updateCustomer(java.lang.String account)
update the customer information when the user want to do more exchange

Parameters:
account - java.lang.String
Returns:
com.ibm.websphere.samples.i18nctx.currencyexchangelibrary.CustomerJBean