geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jb...@apache.org
Subject svn commit: r821151 - in /geronimo/sandbox/jbohn/daytrader-bp: assemblies/web/daytrader-web-jdbc/src/main/webapp/ modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/ modules/core/src/main/java/org/apache/geronimo/samples/daytrader/co...
Date Fri, 02 Oct 2009 20:12:21 GMT
Author: jbohn
Date: Fri Oct  2 20:12:21 2009
New Revision: 821151

URL: http://svn.apache.org/viewvc?rev=821151&view=rev
Log:
add TradeDBServices management and ensure all access to TradeServices and TradeDBServices
is via the TradeServicesManager

Modified:
    geronimo/sandbox/jbohn/daytrader-bp/assemblies/web/daytrader-web-jdbc/src/main/webapp/displayQuote.jsp
    geronimo/sandbox/jbohn/daytrader-bp/assemblies/web/daytrader-web-jdbc/src/main/webapp/marketSummary.jsp
    geronimo/sandbox/jbohn/daytrader-bp/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/TradeServicesManager.java
    geronimo/sandbox/jbohn/daytrader-bp/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/TradeServicesManagerImpl.java
    geronimo/sandbox/jbohn/daytrader-bp/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/direct/TradeJDBCDirect.java
    geronimo/sandbox/jbohn/daytrader-bp/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/util/TradeServiceUtilities.java
    geronimo/sandbox/jbohn/daytrader-bp/modules/core/src/main/resources/OSGI-INF/blueprint/listener.xml
    geronimo/sandbox/jbohn/daytrader-bp/modules/util/src/main/java/org/apache/geronimo/samples/daytrader/util/ServiceUtilities.java
    geronimo/sandbox/jbohn/daytrader-bp/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/OrdersAlertFilter.java
    geronimo/sandbox/jbohn/daytrader-bp/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TestServlet.java
    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/TradeBuildDB.java
    geronimo/sandbox/jbohn/daytrader-bp/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeConfigServlet.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/web/daytrader-web-jdbc/src/main/webapp/displayQuote.jsp
URL: http://svn.apache.org/viewvc/geronimo/sandbox/jbohn/daytrader-bp/assemblies/web/daytrader-web-jdbc/src/main/webapp/displayQuote.jsp?rev=821151&r1=821150&r2=821151&view=diff
==============================================================================
--- geronimo/sandbox/jbohn/daytrader-bp/assemblies/web/daytrader-web-jdbc/src/main/webapp/displayQuote.jsp
(original)
+++ geronimo/sandbox/jbohn/daytrader-bp/assemblies/web/daytrader-web-jdbc/src/main/webapp/displayQuote.jsp
Fri Oct  2 20:12:21 2009
@@ -19,7 +19,13 @@
 	session="true" isThreadSafe="true" isErrorPage="false"%>
 <% 
     String symbol = request.getParameter("symbol");
