geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jb...@apache.org
Subject svn commit: r814863 - in /geronimo/sandbox/jbohn/daytrader-bp: assemblies/ assemblies/javaee/ daytrader-webonly/ modules/ modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/ modules/ear/ modules/ejb3/ modules/entities/ modules/json-p...
Date Mon, 14 Sep 2009 21:25:33 GMT
Author: jbohn
Date: Mon Sep 14 21:25:32 2009
New Revision: 814863

URL: http://svn.apache.org/viewvc?rev=814863&view=rev
Log:
only keep that which is necessary for the web-jbdc assembly

Removed:
    geronimo/sandbox/jbohn/daytrader-bp/assemblies/javaee/
    geronimo/sandbox/jbohn/daytrader-bp/daytrader-webonly/
    geronimo/sandbox/jbohn/daytrader-bp/modules/ear/
    geronimo/sandbox/jbohn/daytrader-bp/modules/ejb3/
    geronimo/sandbox/jbohn/daytrader-bp/modules/entities/
    geronimo/sandbox/jbohn/daytrader-bp/modules/json-proxy/
    geronimo/sandbox/jbohn/daytrader-bp/modules/soap/
    geronimo/sandbox/jbohn/daytrader-bp/modules/streamer/
Modified:
    geronimo/sandbox/jbohn/daytrader-bp/assemblies/pom.xml
    geronimo/sandbox/jbohn/daytrader-bp/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/TradeAction.java
    geronimo/sandbox/jbohn/daytrader-bp/modules/pom.xml
    geronimo/sandbox/jbohn/daytrader-bp/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeAppServlet.java
    geronimo/sandbox/jbohn/daytrader-bp/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeServletAction.java

Modified: geronimo/sandbox/jbohn/daytrader-bp/assemblies/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/jbohn/daytrader-bp/assemblies/pom.xml?rev=814863&r1=814862&r2=814863&view=diff
==============================================================================
--- geronimo/sandbox/jbohn/daytrader-bp/assemblies/pom.xml (original)
+++ geronimo/sandbox/jbohn/daytrader-bp/assemblies/pom.xml Mon Sep 14 21:25:32 2009
@@ -31,7 +31,6 @@
     <packaging>pom</packaging>
 
     <modules>
-        <!--<module>javaee</module>-->
         <module>web</module>
     </modules>
 

Modified: geronimo/sandbox/jbohn/daytrader-bp/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/TradeAction.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/jbohn/daytrader-bp/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/TradeAction.java?rev=814863&r1=814862&r2=814863&view=diff
==============================================================================
--- geronimo/sandbox/jbohn/daytrader-bp/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/TradeAction.java
(original)
+++ geronimo/sandbox/jbohn/daytrader-bp/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/TradeAction.java
Mon Sep 14 21:25:32 2009
@@ -27,12 +27,8 @@
 import org.apache.geronimo.samples.daytrader.beans.OrderDataBean;
 import org.apache.geronimo.samples.daytrader.beans.QuoteDataBean;
 import org.apache.geronimo.samples.daytrader.core.direct.TradeJDBCDirect;
-//import org.apache.geronimo.samples.daytrader.core.direct.TradeJEEDirect;
-//import org.apache.geronimo.samples.daytrader.core.direct.TradeJPADirect;
 import org.apache.geronimo.samples.daytrader.core.MarketSummaryDataBean;
 import org.apache.geronimo.samples.daytrader.core.RunStatsDataBean;
-//import org.apache.geronimo.samples.daytrader.ejb3.TradeSLSBRemote;
-//import org.apache.geronimo.samples.daytrader.ejb3.DirectSLSBRemote;
 import org.apache.geronimo.samples.daytrader.util.Log;
 import org.apache.geronimo.samples.daytrader.util.TradeConfig;
 
@@ -51,7 +47,6 @@
     private static MarketSummaryDataBean cachedMSDB = MarketSummaryDataBean.getRandomInstance();
     
     // make this static so the trade impl can be cached
