samples.j2ee.ejb.basic.statelessSession
Interface Trader


public interface Trader
extends javax.ejb.EJBObject

The methods in this interface are the public face of TraderBean. The signatures of the methods are identical to those of the EJBean, except that these methods throw a java.rmi.RemoteException.


Method Summary
 TradeResult buy(java.lang.String customerName, java.lang.String stockSymbol, int shares)
          Buys shares of a stock for a named customer.
 TradeResult sell(java.lang.String customerName, java.lang.String stockSymbol, int shares)
          Sells shares of a stock for a named customer.
 
Methods inherited from interface javax.ejb.EJBObject
getEJBHome, getHandle, getPrimaryKey, isIdentical, remove
 

Method Detail

buy

public TradeResult buy(java.lang.String customerName,
                       java.lang.String stockSymbol,
                       int shares)
                throws ProcessingErrorException,
                       java.rmi.RemoteException
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
Returns:
TradeResult Trade Result
Throws:
ProcessingErrorException - if there is an error while buying the shares
java.rmi.RemoteException - if there is a communications or systems failure

sell

public TradeResult sell(java.lang.String customerName,
                        java.lang.String stockSymbol,
                        int shares)
                 throws ProcessingErrorException,
                        java.rmi.RemoteException
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
Returns:
TradeResult Trade Result
Throws:
ProcessingErrorException - if there is an error while selling the shares
java.rmi.RemoteException - if there is a communications or systems failure