-    TradeServices tradeServices = TradeServiceUtilities.getTradeServices();
+    TradeServicesManager tradeServicesManager = null;
+
+    if (tradeServicesManager == null) {
+        tradeServicesManager = TradeServiceUtilities.getTradeServicesManager();
+    }
+    TradeServices tradeServices = tradeServicesManager.getTradeServices();
+
 	try { 
 		QuoteDataBean quoteData = tradeServices.getQuote(symbol);
 

Modified: geronimo/sandbox/jbohn/daytrader-bp/assemblies/web/daytrader-web-jdbc/src/main/webapp/marketSummary.jsp
URL: http://svn.apache.org/viewvc/geronimo/sandbox/jbohn/daytrader-bp/assemblies/web/daytrader-web-jdbc/src/main/webapp/marketSummary.jsp?rev=821151&r1=821150&r2=821151&view=diff
==============================================================================
--- geronimo/sandbox/jbohn/daytrader-bp/assemblies/web/daytrader-web-jdbc/src/main/webapp/marketSummary.jsp
(original)
+++ geronimo/sandbox/jbohn/daytrader-bp/assemblies/web/daytrader-web-jdbc/src/main/webapp/marketSummary.jsp
Fri Oct  2 20:12:21 2009
@@ -19,7 +19,13 @@
 	session="true" isThreadSafe="true" isErrorPage="false"%>
 
 <%
-TradeServices tradeServices = TradeServiceUtilities.getTradeServices();
+TradeServicesManager tradeServicesManager = null;
+
+if (tradeServicesManager == null) {
+    tradeServicesManager = TradeServiceUtilities.getTradeServicesManager();
+}
+TradeServices tradeServices = tradeServicesManager.getTradeServices();
+
 MarketSummaryDataBean marketSummaryData = tradeServices.getMarketSummary();
 %>
 <TABLE border="1" bgcolor="#ffffff" width="100%"

Modified: geronimo/sandbox/jbohn/daytrader-bp/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/TradeServicesManager.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/jbohn/daytrader-bp/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/TradeServicesManager.java?rev=821151&r1=821150&r2=821151&view=diff
==============================================================================
--- geronimo/sandbox/jbohn/daytrader-bp/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/TradeServicesManager.java
(original)
+++ geronimo/sandbox/jbohn/daytrader-bp/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/TradeServicesManager.java
Fri Oct  2 20:12:21 2009
@@ -19,6 +19,7 @@
 import java.util.Set;
 
 import org.apache.geronimo.samples.daytrader.core.TradeServices;
+import org.apache.geronimo.samples.daytrader.core.TradeDBServices;
 
 /**
   * TradeServicesManager interface provides an interface to be
@@ -44,5 +45,21 @@
       */
     public Set getTradeServicesSet();
 
+    /**
+      * Set TradeDBServices reference
+      */
+    public void setTradeDBServices(TradeDBServices tradeDBServices);
+
+    /**
+      * Get the currently selected TradeDBServices
+      */
+
+    public TradeDBServices getTradeDBServices();
+
+    /**
+      * Get the list of TradeDBServices as a set.
+      */
+    public Set getTradeDBServicesSet();
+
 }   
 

Modified: geronimo/sandbox/jbohn/daytrader-bp/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/TradeServicesManagerImpl.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/jbohn/daytrader-bp/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/TradeServicesManagerImpl.java?rev=821151&r1=821150&r2=821151&view=diff
==============================================================================
--- geronimo/sandbox/jbohn/daytrader-bp/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/TradeServicesManagerImpl.java
(original)
+++ geronimo/sandbox/jbohn/daytrader-bp/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/TradeServicesManagerImpl.java
Fri Oct  2 20:12:21 2009
@@ -22,6 +22,7 @@
 import java.util.Set;
 
 import org.apache.geronimo.samples.daytrader.core.TradeServices;
+import org.apache.geronimo.samples.daytrader.core.TradeDBServices;
 
 
 /**
@@ -44,7 +45,9 @@
 public class TradeServicesManagerImpl implements TradeServicesManager {
 
     private Set tradeServicesSet = new HashSet();
+    private Set tradeDBServicesSet = new HashSet();
     private TradeServices tradeServices = null;
+    private TradeDBServices tradeDBServices = null;
     private String test;
 
     /**
@@ -106,6 +109,40 @@
         return tradeServicesSet;
     }
 
+    /**
+      * Set TradeDBServices reference
+      */
+    public void setTradeDBServices(TradeDBServices tradeDBServices)
+    {
+        System.out.println("@JAB TradeServicesManager.setTradeDBServices " + tradeDBServices);
+        tradeDBServicesSet.add(tradeDBServices);
+    }
+
+
+    public TradeDBServices getTradeDBServices()
+    {
+        System.out.println("@JAB TradeServicesManager.getTradeDBServices");
+
+        // @JAB for now just return the first (only) item in the set if present.
+        // Eventually, we need to keep track of the selected TradeDBServices and return that
+        if (tradeDBServices == null) {
+            Iterator it = tradeDBServicesSet.iterator();
+            if (it.hasNext()) {
+              tradeDBServices = (TradeDBServices) it.next();
+            }
+        }
+        return tradeDBServices;
+    }
+
+    /**
+      * Get the list of TradeDBServices as a set.
+      */
+    public Set getTradeDBServicesSet()
+    {
+        System.out.println("@JAB TradeServicesManager.getTradeDBServicesSet " + tradeDBServicesSet.size());
+        return tradeDBServicesSet;
+    }
+
 
     /**
       * Bind a new TradeServices implementation
@@ -125,4 +162,22 @@
         tradeServicesSet.remove(tradeServices);
     }
 
+    /**
+      * Bind a new TradeDBServices implementation
+      */
+    public void bindDBService(TradeDBServices tradeDBServices, Map props)
+    {
+        System.out.println("@JAB TradeServicesManager.bindDBService " + tradeDBServices +
" Properties " + props);
+        tradeDBServicesSet.add(tradeDBServices);
+    }
+
+    /**
+      * Unbind a TradeDBServices implementation
+      */
+    public void unbindDBService(TradeServices tradeDBServices, Map props)
+    {
+        System.out.println("@JAB TradeServicesManager.unbindDBService " + tradeDBServices
+ " Properties " + props);
+        tradeDBServicesSet.remove(tradeDBServices);
+    }
+
 }