-    // - ejb3 mode is the only thing that really uses this
     // - can go back and update other modes to take advantage (ie. TradeDirect)
     private static TradeServices trade = null;
 
@@ -70,51 +65,7 @@
     private void createTrade() {
         RuntimeException re = null;
         
-        if (TradeConfig.runTimeMode == TradeConfig.EJB3) {
-            try {
-                Class c = Class.forName("org.apache.geronimo.samples.daytrader.ejb3.TradeSLSBRemote");
-                if ((trade == null) ||
-                    (!(trade.getClass().isAssignableFrom(c)))) {
-                    InitialContext context = new InitialContext();
-                    try {
-                        trade = (TradeServices) context.lookup("java:comp/env/ejb/TradeSLSBBean");
               
-                    } catch (Exception ex) {
-                        Log.error("TradeAction:createTrade - Lookup of TradeSLSBRemote failed!!!");
-                        trade = (TradeServices) context.lookup("TradeSLSBBean");
-                    }
-                }
-            }
-            catch (Exception e) {
-                Log.error("TradeAction:TradeAction() Creation of Trade EJB 3 failed\n" +
e);
-                re = new RuntimeException(e);
-            }
-        } else if (TradeConfig.runTimeMode == TradeConfig.SESSION3) {
-            try {
-                Class c = Class.forName("org.apache.geronimo.samples.daytrader.ejb3.DirectSLSBBean");
-                if ((trade == null) ||
-                    (!(trade.getClass().isAssignableFrom(c)))) {
-                    InitialContext context = new InitialContext();
-                    try {
-                        trade = (TradeServices) context.lookup("java:comp/env/ejb/DirectSLSBBean");
               
-                    } catch (Exception ex) {
-                        Log.error("TradeAction:createTrade - Lookup of DirectSLSBRemote failed!!!");
-                        trade = (TradeServices) context.lookup("DirectSLSBBean");
-                    }
-                }
-            }
-            catch (Exception e) {
-                Log.error("TradeAction:TradeAction() Creation of Trade SESSION3 failed\n"
+ e);
-                re = new RuntimeException(e);
-            }
-//      } else if (TradeConfig.runTimeMode == TradeConfig.DIRECT) {
-//          try {
-//              trade = new TradeJEEDirect();
-//          }
-//          catch (Exception e) {
-//              Log.error("TradeAction:TradeAction() Creation of Trade JDBC Direct failed\n"
+ e);
-//              re = new RuntimeException(e);
-//          }
-        } else if (TradeConfig.runTimeMode == TradeConfig.JDBC) {
+        if (TradeConfig.runTimeMode == TradeConfig.JDBC) {
             try {
                 trade = new TradeJDBCDirect();
             }
@@ -122,14 +73,6 @@
                 Log.error("TradeAction:TradeAction() Creation of TradeJDBCDirect failed\n"
+ e);
                 re = new RuntimeException(e);
             }
-//      } else if (TradeConfig.runTimeMode == TradeConfig.JPA) {
-//          try {
-//              trade = new TradeJPADirect();
-//          }
-//          catch (Exception 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 IllegalArgumentException("TradeAction:TradeAction() Unknown runTimeMode="
+ TradeConfig.runTimeMode);

Modified: geronimo/sandbox/jbohn/daytrader-bp/modules/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/jbohn/daytrader-bp/modules/pom.xml?rev=814863&r1=814862&r2=814863&view=diff
==============================================================================
--- geronimo/sandbox/jbohn/daytrader-bp/modules/pom.xml (original)
+++ geronimo/sandbox/jbohn/daytrader-bp/modules/pom.xml Mon Sep 14 21:25:32 2009
@@ -33,14 +33,8 @@
     <modules>
         <module>util</module>
         <module>beans</module>
-        <!--<module>entities</module>-->
         <module>core</module>
-        <!--<module>ejb3</module>-->
-        <!--<module>wsappclient</module>-->
-        <!--<module>soap</module>-->
         <module>web</module>
