|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.ibm.websphere.samples.plantsbywebsphereejb.ShoppingCartBean
public class ShoppingCartBean
ShoppingCartBean is the implementation class for the ShoppingCart stateful session
EJB. ShoppingCartBean implements each of the business methods in the ShoppingCart
EJB local interface and each of the EJB lifecycle methods in the javax.ejb.SessionBean
interface.
ShoppingCart,
ShoppingCartHome,
Serialized Form| Constructor Summary | |
|---|---|
ShoppingCartBean()
|
|
| Method Summary | |
|---|---|
void |
addItem(StoreItem new_item)
Add an item to the cart. |
void |
checkInventory(StoreItem si)
Method checkInventory. |
void |
checkInventory(java.util.Vector items)
Method checkInventory. |
OrderInfo |
createOrder(java.lang.String customerID,
java.lang.String billName,
java.lang.String billAddr1,
java.lang.String billAddr2,
java.lang.String billCity,
java.lang.String billState,
java.lang.String billZip,
java.lang.String billPhone,
java.lang.String shipName,
java.lang.String shipAddr1,
java.lang.String shipAddr2,
java.lang.String shipCity,
java.lang.String shipState,
java.lang.String shipZip,
java.lang.String shipPhone,
java.lang.String creditCard,
java.lang.String ccNum,
java.lang.String ccExpireMonth,
java.lang.String ccExpireYear,
java.lang.String cardHolder,
int shippingMethod,
java.util.Vector items)
Create an order with contents of a shopping cart. |
void |
ejbActivate()
ejbActivate Session EJB lifecycle callback method. |
void |
ejbCreate()
Create a shopping cart. |
void |
ejbCreate(ShoppingCartContents cartContents)
Create a shopping cart. |
void |
ejbPassivate()
ejbPassivate Session EJB lifecycle callback method. |
void |
ejbPostCreate()
Create a shopping cart. |
void |
ejbPostCreate(ShoppingCartContents cartContents)
ejbPostCreate |
void |
ejbRemove()
ejbRemove Session EJB lifecycle callback method. |
ShoppingCartContents |
getCartContents()
Get the contents of the shopping cart. |
java.util.Vector |
getItems()
Get the items in the shopping cart. |
javax.ejb.SessionContext |
getSessionContext()
|
float |
getTotalCost()
Get the total cost of all items in the shopping cart. |
void |
removeItem(StoreItem item)
Remove an item from the cart. |
void |
setItems(java.util.Vector items)
Set the items in the shopping cart. |
void |
setSessionContext(javax.ejb.SessionContext ctx)
setSessionContext Session EJB lifecycle callback method to set the EJB sessionContext for this EJB. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ShoppingCartBean()
| Method Detail |
|---|
public void ejbCreate()
throws javax.ejb.CreateException
javax.ejb.CreateException
public void ejbPostCreate()
throws javax.ejb.CreateException
javax.ejb.CreateException
public void ejbCreate(ShoppingCartContents cartContents)
throws javax.ejb.CreateException
cartContents - Contents to populate cart with.
javax.ejb.CreateException
public void ejbPostCreate(ShoppingCartContents cartContents)
throws javax.ejb.CreateException
javax.ejb.CreateExceptionpublic void addItem(StoreItem new_item)
new_item - Item to add to the cart.public void removeItem(StoreItem item)
item - Item to remove from cart.public java.util.Vector getItems()
public void setItems(java.util.Vector items)
items - A Vector of StoreItem's.public float getTotalCost()
public void checkInventory(StoreItem si)
si - - Store itempublic void checkInventory(java.util.Vector items)
items - public ShoppingCartContents getCartContents()
public OrderInfo createOrder(java.lang.String customerID,
java.lang.String billName,
java.lang.String billAddr1,
java.lang.String billAddr2,
java.lang.String billCity,
java.lang.String billState,
java.lang.String billZip,
java.lang.String billPhone,
java.lang.String shipName,
java.lang.String shipAddr1,
java.lang.String shipAddr2,
java.lang.String shipCity,
java.lang.String shipState,
java.lang.String shipZip,
java.lang.String shipPhone,
java.lang.String creditCard,
java.lang.String ccNum,
java.lang.String ccExpireMonth,
java.lang.String ccExpireYear,
java.lang.String cardHolder,
int shippingMethod,
java.util.Vector items)
customerID - customer's IDbillName - billing namebillAddr1 - billing address line 1billAddr2 - billing address line 2billCity - billing address citybillState - billing address statebillZip - billing address zip codebillPhone - billing phoneshipName - shippng nameshipAddr1 - shippng address line 1shipAddr2 - shippng address line 2shipCity - shippng address cityshipState - shippng address stateshipZip - shippng address zip codeshipPhone - shippng phonecreditCard - credit cardccNum - credit card numberccExpireMonth - credit card expiration monthccExpireYear - credit card expiration yearcardHolder - credit card holder nameshippingMethod - int of shipping method useditems - vector of StoreItems ordered
public void ejbRemove()
ejbRemove in interface javax.ejb.SessionBeanpublic void ejbActivate()
ejbActivate in interface javax.ejb.SessionBeanpublic void ejbPassivate()
ejbPassivate in interface javax.ejb.SessionBeanpublic void setSessionContext(javax.ejb.SessionContext ctx)
setSessionContext in interface javax.ejb.SessionBeanctx - javax.ejb.SessionContext The context for this session EJB.public javax.ejb.SessionContext getSessionContext()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||