Modified: geronimo/sandbox/jbohn/daytrader-bp/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/direct/TradeJDBCDirect.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/jbohn/daytrader-bp/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/direct/TradeJDBCDirect.java?rev=821151&r1=821150&r2=821151&view=diff
==============================================================================
--- geronimo/sandbox/jbohn/daytrader-bp/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/direct/TradeJDBCDirect.java
(original)
+++ geronimo/sandbox/jbohn/daytrader-bp/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/direct/TradeJDBCDirect.java
Fri Oct  2 20:12:21 2009
@@ -70,7 +70,6 @@
      * Zero arg constructor for TradeJDBCDirect
      */
     public TradeJDBCDirect() {
-        System.out.println("@JAB TradeJDBCDirect() ");
         if (initialized == false)
             init();
     }

Modified: geronimo/sandbox/jbohn/daytrader-bp/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/util/TradeServiceUtilities.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/jbohn/daytrader-bp/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/util/TradeServiceUtilities.java?rev=821151&r1=821150&r2=821151&view=diff
==============================================================================
--- geronimo/sandbox/jbohn/daytrader-bp/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/util/TradeServiceUtilities.java
(original)
+++ geronimo/sandbox/jbohn/daytrader-bp/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/util/TradeServiceUtilities.java
Fri Oct  2 20:12:21 2009
@@ -40,7 +40,7 @@
     }
 
     /**
-     * Lookup and return the TradeServices osgi service
+     * Lookup and return the TradeServices osgi service with filter
      * 
      * @return TradeServices
      * 
@@ -60,7 +60,8 @@
     }
 
     /**
-     * Lookup and return the TradeDBServices osgi service
+     * Lookup and return the TradeDBServices osgi service with
+     * filter
      * 
      * @return TradeDBServices
      * 

Modified: geronimo/sandbox/jbohn/daytrader-bp/modules/core/src/main/resources/OSGI-INF/blueprint/listener.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/jbohn/daytrader-bp/modules/core/src/main/resources/OSGI-INF/blueprint/listener.xml?rev=821151&r1=821150&r2=821151&view=diff
==============================================================================
--- geronimo/sandbox/jbohn/daytrader-bp/modules/core/src/main/resources/OSGI-INF/blueprint/listener.xml
(original)
+++ geronimo/sandbox/jbohn/daytrader-bp/modules/core/src/main/resources/OSGI-INF/blueprint/listener.xml
Fri Oct  2 20:12:21 2009
@@ -2,6 +2,7 @@
 
   <bean id="tradeServicesManager" class="org.apache.geronimo.samples.daytrader.core.TradeServicesManagerImpl"
activation="lazy" init-method="init">
       <property name="tradeServices" ref="tradeServicesList"/>
+      <property name="tradeDBServices" ref="tradeDBServicesList"/>
       <property name="test" value="test"/>
   </bean>
   
@@ -15,5 +16,14 @@
       <reference-listener ref="tradeServicesManager" bind-method="bindService" unbind-method="unbindService"
/>
   </ref-list>
 -->
+
+  <reference id="tradeDBServicesList" availability="optional" interface="org.apache.geronimo.samples.daytrader.core.TradeDBServices">
+    <reference-listener ref="tradeServicesManager" bind-method="bindDBService" unbind-method="unbindDBService"/>
+  </reference>
+<!--
+  <ref-list id="tradeDBServicesList" availability="optional" interface="org.apache.geronimo.samples.daytrader.core.TradeDBServices">
+      <reference-listener ref="tradeServicesManager" bind-method="bindDBService" unbind-method="unbindDBService"
/>
+  </ref-list>
+-->
 </blueprint>
 

Modified: geronimo/sandbox/jbohn/daytrader-bp/modules/util/src/main/java/org/apache/geronimo/samples/daytrader/util/ServiceUtilities.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/jbohn/daytrader-bp/modules/util/src/main/java/org/apache/geronimo/samples/daytrader/util/ServiceUtilities.java?rev=821151&r1=821150&r2=821151&view=diff
==============================================================================
--- geronimo/sandbox/jbohn/daytrader-bp/modules/util/src/main/java/org/apache/geronimo/samples/daytrader/util/ServiceUtilities.java
(original)
+++ geronimo/sandbox/jbohn/daytrader-bp/modules/util/src/main/java/org/apache/geronimo/samples/daytrader/util/ServiceUtilities.java
Fri Oct  2 20:12:21 2009
@@ -58,7 +58,6 @@
             InitialContext ic = new InitialContext();
             return ic.lookup(name);
         } catch (NamingException e) {
-            System.out.println("@JAB ServiceUtilities.getOSGIService() exception on lookup
" + e);
             Log.error(e,
                       "ServiceUtilities.getOSGIService(...)",
                       "NamingException on OSGI service lookup");

Modified: geronimo/sandbox/jbohn/daytrader-bp/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/OrdersAlertFilter.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/jbohn/daytrader-bp/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/OrdersAlertFilter.java?rev=821151&r1=821150&r2=821151&view=diff
==============================================================================
--- geronimo/sandbox/jbohn/daytrader-bp/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/OrdersAlertFilter.java
(original)
+++ geronimo/sandbox/jbohn/daytrader-bp/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/OrdersAlertFilter.java
Fri Oct  2 20:12:21 2009
@@ -21,11 +21,14 @@
 import javax.servlet.http.*;
 
 import org.apache.geronimo.samples.daytrader.core.TradeServices;
+import org.apache.geronimo.samples.daytrader.core.TradeServicesManager;
 import org.apache.geronimo.samples.daytrader.core.util.TradeServiceUtilities;
 import org.apache.geronimo.samples.daytrader.util.*;
 
 public class OrdersAlertFilter implements Filter {
 
+    private static TradeServicesManager tradeServicesManager = null;
+
     /**
      * Constructor for CompletedOrdersAlertFilter
      */