-        <!--<module>streamer</module>-->
-        <!--<module>json-proxy</module>-->
     </modules>
 
 </project>

Modified: geronimo/sandbox/jbohn/daytrader-bp/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeAppServlet.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/jbohn/daytrader-bp/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeAppServlet.java?rev=814863&r1=814862&r2=814863&view=diff
==============================================================================
--- geronimo/sandbox/jbohn/daytrader-bp/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeAppServlet.java
(original)
+++ geronimo/sandbox/jbohn/daytrader-bp/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeAppServlet.java
Mon Sep 14 21:25:32 2009
@@ -49,10 +49,6 @@
         try {
             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");

Modified: geronimo/sandbox/jbohn/daytrader-bp/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeServletAction.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/jbohn/daytrader-bp/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeServletAction.java?rev=814863&r1=814862&r2=814863&view=diff
==============================================================================
--- geronimo/sandbox/jbohn/daytrader-bp/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeServletAction.java
(original)
+++ geronimo/sandbox/jbohn/daytrader-bp/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeServletAction.java
Mon Sep 14 21:25:32 2009
@@ -22,7 +22,6 @@
 
 import org.apache.geronimo.samples.daytrader.core.*;
 import org.apache.geronimo.samples.daytrader.beans.*;
-//import org.apache.geronimo.samples.daytrader.soap.*;
 import org.apache.geronimo.samples.daytrader.util.*;
 
 import java.io.IOException;
@@ -46,15 +45,7 @@
     private TradeServices tAction = null;
 
     TradeServletAction() {
-        if (TradeConfig.getAccessMode() == TradeConfig.STANDARD) {
-            tAction = new TradeAction();
-//      } else if (TradeConfig.getAccessMode() == TradeConfig.WEBSERVICES) {
-//          tAction = new TradeWebSoapProxy();
-//      } else {
-//          throw new IllegalArgumentException(
-//              "TradeServletAction - Uknown TradeConfig accessMode=" +
-//              TradeConfig.getAccessMode());
-        }
+        tAction = new TradeAction();
     }
 
     /**
@@ -104,11 +95,9 @@
                     .getPage(TradeConfig.HOME_PAGE));
             // log the exception with an error level of 3 which means, handled
             // exception but would invalidate a automation run
-            Log
-                    .error(
-                            "TradeServletAction.doAccount(...)",
-                            "illegal argument, information should be in exception string",
-                            e);
+            Log.error("TradeServletAction.doAccount(...)",
+                      "illegal argument, information should be in exception string",
+                      e);
         } catch (Exception e) {
             // log the exception with error page
             throw new ServletException("TradeServletAction.doAccount(...)"
@@ -176,26 +165,17 @@
                 results = "Account profile update successful";
             }
 
-        } catch (java.lang.IllegalArgumentException e) { // this is a user
-                                                            // error so I will
-            // forward them to another page rather than throw a 500
-            req
-                    .setAttribute(
-                            "results",
-                            results
-                                    + "invalid argument, check userID is correct, and the
database is populated"
-                                    + userID);
-            Log
-                    .error(
-                            e,
-                            "TradeServletAction.doAccount(...)",
-                            "illegal argument, information should be in exception string",
-                            "treating this as a user error and forwarding on to a new page");
+        } catch (java.lang.IllegalArgumentException e) { 
+            // this is a user error so I will forward them to another page rather than throw
a 500
+            req.setAttribute("results",
+                             results + "invalid argument, check userID is correct, and the
database is populated" + userID);
+            Log.error(e,
+                      "TradeServletAction.doAccount(...)",
+                      "illegal argument, information should be in exception string",
+                      "treating this as a user error and forwarding on to a new page");
         } catch (Exception e) {
             // log the exception with error page
-            throw new ServletException(
-                    "TradeServletAction.doAccountUpdate(...)"
-                            + " exception user =" + userID, e);
+            throw new ServletException("TradeServletAction.doAccountUpdate(...)" + " exception
user =" + userID, e);
         }
         doAccount(ctx, req, resp, userID, results);
     }
@@ -296,72 +276,21 @@
 
             req.setAttribute("accountData", accountData);
             req.setAttribute("holdingDataBeans", holdingDataBeans);
-            // See Edge Caching above
-            // req.setAttribute("marketSummaryData", marketSummaryData);
+            // See Edge Caching above req.setAttribute("marketSummaryData", marketSummaryData);
             req.setAttribute("results", results);
         } catch (java.lang.IllegalArgumentException e) { 
-            // this is a user error so I will
-            // forward them to another page rather than throw a 500
-            req.setAttribute("results", results + "check userID = " + userID
-                + " and that the database is populated");
-            requestDispatch(ctx, req, resp, userID, TradeConfig
-                .getPage(TradeConfig.HOME_PAGE));
-            // log the exception with an error level of 3 which means, handled
-            // exception but would invalidate a automation run
+            // this is a user error so I will forward them to another page rather than throw
a 500
+            req.setAttribute("results", results + "check userID = " + userID + " and that
the database is populated");
+            requestDispatch(ctx, req, resp, userID, TradeConfig.getPage(TradeConfig.HOME_PAGE));
+            // log the exception with an error level of 3 which means, handled exception
but would invalidate a automation run
             Log.error("TradeServletAction.doHome(...)"
-                + "illegal argument, information should be in exception string"
-                + "treating this as a user error and forwarding on to a new page",
-                e);
-        // } catch (javax.ejb.FinderException e) {
-            // moved to below
+                      + "illegal argument, information should be in exception string"
+                      + "treating this as a user error and forwarding on to a new page",
+                      e);
         } catch (Exception e) {
             boolean javaee = false;
-            // since we will not have the EJB Spec for non-JavaEE containers,
-            // lets try to handle the expected exception logic, where for
-            // JavaEE we should catch a javax.ejb.FinderException while
-            // for non-JavaEE we should catch a RuntimeException
-//          try {
-//              Class c = Class.forName("javax.ejb.FinderException");
-//              javaee = true;
-//              if ((c != null) && (e instanceof javax.ejb.FinderException)) { //
JavaEE container
-                    // this is a user error so I will
-                    // forward them to another page rather than throw a 500
-//                  req.setAttribute("results", results
-//                      + "\nCould not find account for + " + userID);
-                    // requestDispatch(ctx, req, resp,
-                    // TradeConfig.getPage(TradeConfig.HOME_PAGE));
-                    // log the exception with an error level of 3 which means, handled
-                    // exception but would invalidate a automation run
-//                  Log.error("TradeServletAction.doHome(...)"
-//                      + "Error finding account for user "
-//                      + userID
-//                      + "treating this as a user error and forwarding on to a new page",
-//                      e);
-//              }
-//          } catch (ClassNotFoundException cnne) {
-                // ignore, for the non-JavaEE web-only assemblies
-//          }
-//          
-//          if (!javaee && (e instanceof RuntimeException)) {   // non-JavaEE container
-                // this is a user error so I will
-                // forward them to another page rather than throw a 500
-//              req.setAttribute("results", results
-//                  + "\nCould not find account for + " + userID);
-                // requestDispatch(ctx, req, resp,
-                // TradeConfig.getPage(TradeConfig.HOME_PAGE));
-                // log the exception with an error level of 3 which means, handled
-                // exception but would invalidate a automation run
-//              Log.error("TradeServletAction.doHome(...)"
-//                  + "Error finding account for user "
-//                  + userID
-//                  + "treating this as a user error and forwarding on to a new page",
-//                  e);                
-//          } else {
-//              // log the exception with error page
-                throw new ServletException("TradeServletAction.doHome(...)"
-                    + " exception user =" + userID, e);
-            }
-//      }
+            throw new ServletException("TradeServletAction.doHome(...)" + " exception user
=" + userID, e);
+        }
 
         requestDispatch(ctx, req, resp, userID, TradeConfig
                 .getPage(TradeConfig.HOME_PAGE));



Mime
View raw message