|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--samples.j2ee.ejb.basic.statelessSession.TraderBean
TraderBean is a stateless SessionBean. This bean illustrates:
| Constructor Summary | |
TraderBean()
|
|
| Method Summary | |
TradeResult |
buy(java.lang.String customerName,
java.lang.String stockSymbol,
int shares)
Buys shares of a stock for a named customer. |
void |
ejbActivate()
This method is required by the EJB Specification, but is not used by this example. |
void |
ejbCreate()
This method corresponds to the create method in the home interface "TraderHome.java". |
void |
ejbPassivate()
This method is required by the EJB Specification, but is not used by this example. |
void |
ejbRemove()
This method is required by the EJB Specification, but is not used by this example. |
double |
getStockPrice(java.lang.String stockSymbol)
Returns the stock price for a given stock. |
int |
getTradeLimit()
This method retrieves the tradeLimit environment property from the deployment descriptor. |
TradeResult |
sell(java.lang.String customerName,
java.lang.String stockSymbol,
int shares)
Sells shares of a stock for a named customer. |
void |
setSessionContext(javax.ejb.SessionContext ctx)
Sets the session context. |
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public TraderBean()
| Method Detail |
public void ejbActivate()
public void ejbRemove()
public void ejbPassivate()
public void setSessionContext(javax.ejb.SessionContext ctx)
ctx - SessionContext Context for session
public void ejbCreate()
throws javax.ejb.CreateException
TraderHome.create(), the container allocates an instance of
the EJBean and calls ejbCreate().Trader
public TradeResult buy(java.lang.String customerName,
java.lang.String stockSymbol,
int shares)
throws ProcessingErrorException
customerName - String Customer namestockSymbol - String Stock symbolshares - int Number of shares to buy
public TradeResult sell(java.lang.String customerName,
java.lang.String stockSymbol,
int shares)
throws ProcessingErrorException
customerName - String Customer namestockSymbol - String Stock symbolshares - int Number of shares to buypublic int getTradeLimit()
public double getStockPrice(java.lang.String stockSymbol)
throws ProcessingErrorException
stockSymbol - String Stock symbol
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||