org.apache.geronimo.samples.daytrader.ejb
Interface Trade

All Superinterfaces:
javax.ejb.EJBObject, java.rmi.Remote, TradeServices

public interface Trade
extends javax.ejb.EJBObject, TradeServices, java.rmi.Remote


Method Summary
 void cancelOrderOnePhase(java.lang.Integer orderID)
          Cancel the Order identefied by orderID In short, this method is deployed as TXN REQUIRES NEW to avoid a 2-phase commit transaction across Entity and MDB access The boolean twoPhase specifies to the server implementation whether or not the method is to participate in a global transaction
 void cancelOrderOnePhaseDirect(java.lang.Integer orderID)
          Cancel the Order identefied by orderID using TradeDirect to complete the Order In short, this method is deployed as TXN REQUIRES NEW to avoid a 2-phase commit transaction across DB and MDB access The EJB method is used only to start a new transaction so the direct runtime mode for the cancleOrder will run in a 1-phase commit The boolean twoPhase specifies to the server implementation whether or not the method is to participate in a global transaction
 OrderDataBean completeOrderOnePhase(java.lang.Integer orderID)
          Complete the Order identified by orderID in a One Phase commit In short, this method is deployed as TXN REQUIRES NEW to avoid a 2-phase commit transaction across Entity and MDB access Orders are submitted through JMS to a Trading agent and completed asynchronously.
 OrderDataBean completeOrderOnePhaseDirect(java.lang.Integer orderID)
          Complete the Order identified by orderID in a One Phase commit using TradeDirect to complete the Order In short, this method is deployed as TXN REQUIRES NEW to avoid a 2-phase commit transaction across DB and MDB access The EJB method is used only to start a new transaction so the direct runtime mode for the completeOrder will run in a 1-phase commit Orders are submitted through JMS to a Trading agent and completed asynchronously.
 double investmentReturn(double investment, double NetValue)
          provides a simple session method with no database access to test performance of a simple path through a stateless session
 QuoteDataBean pingTwoPhase(java.lang.String symbol)
          This method provides a ping test for a 2-phase commit operation
 void publishQuotePriceChange(QuoteDataBean quoteData, java.math.BigDecimal oldPrice, java.math.BigDecimal changeFactor, double sharesTraded)
          Publish to the QuoteChange Message topic when a stock price and volume are updated This method is deployed as TXN REQUIRES NEW to avoid a 2-phase commit transaction across the DB update and MDB access (i.e.
 void queueOrderOnePhase(java.lang.Integer orderID)
          Queue the Order identified by orderID to be processed in a One Phase commit In short, this method is deployed as TXN REQUIRES NEW to avoid a 2-phase commit transaction across Entity and MDB access Orders are submitted through JMS to a Trading Broker and completed asynchronously.
 
Methods inherited from interface javax.ejb.EJBObject
getEJBHome, getHandle, getPrimaryKey, isIdentical, remove
 
Methods inherited from interface org.apache.geronimo.samples.daytrader.TradeServices
buy, cancelOrder, completeOrder, createQuote, getAccountData, getAccountProfileData, getAllQuotes, getClosedOrders, getHolding, getHoldings, getMarketSummary, getOrders, getQuote, login, logout, orderCompleted, queueOrder, register, resetTrade, sell, updateAccountProfile, updateQuotePriceVolume
 

Method Detail

queueOrderOnePhase

public void queueOrderOnePhase(java.lang.Integer orderID)
                        throws java.rmi.RemoteException
Queue the Order identified by orderID to be processed in a One Phase commit In short, this method is deployed as TXN REQUIRES NEW to avoid a 2-phase commit transaction across Entity and MDB access Orders are submitted through JMS to a Trading Broker and completed asynchronously. This method queues the order for processing

Parameters:
orderID - the Order being queued for processing
Returns:
OrderDataBean providing the status of the completed order
Throws:
java.rmi.RemoteException

completeOrderOnePhase

public OrderDataBean completeOrderOnePhase(java.lang.Integer orderID)
                                    throws java.rmi.RemoteException
Complete the Order identified by orderID in a One Phase commit In short, this method is deployed as TXN REQUIRES NEW to avoid a 2-phase commit transaction across Entity and MDB access Orders are submitted through JMS to a Trading agent and completed asynchronously. This method completes the order For a buy, the stock is purchased creating a holding and the users account is debited For a sell, the stock holding is removed and the users account is credited with the proceeds

Parameters:
orderID - the Order to complete
Returns:
OrderDataBean providing the status of the completed order
Throws:
java.rmi.RemoteException

completeOrderOnePhaseDirect

public OrderDataBean completeOrderOnePhaseDirect(java.lang.Integer orderID)
                                          throws java.rmi.RemoteException
Complete the Order identified by orderID in a One Phase commit using TradeDirect to complete the Order In short, this method is deployed as TXN REQUIRES NEW to avoid a 2-phase commit transaction across DB and MDB access The EJB method is used only to start a new transaction so the direct runtime mode for the completeOrder will run in a 1-phase commit Orders are submitted through JMS to a Trading agent and completed asynchronously. This method completes the order using TradeDirect For a buy, the stock is purchased creating a holding and the users account is debited For a sell, the stock holding is removed and the users account is credited with the proceeds

Parameters:
orderID - the Order to complete
Returns:
OrderDataBean providing the status of the completed order
Throws:
java.rmi.RemoteException

cancelOrderOnePhase

public void cancelOrderOnePhase(java.lang.Integer orderID)
                         throws java.rmi.RemoteException
Cancel the Order identefied by orderID In short, this method is deployed as TXN REQUIRES NEW to avoid a 2-phase commit transaction across Entity and MDB access The boolean twoPhase specifies to the server implementation whether or not the method is to participate in a global transaction

Parameters:
orderID - the Order to complete
Returns:
OrderDataBean providing the status of the completed order
Throws:
java.rmi.RemoteException

cancelOrderOnePhaseDirect

public void cancelOrderOnePhaseDirect(java.lang.Integer orderID)
                               throws java.rmi.RemoteException
Cancel the Order identefied by orderID using TradeDirect to complete the Order In short, this method is deployed as TXN REQUIRES NEW to avoid a 2-phase commit transaction across DB and MDB access The EJB method is used only to start a new transaction so the direct runtime mode for the cancleOrder will run in a 1-phase commit The boolean twoPhase specifies to the server implementation whether or not the method is to participate in a global transaction

Parameters:
orderID - the Order to complete
Returns:
OrderDataBean providing the status of the completed order
Throws:
java.rmi.RemoteException

publishQuotePriceChange

public void publishQuotePriceChange(QuoteDataBean quoteData,
                                    java.math.BigDecimal oldPrice,
                                    java.math.BigDecimal changeFactor,
                                    double sharesTraded)
                             throws java.rmi.RemoteException
Publish to the QuoteChange Message topic when a stock price and volume are updated This method is deployed as TXN REQUIRES NEW to avoid a 2-phase commit transaction across the DB update and MDB access (i.e. a failure to publish will not cause the stock update to fail

Parameters:
quoteData - - the updated Quote
oldPrice - - the price of the Quote before the update
sharesTraded - - the quantity of sharesTraded
Throws:
java.rmi.RemoteException

investmentReturn

public double investmentReturn(double investment,
                               double NetValue)
                        throws java.rmi.RemoteException
provides a simple session method with no database access to test performance of a simple path through a stateless session

Parameters:
investment - amount
NetValue - current value
Returns:
return on investment as a percentage
Throws:
java.rmi.RemoteException

pingTwoPhase

public QuoteDataBean pingTwoPhase(java.lang.String symbol)
                           throws java.rmi.RemoteException
This method provides a ping test for a 2-phase commit operation

Parameters:
symbol - to lookup
Returns:
quoteData after sending JMS message
Throws:
java.rmi.RemoteException


Copyright © 2005-2006 Apache Software Foundation. All Rights Reserved.