geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dwo...@apache.org
Subject svn commit: r809735 - in /geronimo/daytrader/trunk/modules: core/src/main/java/org/apache/geronimo/samples/daytrader/ core/src/main/java/org/apache/geronimo/samples/daytrader/direct/ util/src/main/java/org/apache/geronimo/samples/daytrader/util/ web/sr...
Date Mon, 31 Aug 2009 20:43:04 GMT
Author: dwoods
Date: Mon Aug 31 20:43:03 2009
New Revision: 809735

URL: http://svn.apache.org/viewvc?rev=809735&view=rev
Log:
modules are building again

Added:
    geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeDirectContextListener.java
      - copied, changed from r809732, geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeWebContextListener.java
    geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeJDBCContextListener.java   (with props)
    geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeJPAContextListener.java   (with props)
    geronimo/daytrader/trunk/modules/web/src/main/resources/
    geronimo/daytrader/trunk/modules/web/src/main/resources/META-INF/
    geronimo/daytrader/trunk/modules/web/src/main/resources/META-INF/LICENSE
    geronimo/daytrader/trunk/modules/web/src/main/resources/META-INF/NOTICE
    geronimo/daytrader/trunk/modules/web/src/main/resources/META-INF/daytrader.sql   (with props)
Removed:
    geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeWebContextListener.java
Modified:
    geronimo/daytrader/trunk/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/TradeAction.java
    geronimo/daytrader/trunk/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/direct/TradeJDBCDirect.java
    geronimo/daytrader/trunk/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/direct/TradeJPADirect.java
    geronimo/daytrader/trunk/modules/util/src/main/java/org/apache/geronimo/samples/daytrader/util/TradeConfig.java
    geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeAppServlet.java
    geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeBuildDB.java
    geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/PingJDBCRead.java
    geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/PingJDBCWrite.java

Modified: geronimo/daytrader/trunk/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/TradeAction.java
URL: http://svn.apache.org/viewvc/geronimo/daytrader/trunk/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/TradeAction.java?rev=809735&r1=809734&r2=809735&view=diff
==============================================================================
--- geronimo/daytrader/trunk/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/TradeAction.java (original)
+++ geronimo/daytrader/trunk/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/TradeAction.java Mon Aug 31 20:43:03 2009
@@ -21,8 +21,9 @@
 
 import javax.naming.InitialContext;
 
+import org.apache.geronimo.samples.daytrader.direct.TradeJDBCDirect;
 import org.apache.geronimo.samples.daytrader.direct.TradeJEEDirect;
-import org.apache.geronimo.samples.daytrader.direct.TradeWebDirect;
+import org.apache.geronimo.samples.daytrader.direct.TradeJPADirect;
 //import org.apache.geronimo.samples.daytrader.ejb3.TradeSLSBRemote;
 //import org.apache.geronimo.samples.daytrader.ejb3.DirectSLSBRemote;
 import org.apache.geronimo.samples.daytrader.util.Log;
@@ -106,17 +107,25 @@
                 Log.error("TradeAction:TradeAction() Creation of Trade JDBC Direct failed\n" + e);
                 re = new RuntimeException(e);
             }
