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:

Author:
Copyright (c) 2000 by BEA Systems, Inc. All Rights Reserved.

Constructor Index

 o BizTraderBean()

Method Index

 o buy(String, String, int)
Buys shares of a stock for a named customer.
 o ejbActivate()
This method is required by the EJB Specification, but is not used by this example.
 o ejbCreate()
This method corresponds to the create method in the home interface "BizBeanHome.java".
 o ejbPassivate()
This method is required by the EJB Specification, but is not used by this example.
 o ejbRemove()
This method is required by the EJB Specification, but is not used by this example.
 o getStockPrice(String)
Returns the stock price for a given stock.
 o sell(String, String, int)
Sells shares of a stock for a named customer.
 o service(IncomingMessage)
Called by BizTalk Server when a message for this bean is received.
 o setSessionContext(SessionContext)
Sets the session context.

Constructors

 o BizTraderBean
 public BizTraderBean()

Methods

 o ejbActivate
 public void ejbActivate()
This method is required by the EJB Specification, but is not used by this example.

 o ejbRemove
 public void ejbRemove()
This method is required by the EJB Specification, but is not used by this example.

 o ejbPassivate
 public void ejbPassivate()
This method is required by the EJB Specification, but is not used by this example.

 o setSessionContext
 public void setSessionContext(SessionContext ctx)
Sets the session context.

Parameters:
ctx - SessionContext Context for session
 o 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
 o 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
 o 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
 o 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
 o 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