@@ -52,6 +55,11 @@
         if (filterConfig == null)
             return;
 
+        if (tradeServicesManager == null) {
+            tradeServicesManager = TradeServiceUtilities.getTradeServicesManager();
+        }
+        TradeServices tradeServices = tradeServicesManager.getTradeServices();
+
         try {
             String action = req.getParameter("action");
             if ( action != null ) {
@@ -64,7 +72,6 @@
                         userID = (String) ((HttpServletRequest) req).getSession().getAttribute("uidBean");
                     if ( (userID != null) && (userID.trim().length()>0) ) {
 
-                        TradeServices tradeServices = TradeServiceUtilities.getTradeServices();
                         java.util.Collection closedOrders = tradeServices.getClosedOrders(userID);
                         if ( (closedOrders!=null) && (closedOrders.size() > 0)
) {
                             req.setAttribute("closedOrders", closedOrders);

Modified: geronimo/sandbox/jbohn/daytrader-bp/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TestServlet.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/jbohn/daytrader-bp/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TestServlet.java?rev=821151&r1=821150&r2=821151&view=diff
==============================================================================
--- geronimo/sandbox/jbohn/daytrader-bp/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TestServlet.java
(original)
+++ geronimo/sandbox/jbohn/daytrader-bp/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TestServlet.java
Fri Oct  2 20:12:21 2009
@@ -19,8 +19,8 @@
 import javax.servlet.*;
 import javax.servlet.http.*;
 
-//import org.apache.geronimo.samples.daytrader.*;
 import org.apache.geronimo.samples.daytrader.core.TradeServices;
+import org.apache.geronimo.samples.daytrader.core.TradeServicesManager;
 import org.apache.geronimo.samples.daytrader.core.util.TradeServiceUtilities;
 import org.apache.geronimo.samples.daytrader.util.*;
 
@@ -29,6 +29,7 @@
 
 public class TestServlet extends HttpServlet {
 
+    private static TradeServicesManager tradeServicesManager = null;
 
 	public void init(ServletConfig config) throws ServletException
 	{
@@ -69,8 +70,11 @@
 	public void performTask(HttpServletRequest req, HttpServletResponse resp)
 		throws ServletException, IOException 
 	{
+            if (tradeServicesManager == null) {
+                tradeServicesManager = TradeServiceUtilities.getTradeServicesManager();
+            }
+            TradeServices tradeServices = tradeServicesManager.getTradeServices();
 		try {
-                    TradeServices tradeServices = TradeServiceUtilities.getTradeServices();
 			Log.debug("Enter TestServlet doGet");
 			TradeConfig.runTimeMode = TradeConfig.DIRECT;
 			for (int i=0; i<10; i++) 

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=821151&r1=821150&r2=821151&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
Fri Oct  2 20:12:21 2009
@@ -37,7 +37,7 @@
 
 public class TradeAppServlet extends HttpServlet {
 
-    private static TradeServices tradeServices = null;
+    private static TradeServicesManager tradeServicesManager = null;
 
     /**
      * Servlet initialization method.
@@ -108,11 +108,10 @@
 
         resp.setContentType("text/html");
 
-        if (tradeServices == null) {
-            System.out.println("@JAB TradeAppServlet.performTask() - about to do a lookup
of TradeServicesManager");
-            TradeServicesManager tradeServicesManager = TradeServiceUtilities.getTradeServicesManager();
-            tradeServices = tradeServicesManager.getTradeServices();
+        if (tradeServicesManager == null) {
+            tradeServicesManager = TradeServiceUtilities.getTradeServicesManager();
         }
+        TradeServices tradeServices = tradeServicesManager.getTradeServices();
 
         TradeServletAction tsAction = new TradeServletAction(tradeServices);
 

Modified: geronimo/sandbox/jbohn/daytrader-bp/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeBuildDB.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/jbohn/daytrader-bp/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeBuildDB.java?rev=821151&r1=821150&r2=821151&view=diff
==============================================================================
--- geronimo/sandbox/jbohn/daytrader-bp/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeBuildDB.java
(original)
+++ geronimo/sandbox/jbohn/daytrader-bp/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeBuildDB.java
Fri Oct  2 20:12:21 2009
@@ -25,6 +25,7 @@
 
 import org.apache.geronimo.samples.daytrader.core.TradeServices;
 import org.apache.geronimo.samples.daytrader.core.TradeDBServices;
+import org.apache.geronimo.samples.daytrader.core.TradeServicesManager;
 import org.apache.geronimo.samples.daytrader.core.util.TradeServiceUtilities;
 import org.apache.geronimo.samples.daytrader.beans.*;
 import org.apache.geronimo.samples.daytrader.util.*;
@@ -42,6 +43,7 @@
 
     private boolean verbose = true;
     private TradeConfig t = new TradeConfig();
+    private static TradeServicesManager tradeServicesManager = null;
 
     /**
      * Populate a Trade DB using standard out as a log
@@ -58,8 +60,11 @@
         throws Exception {
         String symbol, companyName;
         int errorCount = 0; // Give up gracefully after 10 errors
-        TradeServices tradeServices = TradeServiceUtilities.getTradeServices();
-        TradeDBServices tradeDBServices = TradeServiceUtilities.getTradeDBServices();
+        if (tradeServicesManager == null) {
+            tradeServicesManager = TradeServiceUtilities.getTradeServicesManager();
+        }
+        TradeServices tradeServices = tradeServicesManager.getTradeServices();
+        TradeDBServices tradeDBServices = tradeServicesManager.getTradeDBServices();
 
         // TradeStatistics.statisticsEnabled=false; // disable statistics
         out.println("<HEAD><BR><EM> TradeBuildDB: Building DayTrader Database...</EM><BR>"

Modified: geronimo/sandbox/jbohn/daytrader-bp/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeConfigServlet.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/jbohn/daytrader-bp/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeConfigServlet.java?rev=821151&r1=821150&r2=821151&view=diff
==============================================================================
--- geronimo/sandbox/jbohn/daytrader-bp/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeConfigServlet.java
(original)
+++ geronimo/sandbox/jbohn/daytrader-bp/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeConfigServlet.java
Fri Oct  2 20:12:21 2009
@@ -75,7 +75,6 @@
 		TradeConfig currentConfig = new TradeConfig();		
 
                 if (tradeServices == null) {
-                    System.out.println("@JAB TradeConfigServlet.performTask() - about to
do a lookup of TradeServicesManager");
                     TradeServicesManager tradeServicesManager = TradeServiceUtilities.getTradeServicesManager();
                     tradeServices = tradeServicesManager.getTradeServices();
                 }

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=821151&r1=821150&r2=821151&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
Fri Oct  2 20:12:21 2009
@@ -77,7 +77,6 @@
     void doAccount(ServletContext ctx, HttpServletRequest req,
             HttpServletResponse resp, String userID, String results)
             throws javax.servlet.ServletException, java.io.IOException {
-//        TradeServices tradeServices = TradeServiceUtilities.getTradeServices();
         try {
 
             AccountDataBean accountData = tradeServices.getAccountData(userID);
@@ -149,7 +148,6 @@
             String creditcard, String email)
             throws javax.servlet.ServletException, java.io.IOException {
         String results = "";
-//        TradeServices tradeServices = TradeServiceUtilities.getTradeServices();
 
         // First verify input data
         boolean doUpdate = true;
@@ -214,7 +212,6 @@
             String quantity) throws ServletException, IOException {
 
         String results = "";
-//        TradeServices tradeServices = TradeServiceUtilities.getTradeServices();
 
         try {
             OrderDataBean orderData = tradeServices.buy(userID, symbol, new Double(
@@ -269,7 +266,6 @@
         
         BigDecimal balance;
         String result = "";
-//        TradeServices tradeServices = TradeServiceUtilities.getTradeServices();
         
         try {
             AccountDataBean accountData = tradeServices.getAccountData(userID);
@@ -332,7 +328,6 @@
             throws javax.servlet.ServletException, java.io.IOException {
 
         String results = "";
-//        TradeServices tradeServices = TradeServiceUtilities.getTradeServices();
         try {
             // Got a valid userID and passwd, attempt login
 
@@ -407,7 +402,6 @@
             HttpServletResponse resp, String userID) throws ServletException,
             IOException {
         String results = "";
-//        TradeServices tradeServices = TradeServiceUtilities.getTradeServices();
 
         try {
             tradeServices.logout(userID);
@@ -478,7 +472,6 @@
             HttpServletResponse resp, String userID, String results)
             throws ServletException, IOException {
 
-//        TradeServices tradeServices = TradeServiceUtilities.getTradeServices();
         try {
             // Get the holdiings for this user
 
@@ -599,7 +592,6 @@
             String openBalanceString, String email, String address)
             throws ServletException, IOException {
         String results = "";
-//        TradeServices tradeServices = TradeServiceUtilities.getTradeServices();
 
         try {
             // Validate user passwords match and are atleast 1 char in length
@@ -664,7 +656,6 @@
             HttpServletResponse resp, String userID, Integer holdingID)
             throws ServletException, IOException {
         String results = "";
-//        TradeServices tradeServices = TradeServiceUtilities.getTradeServices();
         try {
             OrderDataBean orderData = tradeServices.sell(userID, holdingID,
                     TradeConfig.orderProcessingMode);



Mime
View raw message