|
WebLogic Server 6.0 Code Examples, BEA Systems, Inc. | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--examples.ejb.basic.statefulSession.TraderBean
TraderBean is a stateful SessionBean. This EJBean illustrates:
Field Summary | |
(package private) static boolean |
VERBOSE
|
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 |
getBalance()
Returns the current balance of a trading session. |
double |
getStockPrice(java.lang.String stockSymbol)
Returns the stock price for a given stock. |
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 |
|
Field Detail |
static final boolean VERBOSE
Constructor Detail |
public TraderBean()
Method Detail |
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 buyProcessingErrorException
- if there is an error while buying the sharespublic void ejbActivate()
ejbActivate
in interface javax.ejb.SessionBean
public void ejbCreate() throws javax.ejb.CreateException
TraderHome.create()
, the container allocates an instance of
the EJBean and calls ejbCreate()
.javax.ejb.CreateException
- if there is a problem creating the beanTrader
public void ejbPassivate()
ejbPassivate
in interface javax.ejb.SessionBean
public void ejbRemove()
ejbRemove
in interface javax.ejb.SessionBean
public double getBalance()
public double getStockPrice(java.lang.String stockSymbol) throws ProcessingErrorException
stockSymbol
- String Stock symbolProcessingErrorException
- if there is an error while checking the pricepublic 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 buyProcessingErrorException
- if there is an error while selling the sharespublic void setSessionContext(javax.ejb.SessionContext ctx)
setSessionContext
in interface javax.ejb.SessionBean
ctx
- SessionContext Context for session
|
Documentation is available at http://e-docs.bea.com/wls/docs60 |
|||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |