All Examples XML Examples BizTalk Example
Class examples.xml.biztalk.ejb.biztrader.BizTraderBean
java.lang.Object
|
+----examples.xml.biztalk.ejb.biztrader.BizTraderBean
- public class BizTraderBean
- extends Object
- implements SessionBean
BizTraderBean is a stateless SessionBean. It is based off of
examples.ejb.basic.statelessSession.TraderBean. This bean also
implements the examples.xml.biztalk.ejb.BizBean interface and
illustrates:
- No persistence of state between calls to the SessionBean
- Application-defined exceptions
- Author:
- Copyright (c) 2000 by BEA Systems, Inc. All Rights Reserved.
-
BizTraderBean()
-
-
buy(String, String, int)
- Buys shares of a stock for a named customer.
-
ejbActivate()
- This method is required by the EJB Specification,
but is not used by this example.
-
ejbCreate()
- This method corresponds to the create method in the home interface
"BizBeanHome.java".
-
ejbPassivate()
- This method is required by the EJB Specification,
but is not used by this example.
-
ejbRemove()
- This method is required by the EJB Specification,
but is not used by this example.
-
getStockPrice(String)
- Returns the stock price for a given stock.
-
sell(String, String, int)
- Sells shares of a stock for a named customer.
-
service(IncomingMessage)
- Called by BizTalk Server when a message for this bean is received.
-
setSessionContext(SessionContext)
- Sets the session context.
BizTraderBean
public BizTraderBean()
ejbActivate
public void ejbActivate()
- This method is required by the EJB Specification,
but is not used by this example.
ejbRemove
public void ejbRemove()
- This method is required by the EJB Specification,
but is not used by this example.
ejbPassivate
public void ejbPassivate()
- This method is required by the EJB Specification,
but is not used by this example.
setSessionContext
public void setSessionContext(SessionContext ctx)
- Sets the session context.
- Parameters:
- ctx - SessionContext Context for session
ejbCreate
public void ejbCreate() throws CreateException
- This method corresponds to the create method in the home interface
"BizBeanHome.java".
The parameter sets of the two methods are identical. When the client calls
BizBeanHome.create(), the container allocates an instance of
the EJBean and calls ejbCreate().
- Throws: CreateException
- if there is
a communications or systems failure
- See Also:
- BizTraderBean
buy
public void buy(String customerName,
String stockSymbol,
int shares) throws ProcessingErrorException
- Buys shares of a stock for a named customer.
- Parameters:
- customerName - String Customer name
- stockSymbol - String Stock symbol
- shares - int Number of shares to buy
- Throws: ProcessingErrorException
- if there is an error while buying the shares
sell
public void sell(String customerName,
String stockSymbol,
int shares) throws ProcessingErrorException
- Sells shares of a stock for a named customer.
- Parameters:
- customerName - String Customer name
- stockSymbol - String Stock symbol
- shares - int Number of shares to buy
- Throws: ProcessingErrorException
- if there is an error while selling the shares
getStockPrice
public double getStockPrice(String stockSymbol) throws ProcessingErrorException
- Returns the stock price for a given stock.
- Parameters:
- stockSymbol - String Stock symbol
- Returns:
- double Stock price
- Throws: ProcessingErrorException
- if there is an error while checking the price
service
public void service(IncomingMessage message) throws RemoteException
- Called by BizTalk Server when a message for this bean is received.
This method processes the BizTalk message payload by executing the trade
defined in the payload.
- Parameters:
- message - BizTalk message payload.
- Throws: RemoteException,
- ProcessingErrorException
All Examples XML Examples BizTalk Example