+        } else if (TradeConfig.runTimeMode == TradeConfig.JDBC) {
+            try {
+                trade = new TradeJDBCDirect();
+            }
+            catch (Exception e) {
+                Log.error("TradeAction:TradeAction() Creation of TradeJDBCDirect failed\n" + e);
+                re = new RuntimeException(e);
+            }
         } else if (TradeConfig.runTimeMode == TradeConfig.JPA) {
             try {
-                trade = new TradeWebDirect();
+                trade = new TradeJPADirect();
             }
             catch (Exception e) {
-                Log.error("TradeAction:TradeAction() Creation of Trade JPA Direct failed\n" + e);
+                Log.error("TradeAction:TradeAction() Creation of TradeJPADirect failed\n" + e);
                 re = new RuntimeException(e);
             }
         } else {
             Log.error("TradeAction:TradeAction() Unknown Trade runtime mode.");
-            re = new RuntimeException("TradeAction:TradeAction() Unknown Trade runtime mode.");
+            re = new IllegalArgumentException("TradeAction:TradeAction() Unknown runTimeMode=" + TradeConfig.runTimeMode);
         }
         
         if (re != null) {

Modified: geronimo/daytrader/trunk/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/direct/TradeJDBCDirect.java
URL: http://svn.apache.org/viewvc/geronimo/daytrader/trunk/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/direct/TradeJDBCDirect.java?rev=809735&r1=809734&r2=809735&view=diff
==============================================================================
--- geronimo/daytrader/trunk/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/direct/TradeJDBCDirect.java (original)
+++ geronimo/daytrader/trunk/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/direct/TradeJDBCDirect.java Mon Aug 31 20:43:03 2009
@@ -1180,7 +1180,10 @@
 
     private void publishQuotePriceChange(QuoteDataBean quoteData, BigDecimal oldPrice, BigDecimal changeFactor,
         double sharesTraded) throws Exception {
-        throw new RuntimeException("publishQuotePriceChange() is not implemented for this runtime mode");
+        if (!TradeConfig.getPublishQuotePriceChange())
+            return;
+        Log.error("TradeJDBCDirect:publishQuotePriceChange - is not implemented for this runtime mode");
+        throw new UnsupportedOperationException("TradeJDBCDirect:publishQuotePriceChange-  is not implemented for this runtime mode");
     }
 
     /**

Modified: geronimo/daytrader/trunk/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/direct/TradeJPADirect.java
URL: http://svn.apache.org/viewvc/geronimo/daytrader/trunk/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/direct/TradeJPADirect.java?rev=809735&r1=809734&r2=809735&view=diff
==============================================================================
--- geronimo/daytrader/trunk/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/direct/TradeJPADirect.java (original)
+++ geronimo/daytrader/trunk/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/direct/TradeJPADirect.java Mon Aug 31 20:43:03 2009
@@ -16,24 +16,43 @@
  */
 package org.apache.geronimo.samples.daytrader.direct;
 
+import org.apache.geronimo.samples.daytrader.AccountDataBean;
+import org.apache.geronimo.samples.daytrader.AccountProfileDataBean;
+import org.apache.geronimo.samples.daytrader.FinancialUtils;
+import org.apache.geronimo.samples.daytrader.HoldingDataBean;
+import org.apache.geronimo.samples.daytrader.MarketSummaryDataBean;
+import org.apache.geronimo.samples.daytrader.OrderDataBean;
+import org.apache.geronimo.samples.daytrader.QuoteDataBean;
+import org.apache.geronimo.samples.daytrader.RunStatsDataBean;
+import org.apache.geronimo.samples.daytrader.TradeAction;
+import org.apache.geronimo.samples.daytrader.TradeServices;
+import org.apache.geronimo.samples.daytrader.util.Log;
+import org.apache.geronimo.samples.daytrader.util.MDBStats;
+import org.apache.geronimo.samples.daytrader.util.TradeConfig;
+
 import java.math.BigDecimal;
-import java.util.Collection;
+import java.sql.Timestamp;
 import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Iterator;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.Resource;
+//import javax.ejb.*;
+//import javax.jms.*;
+import javax.naming.Context;
 import javax.naming.InitialContext;
-
-import javax.sql.DataSource;
-
-import org.apache.geronimo.samples.daytrader.*;
-import org.apache.geronimo.samples.daytrader.util.*;
-
-import java.rmi.RemoteException;
-import java.sql.Connection;
-import java.sql.DatabaseMetaData;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.sql.Timestamp;
+import javax.naming.NamingException;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.Query;
+import javax.transaction.HeuristicMixedException;
+import javax.transaction.HeuristicRollbackException;
+import javax.transaction.NotSupportedException;
+import javax.transaction.RollbackException;
+import javax.transaction.SystemException;
 
 
 /**
@@ -98,7 +117,7 @@
         
         try {
             if (Log.doTrace())
-                Log.trace("TradeSLSBBean:getMarketSummary -- getting market summary");
+                Log.trace("TradeJPADirect:getMarketSummary -- getting market summary");
 
             // Find Trade Stock Index Quotes (Top 100 quotes)
             // ordered by their change in value
@@ -134,18 +153,18 @@
 
             marketSummaryData = new MarketSummaryDataBean(TSIA, openTSIA, totalVolume, topGainers, topLosers);
         } catch (Exception e) {
-            Log.error("TradeSLSBBean:getMarketSummary", e);
-            throw new EJBException("TradeSLSBBean:getMarketSummary -- error ", e);
+            Log.error("TradeJPADirect:getMarketSummary", e);
+            throw new RuntimeException("TradeJPADirect:getMarketSummary -- error ", e);
         }
         return marketSummaryData;
     }
 
     public OrderDataBean buy(String userID, String symbol, double quantity, int orderProcessingMode) {
-        OrderDataBean order;
+        OrderDataBean order = null;
         BigDecimal total;
         try {
             if (Log.doTrace())
-                Log.trace("TradeSLSBBean:buy", userID, symbol, quantity, orderProcessingMode);
+                Log.trace("TradeJPADirect:buy", userID, symbol, quantity, orderProcessingMode);
 
             AccountProfileDataBean profile = entityManager.find(AccountProfileDataBean.class, userID);
             AccountDataBean account = profile.getAccount();
@@ -166,28 +185,29 @@
             else if (orderProcessingMode == TradeConfig.ASYNCH_2PHASE)
                 queueOrder(order.getOrderID(), true);
         } catch (Exception e) {
-            Log.error("TradeSLSBBean:buy(" + userID + "," + symbol + "," + quantity + ") --> failed", e);
+            Log.error("TradeJPADirect:buy(" + userID + "," + symbol + "," + quantity + ") --> failed", e);
             /* On exception - cancel the order */
             // TODO figure out how to do this with JPA
-            // if (order != null) order.cancel();
-            throw new EJBException(e);
+            if (order != null) order.cancel();
+            // throw new EJBException(e);
+            throw new RuntimeException(e);
         }
         return order;
     }
 
     public OrderDataBean sell(String userID, Integer holdingID, int orderProcessingMode) {
-        OrderDataBean order;
+        OrderDataBean order = null;
         BigDecimal total;
         try {
             if (Log.doTrace())
-                Log.trace("TradeSLSBBean:sell", userID, holdingID, orderProcessingMode);
+                Log.trace("TradeJPADirect:sell", userID, holdingID, orderProcessingMode);
 
             AccountProfileDataBean profile = entityManager.find(AccountProfileDataBean.class, userID);
             AccountDataBean account = profile.getAccount();
             HoldingDataBean holding = entityManager.find(HoldingDataBean.class, holdingID);
             
             if (holding == null) {
-                Log.error("TradeSLSBBean:sell User " + userID + " attempted to sell holding " + holdingID + " which has already been sold");
+                Log.error("TradeJPADirect:sell User " + userID + " attempted to sell holding " + holdingID + " which has already been sold");
                 
                 OrderDataBean orderData = new OrderDataBean();
                 orderData.setOrderStatus("cancelled");
@@ -217,65 +237,36 @@
                 queueOrder(order.getOrderID(), true);
 
         } catch (Exception e) {
-            Log.error("TradeSLSBBean:sell(" + userID + "," + holdingID + ") --> failed", e);
+            Log.error("TradeJPADirect:sell(" + userID + "," + holdingID + ") --> failed", e);
             // TODO figure out JPA cancel
-            // if (order != null) order.cancel();
+            if (order != null) order.cancel();
             // UPDATE - handle all exceptions like:
-            throw new EJBException("TradeSLSBBean:sell(" + userID + "," + holdingID + ")", e);
+            // throw new EJBException("TradeJPADirect:sell(" + userID + "," + holdingID + ")", e);
+            throw new RuntimeException("TradeJPADirect:sell(" + userID + "," + holdingID + ")", e);
         }
         return order;
     }
 
     public void queueOrder(Integer orderID, boolean twoPhase) {
-        if (Log.doTrace())
-            Log.trace("TradeSLSBBean:queueOrder", orderID);
-
-        Connection conn = null;
-        Session sess = null;
-        try {
-            conn = queueConnectionFactory.createConnection();
-            sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-            MessageProducer msgProducer = sess.createProducer(tradeBrokerQueue);
-            TextMessage message = sess.createTextMessage();
-
-            message.setStringProperty("command", "neworder");
-            message.setIntProperty("orderID", orderID);
-            message.setBooleanProperty("twoPhase", twoPhase);
-            message.setText("neworder: orderID=" + orderID + " runtimeMode=EJB twoPhase=" + twoPhase);
-            message.setLongProperty("publishTime", System.currentTimeMillis());
-
-            if (Log.doTrace())
-                Log.trace("TradeSLSBBean:queueOrder Sending message: " + message.getText());
-            msgProducer.send(message);
-        } catch (javax.jms.JMSException e) {
-            throw new EJBException(e.getMessage(), e); // pass the exception back
-        } finally {
-            try {
-                if (conn != null)
-                    conn.close();
-                if (sess != null)
-                    sess.close();
-            } catch (javax.jms.JMSException e) {
-                throw new EJBException(e.getMessage(), e); // pass the exception back
-            }
-        }
+        Log.error("TradeJPADirect:queueOrder() not implemented for this runtime mode");
+        throw new UnsupportedOperationException("TradeJPADirect:queueOrder() not implemented for this runtime mode");
     }
 
     public OrderDataBean completeOrder(Integer orderID, boolean twoPhase)
             throws Exception {
         if (Log.doTrace())
-            Log.trace("TradeSLSBBean:completeOrder", orderID + " twoPhase=" + twoPhase);
+            Log.trace("TradeJPADirect:completeOrder", orderID + " twoPhase=" + twoPhase);
 
         OrderDataBean order = entityManager.find(OrderDataBean.class, orderID);
         order.getQuote();
 
         if (order == null) {
-            Log.error("TradeSLSBBean:completeOrder -- Unable to find Order " + orderID + " FBPK returned " + order);
+            Log.error("TradeJPADirect:completeOrder -- Unable to find Order " + orderID + " FBPK returned " + order);
             return null;
         }
 
         if (order.isCompleted())
-            throw new EJBException("Error: attempt to complete Order that is already completed\n" + order);
+            throw new RuntimeException("Error: attempt to complete Order that is already completed\n" + order);
 
         AccountDataBean account = order.getAccount();
         QuoteDataBean quote = order.getQuote();
@@ -286,7 +277,7 @@
         String userID = account.getProfile().getUserID();
 
         if (Log.doTrace())
-            Log.trace("TradeSLSBBeanInternal:completeOrder--> Completing Order " + order.getOrderID() 
+            Log.trace("TradeJPADirect:completeOrder--> Completing Order " + order.getOrderID() 
                     + "\n\t Order info: " + order
                     + "\n\t Account info: " + account 
                     + "\n\t Quote info: " + quote 
@@ -310,7 +301,7 @@
              * - deposit the Order proceeds to the Account balance
              */
             if (holding == null) {
-                Log.error("TradeSLSBBean:completeOrder -- Unable to sell order " + order.getOrderID() + " holding already sold");
+                Log.error("TradeJPADirect:completeOrder -- Unable to sell order " + order.getOrderID() + " holding already sold");
                 order.cancel();
                 return order;
             } else {
@@ -323,7 +314,7 @@
         order.setCompletionDate(new java.sql.Timestamp(System.currentTimeMillis()));
 
         if (Log.doTrace())
-            Log.trace("TradeSLSBBean:completeOrder--> Completed Order " + order.getOrderID() 
+            Log.trace("TradeJPADirect:completeOrder--> Completed Order " + order.getOrderID() 
                     + "\n\t Order info: " + order
                     + "\n\t Account info: " + account 
                     + "\n\t Quote info: " + quote 
@@ -344,19 +335,19 @@
 
     public void cancelOrder(Integer orderID, boolean twoPhase) {
         if (Log.doTrace())
-            Log.trace("TradeSLSBBean:cancelOrder", orderID + " twoPhase=" + twoPhase);
+            Log.trace("TradeJPADirect:cancelOrder", orderID + " twoPhase=" + twoPhase);
 
         OrderDataBean order = entityManager.find(OrderDataBean.class, orderID);
         order.cancel();
     }
 
     public void orderCompleted(String userID, Integer orderID) {
-        throw new UnsupportedOperationException("TradeSLSBBean:orderCompleted method not supported");
+        throw new UnsupportedOperationException("TradeJPADirect:orderCompleted method not supported");
     }
 
     public Collection<OrderDataBean> getOrders(String userID) {
         if (Log.doTrace())
-            Log.trace("TradeSLSBBean:getOrders", userID);
+            Log.trace("TradeJPADirect:getOrders", userID);
 
         AccountProfileDataBean profile = entityManager.find(AccountProfileDataBean.class, userID);
         AccountDataBean account = profile.getAccount();
@@ -365,7 +356,7 @@
 
     public Collection<OrderDataBean> getClosedOrders(String userID) {
         if (Log.doTrace())
-            Log.trace("TradeSLSBBean:getClosedOrders", userID);
+            Log.trace("TradeJPADirect:getClosedOrders", userID);
 
         try {
 
@@ -382,39 +373,40 @@
                 thisOrder.getQuote();
             }
             
-            /* Add logic to do update orders operation, because JBoss5' Hibernate 3.3.1GA DB2Dialect 
-             * and MySQL5Dialect do not work with annotated query "orderejb.completeClosedOrders"
-             * defined in OrderDatabean 
-             */
             if (TradeConfig.jpaLayer == TradeConfig.OPENJPA) {
                 Query updateStatus = entityManager.createNamedQuery("orderejb.completeClosedOrders");
                 updateStatus.setParameter("userID", userID);
                 updateStatus.executeUpdate();
-                }
-                
-            if (TradeConfig.jpaLayer == TradeConfig.HIBERNATE) {
+            } else if (TradeConfig.jpaLayer == TradeConfig.HIBERNATE) {
+                /* Add logic to do update orders operation, because JBoss5' Hibernate 3.3.1GA DB2Dialect 
+                 * and MySQL5Dialect do not work with annotated query "orderejb.completeClosedOrders"
+                 * defined in OrderDatabean 
+                 */
                 Query findaccountid = entityManager.createNativeQuery("select "+
-                                                                          "a.ACCOUNTID, "+
-                                                                          "a.LOGINCOUNT, "+
-                                                                          "a.LOGOUTCOUNT, "+
-                                                                          "a.LASTLOGIN, "+
-                                                                          "a.CREATIONDATE, "+
-                                                                          "a.BALANCE, "+
-                                                                          "a.OPENBALANCE, "+
-                                                                          "a.PROFILE_USERID "+
-                                                                          "from accountejb a where a.profile_userid = ?", org.apache.geronimo.samples.daytrader.AccountDataBean.class);
+                    "a.ACCOUNTID, "+
+                    "a.LOGINCOUNT, "+
+                    "a.LOGOUTCOUNT, "+
+                    "a.LASTLOGIN, "+
+                    "a.CREATIONDATE, "+
+                    "a.BALANCE, "+
+                    "a.OPENBALANCE, "+
+                    "a.PROFILE_USERID "+
+                    "from accountejb a where a.profile_userid = ?",
+                    org.apache.geronimo.samples.daytrader.AccountDataBean.class);
                 findaccountid.setParameter(1, userID);
                 AccountDataBean account = (AccountDataBean)findaccountid.getSingleResult();                
                 Integer accountid = account.getAccountID();
-                Query updateStatus = entityManager.createNativeQuery("UPDATE orderejb o SET o.orderStatus = 'completed' WHERE o.orderStatus = 'closed' AND o.ACCOUNT_ACCOUNTID  = ?");
+                Query updateStatus = entityManager.createNativeQuery(
+                    "UPDATE orderejb o SET o.orderStatus = 'completed' WHERE " +
+                    "o.orderStatus = 'closed' AND o.ACCOUNT_ACCOUNTID  = ?");
                 updateStatus.setParameter(1, accountid.intValue());
                 updateStatus.executeUpdate();
-                }
+            }
                 
             return results;
         } catch (Exception e) {
-            Log.error("TradeSLSBBean.getClosedOrders", e);
-            throw new EJBException("TradeSLSBBean.getClosedOrders - error", e);
+            Log.error("TradeJPADirect.getClosedOrders", e);
+            throw new RuntimeException("TradeJPADirect.getClosedOrders - error", e);
         }
     }
 
@@ -423,24 +415,24 @@
             QuoteDataBean quote = new QuoteDataBean(symbol, companyName, 0, price, price, price, price, 0);
             entityManager.persist(quote);
             if (Log.doTrace())
-                Log.trace("TradeSLSBBean:createQuote-->" + quote);
+                Log.trace("TradeJPADirect:createQuote-->" + quote);
             return quote;
         } catch (Exception e) {
-            Log.error("TradeSLSBBean:createQuote -- exception creating Quote", e);
-            throw new EJBException(e);
+            Log.error("TradeJPADirect:createQuote -- exception creating Quote", e);
+            throw new RuntimeException(e);
         }
     }
 
     public QuoteDataBean getQuote(String symbol) {
         if (Log.doTrace())
-            Log.trace("TradeSLSBBean:getQuote", symbol);
+            Log.trace("TradeJPADirect:getQuote", symbol);
 
         return entityManager.find(QuoteDataBean.class, symbol);
     }
 
     public Collection<QuoteDataBean> getAllQuotes() {
         if (Log.doTrace())
-            Log.trace("TradeSLSBBean:getAllQuotes");
+            Log.trace("TradeJPADirect:getAllQuotes");
 
         Query query = entityManager.createNamedQuery("quoteejb.allQuotes");
         return query.getResultList();
@@ -451,7 +443,7 @@
             return new QuoteDataBean();
 
         if (Log.doTrace())
-            Log.trace("TradeSLSBBean:updateQuote", symbol, changeFactor);
+            Log.trace("TradeJPADirect:updateQuote", symbol, changeFactor);
 
         /* Add logic to determine JPA layer, because JBoss5' Hibernate 3.3.1GA DB2Dialect 
          * and MySQL5Dialect do not work with annotated query "quoteejb.quoteForUpdate"
@@ -490,7 +482,7 @@
 
     public Collection<HoldingDataBean> getHoldings(String userID) {
         if (Log.doTrace())
-            Log.trace("TradeSLSBBean:getHoldings", userID);
+            Log.trace("TradeJPADirect:getHoldings", userID);
 
         Query query = entityManager.createNamedQuery("holdingejb.holdingsByUserID");
         query.setParameter("userID", userID);
@@ -508,13 +500,13 @@
 
     public HoldingDataBean getHolding(Integer holdingID) {
         if (Log.doTrace())
-            Log.trace("TradeSLSBBean:getHolding", holdingID);
+            Log.trace("TradeJPADirect:getHolding", holdingID);
         return entityManager.find(HoldingDataBean.class, holdingID);
     }
 
     public AccountDataBean getAccountData(String userID) {
         if (Log.doTrace())
-            Log.trace("TradeSLSBBean:getAccountData", userID);
+            Log.trace("TradeJPADirect:getAccountData", userID);
 
         AccountProfileDataBean profile = entityManager.find(AccountProfileDataBean.class, userID);
         /*
@@ -530,14 +522,14 @@
 
     public AccountProfileDataBean getAccountProfileData(String userID) {
         if (Log.doTrace())
-            Log.trace("TradeSLSBBean:getProfileData", userID);
+            Log.trace("TradeJPADirect:getProfileData", userID);
 
         return entityManager.find(AccountProfileDataBean.class, userID);
     }
 
     public AccountProfileDataBean updateAccountProfile(AccountProfileDataBean profileData) {
         if (Log.doTrace())
-            Log.trace("TradeSLSBBean:updateAccountProfileData", profileData);
+            Log.trace("TradeJPADirect:updateAccountProfileData", profileData);
         /*
          * // Retreive the pevious account profile in order to get account
          * data... hook it into new object AccountProfileDataBean temp =
@@ -568,23 +560,23 @@
         AccountProfileDataBean profile = entityManager.find(AccountProfileDataBean.class, userID);
 
         if (profile == null) {
-            throw new EJBException("No such user: " + userID);
+            throw new RuntimeException("No such user: " + userID);
         }
         entityManager.merge(profile);
         AccountDataBean account = profile.getAccount();
 
         if (Log.doTrace())
-            Log.trace("TradeSLSBBean:login", userID, password);
+            Log.trace("TradeJPADirect:login", userID, password);
         account.login(password);
         if (Log.doTrace())
-            Log.trace("TradeSLSBBean:login(" + userID + "," + password + ") success" + account);
+            Log.trace("TradeJPADirect:login(" + userID + "," + password + ") success" + account);
 
         return account;
     }
 
     public void logout(String userID) {
         if (Log.doTrace())
-            Log.trace("TradeSLSBBean:logout", userID);
+            Log.trace("TradeJPADirect:logout", userID);
 
         AccountProfileDataBean profile = entityManager.find(AccountProfileDataBean.class, userID);
         AccountDataBean account = profile.getAccount();
@@ -592,7 +584,7 @@
         account.logout();
         
         if (Log.doTrace())
-            Log.trace("TradeSLSBBean:logout(" + userID + ") success");
+            Log.trace("TradeJPADirect:logout(" + userID + ") success");
     }
 
     public AccountDataBean register(String userID, String password, String fullname, String address, String email, String creditcard, BigDecimal openBalance) {
@@ -600,7 +592,7 @@
         AccountProfileDataBean profile = null;
         
         if (Log.doTrace())
-            Log.trace("TradeSLSBBean:register", userID, password, fullname, address, email, creditcard, openBalance);
+            Log.trace("TradeJPADirect:register", userID, password, fullname, address, email, creditcard, openBalance);
 
         // Check to see if a profile with the desired userID already exists
         profile = entityManager.find(AccountProfileDataBean.class, userID);
@@ -622,77 +614,39 @@
         return account;
     }
 
-    @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
+    //@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
     public RunStatsDataBean resetTrade(boolean deleteAll) throws Exception {
         if (Log.doTrace())
-            Log.trace("TradeSLSBBean:resetTrade", deleteAll);
+            Log.trace("TradeJPADirect:resetTrade", deleteAll);
 
-        return new org.apache.geronimo.samples.daytrader.direct.TradeJEEDirect(false).resetTrade(deleteAll);
+        return new org.apache.geronimo.samples.daytrader.direct.TradeJDBCDirect(false).resetTrade(deleteAll);
     }
 
-    private void publishQuotePriceChange(QuoteDataBean quote, BigDecimal oldPrice, BigDecimal changeFactor, double sharesTraded) {
+    private void publishQuotePriceChange(QuoteDataBean quote, BigDecimal oldPrice, BigDecimal changeFactor,
+            double sharesTraded) {
         if (!TradeConfig.getPublishQuotePriceChange())
             return;
-        if (Log.doTrace())
-            Log.trace("TradeSLSBBean:publishQuotePricePublishing -- quoteData = " + quote);
-
-        Connection conn = null;
-        Session sess = null;
-
-        try {
-            conn = topicConnectionFactory.createConnection();
-            sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-            MessageProducer msgProducer = sess.createProducer(tradeStreamerTopic);
-            TextMessage message = sess.createTextMessage();
-
-            String command = "updateQuote";
-            message.setStringProperty("command", command);
-            message.setStringProperty("symbol", quote.getSymbol());
-            message.setStringProperty("company", quote.getCompanyName());
-            message.setStringProperty("price", quote.getPrice().toString());
-            message.setStringProperty("oldPrice", oldPrice.toString());
-            message.setStringProperty("open", quote.getOpen().toString());
-            message.setStringProperty("low", quote.getLow().toString());
-            message.setStringProperty("high", quote.getHigh().toString());
-            message.setDoubleProperty("volume", quote.getVolume());
-
-            message.setStringProperty("changeFactor", changeFactor.toString());
-            message.setDoubleProperty("sharesTraded", sharesTraded);
-            message.setLongProperty("publishTime", System.currentTimeMillis());
-            message.setText("Update Stock price for " + quote.getSymbol() + " old price = " + oldPrice + " new price = " + quote.getPrice());
-
-            msgProducer.send(message);
-        } catch (Exception e) {
-            throw new EJBException(e.getMessage(), e); // pass the exception back
-        } finally {
-            try {
-                if (conn != null)
-                    conn.close();
-                if (sess != null)
-                    sess.close();
-            } catch (javax.jms.JMSException e) {
-                throw new EJBException(e.getMessage(), e); // pass the exception back
-            }
-        }
+        Log.error("TradeJPADirect:publishQuotePriceChange - is not implemented for this runtime mode");
+        throw new UnsupportedOperationException("TradeJPADirect:publishQuotePriceChange - is not implemented for this runtime mode");
     }
 
-    private OrderDataBean createOrder(AccountDataBean account, QuoteDataBean quote, HoldingDataBean holding, String orderType, double quantity) {
-
+    private OrderDataBean createOrder(AccountDataBean account, QuoteDataBean quote, HoldingDataBean holding,
+            String orderType, double quantity) {
         OrderDataBean order;
-
         if (Log.doTrace())
-            Log.trace("TradeSLSBBean:createOrder(orderID=" 
+            Log.trace("TradeJPADirect:createOrder(orderID=" 
                     + " account=" + ((account == null) ? null : account.getAccountID()) 
                     + " quote=" + ((quote == null) ? null : quote.getSymbol()) 
                     + " orderType=" + orderType 
                     + " quantity=" + quantity);
         try {
-            order = new OrderDataBean(orderType, "open", new Timestamp(System.currentTimeMillis()), null, quantity, quote.getPrice().setScale(FinancialUtils.SCALE, FinancialUtils.ROUND), 
-                    TradeConfig.getOrderFee(orderType), account, quote, holding);
+            order = new OrderDataBean(orderType, "open", new Timestamp(System.currentTimeMillis()), null,
+                quantity, quote.getPrice().setScale(FinancialUtils.SCALE, FinancialUtils.ROUND), 
+                TradeConfig.getOrderFee(orderType), account, quote, holding);
             entityManager.persist(order);
         } catch (Exception e) {
-            Log.error("TradeSLSBBean:createOrder -- failed to create Order", e);
-            throw new EJBException("TradeSLSBBean:createOrder -- failed to create Order", e);
+            Log.error("TradeJPADirect:createOrder -- failed to create Order", e);
+            throw new RuntimeException("TradeJPADirect:createOrder -- failed to create Order", e);
         }
         return order;
     }
@@ -704,7 +658,7 @@
     }
     
     public double investmentReturn(double investment, double NetValue) throws Exception {
-        if (Log.doTrace()) Log.trace("TradeSLSBBean:investmentReturn");
+        if (Log.doTrace()) Log.trace("TradeJPADirect:investmentReturn");
     
         double diff = NetValue - investment;
         double ir = diff / investment;
@@ -712,44 +666,8 @@
     }
     
     public QuoteDataBean pingTwoPhase(String symbol) throws Exception {
-        try{
-            if (Log.doTrace()) Log.trace("TradeSLSBBean:pingTwoPhase", symbol);
-            QuoteDataBean quoteData=null;
-            Connection conn = null;
-            Session sess = null;        
-            
-            try {
-
-                //Get a Quote and send a JMS message in a 2-phase commit
-                quoteData = entityManager.find(QuoteDataBean.class, symbol);
-
-                conn = queueConnectionFactory.createConnection();                        
-                sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-                MessageProducer msgProducer = sess.createProducer(tradeBrokerQueue);
-                TextMessage message = sess.createTextMessage();
-
-                String command= "ping";
-                message.setStringProperty("command", command);
-                message.setLongProperty("publishTime", System.currentTimeMillis());         
-                message.setText("Ping message for queue java:comp/env/jms/TradeBrokerQueue sent from TradeSLSBBean:pingTwoPhase at " + new java.util.Date());
-
-                msgProducer.send(message);  
-            } 
-            catch (Exception e) {
-                Log.error("TradeSLSBBean:pingTwoPhase -- exception caught",e);
-            }
-
-            finally {
-                if (conn != null)
-                    conn.close();   
-                if (sess != null)
-                    sess.close();
-            }           
-
-            return quoteData;
-        } catch (Exception e){
-            throw new Exception(e.getMessage(),e);
-        }
+        Log.error("TradeJPADirect:pingTwoPhase - is not implemented for this runtime mode");
+        throw new UnsupportedOperationException("TradeJPADirect:pingTwoPhase - is not implemented for this runtime mode");
     }
 
     class quotePriceComparator implements java.util.Comparator {

Modified: geronimo/daytrader/trunk/modules/util/src/main/java/org/apache/geronimo/samples/daytrader/util/TradeConfig.java
URL: http://svn.apache.org/viewvc/geronimo/daytrader/trunk/modules/util/src/main/java/org/apache/geronimo/samples/daytrader/util/TradeConfig.java?rev=809735&r1=809734&r2=809735&view=diff
==============================================================================
--- geronimo/daytrader/trunk/modules/util/src/main/java/org/apache/geronimo/samples/daytrader/util/TradeConfig.java (original)
+++ geronimo/daytrader/trunk/modules/util/src/main/java/org/apache/geronimo/samples/daytrader/util/TradeConfig.java Mon Aug 31 20:43:03 2009
@@ -23,7 +23,7 @@
 
 /**
  * TradeConfig is a JavaBean holding all configuration and runtime parameters for the Trade application
- * TradeConfig sets runtime parameters such as the RunTimeMode (EJB3, DIRECT, SESSION3, JPA)
+ * TradeConfig sets runtime parameters such as the RunTimeMode (EJB3, DIRECT, SESSION3, JDBC, JPA)
  *
  */
 
@@ -32,11 +32,12 @@
 	/* Trade Runtime Configuration Parameters */
 
 	/* Trade Runtime Mode parameters */
-    public static String[] runTimeModeNames = {"Full EJB3", "Direct (JDBC)", "Session (EJB3) To Direct", "Direct (JPA)"};
+    public static String[] runTimeModeNames = {"Full EJB3", "Direct JDBC", "Session (EJB3) To Direct", "Direct JDBC (No TxMgr)", "Direct JPA"};
     public static final int EJB3 = 0;
     public static final int DIRECT = 1;
     public static final int SESSION3 = 2;
-    public static final int JPA = 3;
+    public static final int JDBC = 3;
+    public static final int JPA = 4;
     public static int runTimeMode = DIRECT;
 	
     /* Trade JPA Layer parameters */

Modified: geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeAppServlet.java
URL: http://svn.apache.org/viewvc/geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeAppServlet.java?rev=809735&r1=809734&r2=809735&view=diff
==============================================================================
--- geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeAppServlet.java (original)
+++ geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeAppServlet.java Mon Aug 31 20:43:03 2009
@@ -23,7 +23,7 @@
 import org.apache.geronimo.samples.daytrader.util.*;
 
 import java.io.IOException;
-//import org.apache.geronimo.samples.daytrader.*;
+
 
 /**
  * 
@@ -47,10 +47,15 @@
             TradeConfig.setConfigParam(parm, value);
         }
         try {
-            TradeDirect.init();
+            if (TradeConfig.runTimeMode == TradeConfig.JDBC) {
+                TradeJDBCDirect.init();
+            } else if (TradeConfig.runTimeMode == TradeConfig.JPA) {
+                TradeJPADirect.init();
+            } else {
+                TradeJEEDirect.init();
+            }
         } catch (Exception e) {
-            Log.error(e,
-                    "TradeAppServlet:init -- Error initializing TradeDirect");
+            Log.error(e, "TradeAppServlet:init -- Error initializing TradeDirect");
         }
     }
 

Modified: geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeBuildDB.java
URL: http://svn.apache.org/viewvc/geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeBuildDB.java?rev=809735&r1=809734&r2=809735&view=diff
==============================================================================
--- geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeBuildDB.java (original)
+++ geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeBuildDB.java Mon Aug 31 20:43:03 2009
@@ -24,7 +24,7 @@
 import java.util.ArrayList;
 
 import org.apache.geronimo.samples.daytrader.*;
-import org.apache.geronimo.samples.daytrader.direct.TradeDirect;
+import org.apache.geronimo.samples.daytrader.direct.TradeJEEDirect;
 import org.apache.geronimo.samples.daytrader.util.*;
 
 /**
@@ -63,7 +63,7 @@
 		{	
 			//out.println("<BR>TradeBuildDB: **** warPath= "+warPath+" ****</BR></BODY>");
 			
-			TradeDirect tradeDirect = new TradeDirect();
+			TradeJEEDirect tradeDirect = new TradeJEEDirect();
 			boolean success = false;
 			String dbProductName = null;
 			File ddlFile = null;

Copied: geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeDirectContextListener.java (from r809732, geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeWebContextListener.java)
URL: http://svn.apache.org/viewvc/geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeDirectContextListener.java?p2=geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeDirectContextListener.java&p1=geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeWebContextListener.java&r1=809732&r2=809735&rev=809735&view=diff
==============================================================================
--- geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeWebContextListener.java (original)
+++ geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeDirectContextListener.java Mon Aug 31 20:43:03 2009
@@ -18,26 +18,23 @@
 
 import javax.servlet.*;
 
-import org.apache.geronimo.samples.daytrader.direct.TradeDirect;
+import org.apache.geronimo.samples.daytrader.direct.TradeJEEDirect;
 import org.apache.geronimo.samples.daytrader.util.Log;
 
-public class TradeWebContextListener
+public class TradeDirectContextListener
 	implements ServletContextListener 
 {
 
-	//receieve trade web app startup/shutown events to start(initialized)/stop TradeDirect
+	//receieve trade web app startup/shutown events to start(initialized)/stop TradeJEEDirect
 	public void contextInitialized(ServletContextEvent event)
 	{
-		Log.trace("TradeWebContextListener contextInitialized -- initializing TradeDirect");
-		TradeDirect.init();		
+		Log.trace("TradeDirectContextListener:contextInitialized - initializing TradeJEEDirect");
+		TradeJEEDirect.init();
 	}
 	public void contextDestroyed(ServletContextEvent event)
 	{
-		Log.trace("TradeWebContextListener  contextDestroy calling TradeDirect:destroy()");		
-		TradeDirect.destroy();
+		Log.trace("TradeDirectContextListener:contextDestroyed - calling TradeJEEDirect:destroy()");		
+		TradeJEEDirect.destroy();
 	}
 
-    
-
 }
-

Added: geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeJDBCContextListener.java
URL: http://svn.apache.org/viewvc/geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeJDBCContextListener.java?rev=809735&view=auto
==============================================================================
--- geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeJDBCContextListener.java (added)
+++ geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeJDBCContextListener.java Mon Aug 31 20:43:03 2009
@@ -0,0 +1,40 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.samples.daytrader.web;
+
+import javax.servlet.*;
+
+import org.apache.geronimo.samples.daytrader.direct.TradeJDBCDirect;
+import org.apache.geronimo.samples.daytrader.util.Log;
+
+public class TradeJDBCContextListener
+	implements ServletContextListener 
+{
+
+	//receieve trade web app startup/shutown events to start(initialized)/stop TradeJDBCDirect
+	public void contextInitialized(ServletContextEvent event)
+	{
+		Log.trace("TradeJDBCContextListener:contextInitialized - initializing TradeJDBCDirect");
+		TradeJDBCDirect.init();
+	}
+	public void contextDestroyed(ServletContextEvent event)
+	{
+		Log.trace("TradeJDBCContextListener:contextDestroyed - calling TradeJDBCDirect:destroy()");		
+		TradeJDBCDirect.destroy();
+	}
+
+}

Propchange: geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeJDBCContextListener.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeJPAContextListener.java
URL: http://svn.apache.org/viewvc/geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeJPAContextListener.java?rev=809735&view=auto
==============================================================================
--- geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeJPAContextListener.java (added)
+++ geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeJPAContextListener.java Mon Aug 31 20:43:03 2009
@@ -0,0 +1,40 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.samples.daytrader.web;
+
+import javax.servlet.*;
+
+import org.apache.geronimo.samples.daytrader.direct.TradeJPADirect;
+import org.apache.geronimo.samples.daytrader.util.Log;
+
+public class TradeJPAContextListener
+	implements ServletContextListener 
+{
+
+	//receieve trade web app startup/shutown events to start(initialized)/stop TradeJPADirect
+	public void contextInitialized(ServletContextEvent event)
+	{
+		Log.trace("TradeJPAContextListener:contextInitialized - initializing TradeJPADirect");
+		TradeJPADirect.init();
+	}
+	public void contextDestroyed(ServletContextEvent event)
+	{
+		Log.trace("TradeJPAContextListener:contextDestroyed - calling TradeJPADirect:destroy()");		
+		TradeJPADirect.destroy();
+	}
+
+}

Propchange: geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeJPAContextListener.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/PingJDBCRead.java
URL: http://svn.apache.org/viewvc/geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/PingJDBCRead.java?rev=809735&r1=809734&r2=809735&view=diff
==============================================================================
--- geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/PingJDBCRead.java (original)
+++ geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/PingJDBCRead.java Mon Aug 31 20:43:03 2009
@@ -28,7 +28,7 @@
 /**
  * 
  * PingJDBCReadPrepStmt uses a prepared statement for database read access. 
- * This primative uses {@link org.apache.geronimo.samples.daytrader.direct.TradeDirect} to set the price of a random stock
+ * This primative uses {@link org.apache.geronimo.samples.daytrader.direct.TradeJEEDirect} to set the price of a random stock
  * (generated by {@link org.apache.geronimo.samples.daytrader.Trade_Config}) through the use of prepared statements. 
  * 
  */
@@ -66,7 +66,7 @@
 		try
 			{
 			//TradeJDBC uses prepared statements so I am going to make use of it's code.
-			TradeDirect trade = new TradeDirect();
+			TradeJEEDirect trade = new TradeJEEDirect();
 			symbol = TradeConfig.rndSymbol();
 			
 			QuoteDataBean quoteData = null;

Modified: geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/PingJDBCWrite.java
URL: http://svn.apache.org/viewvc/geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/PingJDBCWrite.java?rev=809735&r1=809734&r2=809735&view=diff
==============================================================================
--- geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/PingJDBCWrite.java (original)
+++ geronimo/daytrader/trunk/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/prims/PingJDBCWrite.java Mon Aug 31 20:43:03 2009
@@ -29,7 +29,7 @@
  * 
  * PingJDBCReadPrepStmt uses a prepared statement
  * for database update. Statement parameters are set dynamically on each request.
- * This primative uses {@link org.apache.geronimo.samples.daytrader.direct.TradeDirect} to set the price of a random stock
+ * This primative uses {@link org.apache.geronimo.samples.daytrader.direct.TradeJEEDirect} to set the price of a random stock
  * (generated by {@link org.apache.geronimo.samples.daytrader.Trade_Config}) through the use of prepared statements.
  * 
  */
@@ -61,7 +61,7 @@
 		newPrice = TradeConfig.getRandomPriceChangeFactor();
 
 		//TradeJDBC makes use of prepared statements so I am going to reuse the existing code.
-		TradeDirect trade = new TradeDirect(); 
+		TradeJEEDirect trade = new TradeJEEDirect(); 
 
 		//update the price of our symbol
 		QuoteDataBean quoteData = null;

Added: geronimo/daytrader/trunk/modules/web/src/main/resources/META-INF/LICENSE
URL: http://svn.apache.org/viewvc/geronimo/daytrader/trunk/modules/web/src/main/resources/META-INF/LICENSE?rev=809735&view=auto
==============================================================================
--- geronimo/daytrader/trunk/modules/web/src/main/resources/META-INF/LICENSE (added)
+++ geronimo/daytrader/trunk/modules/web/src/main/resources/META-INF/LICENSE Mon Aug 31 20:43:03 2009
@@ -0,0 +1,203 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+

Added: geronimo/daytrader/trunk/modules/web/src/main/resources/META-INF/NOTICE
URL: http://svn.apache.org/viewvc/geronimo/daytrader/trunk/modules/web/src/main/resources/META-INF/NOTICE?rev=809735&view=auto
==============================================================================
--- geronimo/daytrader/trunk/modules/web/src/main/resources/META-INF/NOTICE (added)
+++ geronimo/daytrader/trunk/modules/web/src/main/resources/META-INF/NOTICE Mon Aug 31 20:43:03 2009
@@ -0,0 +1,9 @@
+Apache Geronimo 
+Copyright 2003-2009 The Apache Software Foundation
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
+Portions of this software were developed at IBM and donated to the 
+ASF under the Apache 2.0 license.  The former work was referred to 
+as Trade 6.

Added: geronimo/daytrader/trunk/modules/web/src/main/resources/META-INF/daytrader.sql
URL: http://svn.apache.org/viewvc/geronimo/daytrader/trunk/modules/web/src/main/resources/META-INF/daytrader.sql?rev=809735&view=auto
==============================================================================
--- geronimo/daytrader/trunk/modules/web/src/main/resources/META-INF/daytrader.sql (added)
+++ geronimo/daytrader/trunk/modules/web/src/main/resources/META-INF/daytrader.sql Mon Aug 31 20:43:03 2009
@@ -0,0 +1,107 @@
+--
+--  Licensed to the Apache Software Foundation (ASF) under one or more
+--  contributor license agreements.  See the NOTICE file distributed with
+--  this work for additional information regarding copyright ownership.
+--  The ASF licenses this file to You under the Apache License, Version 2.0
+--  (the "License"); you may not use this file except in compliance with
+--  the License.  You may obtain a copy of the License at
+--
+--      http://www.apache.org/licenses/LICENSE-2.0
+--
+--  Unless required by applicable law or agreed to in writing, software
+--  distributed under the License is distributed on an "AS IS" BASIS,
+--  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+--  See the License for the specific language governing permissions and
+--  limitations under the License.
+--
+
+--drop table holdingejb;
+--drop table accountprofileejb;
+--drop table quoteejb;
+--drop table keygenejb;
+--drop table accountejb;
+--drop table orderejb;
+
+create table holdingejb
+  (purchaseprice decimal(10, 2),
+   holdingid integer not null,
+   quantity double not null,
+   purchasedate timestamp,
+   account_accountid integer,
+   quote_symbol varchar(250),
+   optLock integer);
+
+alter table holdingejb
+  add constraint pk_holdingejb primary key (holdingid);
+
+create table accountprofileejb
+  (address varchar(250),
+   passwd varchar(250),
+   userid varchar(250) not null,
+   email varchar(250),
+   creditcard varchar(250),
+   fullname varchar(250),
+   optLock integer);
+
+alter table accountprofileejb
+  add constraint pk_accountprofile2 primary key (userid);
+
+create table quoteejb
+  (low decimal(10, 2),
+   open1 decimal(10, 2),
+   volume double not null,
+   price decimal(10, 2),
+   high decimal(10, 2),
+   companyname varchar(250),
+   symbol varchar(250) not null,
+   change1 double not null,
+   optLock integer);
+
+alter table quoteejb
+  add constraint pk_quoteejb primary key (symbol);
+
+create table keygenejb
+  (keyval integer not null,
+   keyname varchar(250) not null);
+
+alter table keygenejb
+  add constraint pk_keygenejb primary key (keyname);
+
+create table accountejb
+  (creationdate timestamp,
+   openbalance decimal(10, 2),
+   logoutcount integer not null,
+   balance decimal(10, 2),
+   accountid integer not null,
+   lastlogin timestamp,
+   logincount integer not null,
+   PROFILE_USERID VARCHAR(250),
+   optLock integer);
+
+alter table accountejb
+  add constraint pk_accountejb primary key (accountid);
+
+create table orderejb
+  (orderfee decimal(10, 2),
+   completiondate timestamp,
+   ordertype varchar(250),
+   orderstatus varchar(250),
+   price decimal(10, 2),
+   quantity double not null,
+   opendate timestamp,
+   orderid integer not null,
+   account_accountid integer,
+   quote_symbol varchar(250),
+   holding_holdingid integer,
+   optLock integer);
+
+alter table orderejb
+  add constraint pk_orderejb primary key (orderid);
+
+create index profile_userid on accountejb(profile_userid);
+create index account_accountid on holdingejb(account_accountid);
+create index account_accountidt on orderejb(account_accountid);
+create index holding_holdingid on orderejb(holding_holdingid);
+create index orderstatus on orderejb(orderstatus);
+create index ordertype on orderejb(ordertype);
+  

Propchange: geronimo/daytrader/trunk/modules/web/src/main/resources/META-INF/daytrader.sql
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message