You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by cj...@apache.org on 2007/04/02 19:26:35 UTC
svn commit: r524844 - in
/geronimo/daytrader/branches/1.2/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader:
TradeAction.java TradeServices.java ejb/Trade.java ejb/TradeBean.java
session/TradeJDBCBean.java
Author: cjblythe
Date: Mon Apr 2 10:26:34 2007
New Revision: 524844
URL: http://svn.apache.org/viewvc?view=rev&rev=524844
Log:
DAYTRADER-39 Revise thrown exceptions to comply with spec
Modified:
geronimo/daytrader/branches/1.2/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/TradeAction.java
geronimo/daytrader/branches/1.2/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/TradeServices.java
geronimo/daytrader/branches/1.2/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb/Trade.java
geronimo/daytrader/branches/1.2/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb/TradeBean.java
geronimo/daytrader/branches/1.2/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/session/TradeJDBCBean.java
Modified: geronimo/daytrader/branches/1.2/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/TradeAction.java
URL: http://svn.apache.org/viewvc/geronimo/daytrader/branches/1.2/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/TradeAction.java?view=diff&rev=524844&r1=524843&r2=524844
==============================================================================
--- geronimo/daytrader/branches/1.2/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/TradeAction.java (original)
+++ geronimo/daytrader/branches/1.2/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/TradeAction.java Mon Apr 2 10:26:34 2007
@@ -393,7 +393,7 @@
* the account userID to lookup
* @return User account data in AccountDataBean
*/
- public AccountDataBean getAccountData(String userID) throws javax.ejb.FinderException, RemoteException {
+ public AccountDataBean getAccountData(String userID) throws Exception, RemoteException {
if (Log.doActionTrace())
Log.trace("TradeAction:getAccountData", userID);
AccountDataBean accountData = null;
Modified: geronimo/daytrader/branches/1.2/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/TradeServices.java
URL: http://svn.apache.org/viewvc/geronimo/daytrader/branches/1.2/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/TradeServices.java?view=diff&rev=524844&r1=524843&r2=524844
==============================================================================
--- geronimo/daytrader/branches/1.2/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/TradeServices.java (original)
+++ geronimo/daytrader/branches/1.2/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/TradeServices.java Mon Apr 2 10:26:34 2007
@@ -88,7 +88,8 @@
* @return OrderDataBean providing the status of the completed order
*/
public void queueOrder(Integer orderID, boolean twoPhase) throws Exception, RemoteException;
-
/**
+
+ /**
* Complete the Order identefied by orderID
* Orders are submitted through JMS to a Trading agent
* and completed asynchronously. This method completes the order
@@ -132,7 +133,8 @@
* @return Collection OrderDataBeans providing detailed order information
*/
public Collection getOrders(String userID) throws Exception, RemoteException;
-
/**
+
+ /**
* Get the collection of completed orders for a given account that need to be alerted to the user
*
* @param userID the customer account to retrieve orders for
@@ -200,7 +202,7 @@
* @return User account data in AccountDataBean
*/
public AccountDataBean getAccountData(String userID)
- throws javax.ejb.FinderException, RemoteException;
+ throws Exception, RemoteException;
/**
* Return an AccountProfileDataBean for userID providing the users profile
Modified: geronimo/daytrader/branches/1.2/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb/Trade.java
URL: http://svn.apache.org/viewvc/geronimo/daytrader/branches/1.2/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb/Trade.java?view=diff&rev=524844&r1=524843&r2=524844
==============================================================================
--- geronimo/daytrader/branches/1.2/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb/Trade.java (original)
+++ geronimo/daytrader/branches/1.2/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb/Trade.java Mon Apr 2 10:26:34 2007
@@ -36,7 +36,7 @@
* @param oldPrice - the price of the Quote before the update
* @param sharesTraded - the quantity of sharesTraded
*/
- public void publishQuotePriceChange(QuoteDataBean quoteData, java.math.BigDecimal oldPrice, java.math.BigDecimal changeFactor, double sharesTraded) throws RemoteException;
+ public void publishQuotePriceChange(QuoteDataBean quoteData, java.math.BigDecimal oldPrice, java.math.BigDecimal changeFactor, double sharesTraded) throws Exception, RemoteException;
/**
* provides a simple session method with no database access to test performance of a simple
@@ -45,7 +45,7 @@
* @param NetValue current value
* @return return on investment as a percentage
*/
- public double investmentReturn(double investment, double NetValue) throws RemoteException;
+ public double investmentReturn(double investment, double NetValue) throws Exception, RemoteException;
/**
* This method provides a ping test for a 2-phase commit operation
@@ -53,6 +53,6 @@
* @param symbol to lookup
* @return quoteData after sending JMS message
*/
- public QuoteDataBean pingTwoPhase(String symbol) throws RemoteException;
+ public QuoteDataBean pingTwoPhase(String symbol) throws Exception, RemoteException;
}
Modified: geronimo/daytrader/branches/1.2/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb/TradeBean.java
URL: http://svn.apache.org/viewvc/geronimo/daytrader/branches/1.2/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb/TradeBean.java?view=diff&rev=524844&r1=524843&r2=524844
==============================================================================
--- geronimo/daytrader/branches/1.2/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb/TradeBean.java (original)
+++ geronimo/daytrader/branches/1.2/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/ejb/TradeBean.java Mon Apr 2 10:26:34 2007
@@ -180,7 +180,7 @@
}
public QuoteDataBean createQuote(String symbol, String companyName, BigDecimal price)
- throws CreateException, Exception
+ throws Exception
{
try
{
@@ -271,7 +271,7 @@
}
public void publishQuotePriceChange(QuoteDataBean quoteData, BigDecimal oldPrice, BigDecimal changeFactor, double sharesTraded)
- throws RemoteException
+ throws Exception
{
if ( TradeConfig.getPublishQuotePriceChange() == false)
return;
@@ -437,7 +437,7 @@
public Collection getOrders(String userID)
- throws FinderException, Exception
+ throws Exception
{
if (Log.doTrace())
@@ -476,7 +476,7 @@
}
public Collection getClosedOrders(String userID)
- throws FinderException, Exception
+ throws Exception
{
if (Log.doTrace())
Log.trace("TradeBean:getClosedOrders", userID);
@@ -671,7 +671,7 @@
}
public Collection getHoldings(String userID)
- throws FinderException, Exception
+ throws Exception
{
if (Log.doTrace())
Log.trace("TradeBean:getHoldings", userID);
@@ -690,7 +690,7 @@
}
public HoldingDataBean getHolding(Integer holdingID)
- throws FinderException, Exception
+ throws Exception
{
if (Log.doTrace())
Log.trace("TradeBean:getHolding", holdingID);
@@ -758,7 +758,7 @@
}
public AccountDataBean login(String userID, String password)
- throws FinderException, Exception {
+ throws Exception {
/* The following commented code shows alternative forms of the finder needed for this
* method
@@ -787,7 +787,7 @@
}
public void logout(String userID)
- throws FinderException, Exception {
+ throws Exception {
if (Log.doTrace())
Log.trace("TradeBean:logout", userID);
@@ -821,7 +821,7 @@
String email,
String creditcard,
BigDecimal openBalance)
- throws CreateException, Exception {
+ throws Exception {
LocalAccount account = null;
@@ -851,7 +851,7 @@
}
public AccountDataBean getAccountData(String userID)
- throws FinderException, RemoteException {
+ throws Exception {
if (Log.doTrace())
Log.trace("TradeBean:getAccountData", userID);
@@ -877,7 +877,7 @@
return accountData;
}
public AccountProfileDataBean getAccountProfileData(String userID)
- throws FinderException, Exception {
+ throws Exception {
if (Log.doTrace())
Log.trace("TradeBean:getAccountProfileData", userID);
@@ -903,7 +903,7 @@
}
public AccountProfileDataBean updateAccountProfile(AccountProfileDataBean accountProfileData)
- throws FinderException, Exception {
+ throws Exception {
if (Log.doTrace())
Log.trace("TradeBean:updateAccountProfileData", accountProfileData);
@@ -951,7 +951,7 @@
* @return return on investment as a percentage
*/
public double investmentReturn(double investment, double NetValue)
- throws RemoteException
+ throws Exception
{
if (Log.doTrace())
Log.trace("TradeBean:investmentReturn");
@@ -969,7 +969,7 @@
* @return quoteData after sending JMS message
*/
public QuoteDataBean pingTwoPhase(String symbol)
- throws RemoteException
+ throws Exception
{
try{
if (Log.doTrace()) Log.trace("TradeBean:pingTwoPhase", symbol);
@@ -1017,7 +1017,7 @@
public TradeBean() {
}
- private static boolean warnJMSFailure = true;
+ private boolean warnJMSFailure = true;
public void ejbCreate() throws CreateException {
try {
Modified: geronimo/daytrader/branches/1.2/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/session/TradeJDBCBean.java
URL: http://svn.apache.org/viewvc/geronimo/daytrader/branches/1.2/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/session/TradeJDBCBean.java?view=diff&rev=524844&r1=524843&r2=524844
==============================================================================
--- geronimo/daytrader/branches/1.2/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/session/TradeJDBCBean.java (original)
+++ geronimo/daytrader/branches/1.2/modules/ejb/src/main/java/org/apache/geronimo/samples/daytrader/session/TradeJDBCBean.java Mon Apr 2 10:26:34 2007
@@ -58,92 +58,92 @@
this.context = sc;
}
- public MarketSummaryDataBean getMarketSummary() throws Exception, RemoteException {
+ public MarketSummaryDataBean getMarketSummary() throws Exception {
return (new TradeDirect(true)).getMarketSummary();
}
- public OrderDataBean buy(String userID, String symbol, double quantity, int orderProcessingMode) throws Exception, RemoteException {
+ public OrderDataBean buy(String userID, String symbol, double quantity, int orderProcessingMode) throws Exception {
return (new TradeDirect(true)).buy(userID, symbol, quantity, orderProcessingMode);
}
- public OrderDataBean sell(String userID, Integer holdingID, int orderProcessingMode) throws Exception, RemoteException {
+ public OrderDataBean sell(String userID, Integer holdingID, int orderProcessingMode) throws Exception {
return (new TradeDirect(true)).sell(userID, holdingID, orderProcessingMode);
}
- public void queueOrder(Integer orderID, boolean twoPhase) throws Exception, RemoteException {
+ public void queueOrder(Integer orderID, boolean twoPhase) throws Exception {
(new TradeDirect(true)).queueOrder(orderID, twoPhase);
}
- public OrderDataBean completeOrder(Integer orderID, boolean twoPhase) throws Exception, RemoteException {
+ public OrderDataBean completeOrder(Integer orderID, boolean twoPhase) throws Exception {
return (new TradeDirect(true)).completeOrder(orderID, twoPhase);
}
- public void cancelOrder(Integer orderID, boolean twoPhase) throws Exception, RemoteException {
+ public void cancelOrder(Integer orderID, boolean twoPhase) throws Exception {
(new TradeDirect(true)).cancelOrder(orderID, twoPhase);
}
- public void orderCompleted(String userID, Integer orderID) throws Exception, RemoteException {
+ public void orderCompleted(String userID, Integer orderID) throws Exception {
(new TradeDirect(true)).orderCompleted(userID, orderID);
}
- public Collection getOrders(String userID) throws Exception, RemoteException {
+ public Collection getOrders(String userID) throws Exception {
return (new TradeDirect(true)).getOrders(userID);
}
- public Collection getClosedOrders(String userID) throws Exception, RemoteException {
+ public Collection getClosedOrders(String userID) throws Exception {
return (new TradeDirect(true)).getClosedOrders(userID);
}
- public QuoteDataBean createQuote(String symbol, String companyName, BigDecimal price) throws Exception, RemoteException {
+ public QuoteDataBean createQuote(String symbol, String companyName, BigDecimal price) throws Exception {
return (new TradeDirect(true)).createQuote(symbol, companyName, price);
}
- public QuoteDataBean getQuote(String symbol) throws Exception, RemoteException {
+ public QuoteDataBean getQuote(String symbol) throws Exception {
return (new TradeDirect(true)).getQuote(symbol);
}
- public Collection getAllQuotes() throws Exception, RemoteException {
+ public Collection getAllQuotes() throws Exception {
return (new TradeDirect(true)).getAllQuotes();
}
- public QuoteDataBean updateQuotePriceVolume(String symbol, BigDecimal newPrice, double sharesTraded) throws Exception, RemoteException {
+ public QuoteDataBean updateQuotePriceVolume(String symbol, BigDecimal newPrice, double sharesTraded) throws Exception {
return (new TradeDirect(true)).updateQuotePriceVolume(symbol, newPrice, sharesTraded);
}
- public Collection getHoldings(String userID) throws Exception, RemoteException {
+ public Collection getHoldings(String userID) throws Exception {
return (new TradeDirect(true)).getHoldings(userID);
}
- public HoldingDataBean getHolding(Integer holdingID) throws Exception, RemoteException {
+ public HoldingDataBean getHolding(Integer holdingID) throws Exception {
return (new TradeDirect(true)).getHolding(holdingID);
}
- public AccountDataBean getAccountData(String userID) throws javax.ejb.FinderException, Exception {
+ public AccountDataBean getAccountData(String userID) throws Exception {
return (new TradeDirect(true)).getAccountData(userID);
}
- public AccountProfileDataBean getAccountProfileData(String userID) throws Exception, RemoteException {
+ public AccountProfileDataBean getAccountProfileData(String userID) throws Exception {
return (new TradeDirect(true)).getAccountProfileData(userID);
}
- public AccountProfileDataBean updateAccountProfile(AccountProfileDataBean profileData) throws Exception, RemoteException {
+ public AccountProfileDataBean updateAccountProfile(AccountProfileDataBean profileData) throws Exception {
return (new TradeDirect(true)).updateAccountProfile(profileData);
}
- public AccountDataBean login(String userID, String password) throws Exception, RemoteException {
+ public AccountDataBean login(String userID, String password) throws Exception {
return (new TradeDirect(true)).login(userID, password);
}
- public void logout(String userID) throws Exception, RemoteException {
+ public void logout(String userID) throws Exception {
(new TradeDirect(true)).logout(userID);
}
- public AccountDataBean register(String userID, String password, String fullname, String address, String email, String creditcard, BigDecimal openBalance) throws Exception, RemoteException {
+ public AccountDataBean register(String userID, String password, String fullname, String address, String email, String creditcard, BigDecimal openBalance) throws Exception {
return (new TradeDirect(true)).register(userID, password, fullname, address, email, creditcard, openBalance);
}
- public RunStatsDataBean resetTrade(boolean deleteAll) throws Exception, RemoteException {
+ public RunStatsDataBean resetTrade(boolean deleteAll) throws Exception {
return (new TradeDirect(true)).resetTrade(deleteAll);
}
}