geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jb...@apache.org
Subject svn commit: r835963 - in /geronimo/sandbox/jbohn/daytrader-bp-new/modules: core/src/main/java/org/apache/geronimo/samples/daytrader/core/ core/src/main/java/org/apache/geronimo/samples/daytrader/core/spi/ core/src/main/resources/OSGI-INF/blueprint/ per...
Date Fri, 13 Nov 2009 19:30:51 GMT
Author: jbohn
Date: Fri Nov 13 19:30:51 2009
New Revision: 835963

URL: http://svn.apache.org/viewvc?rev=835963&view=rev
Log:
remove TradeDBServices moving methods to TradeServices to simplify

Removed:
    geronimo/sandbox/jbohn/daytrader-bp-new/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/spi/TradeDBServices.java
Modified:
    geronimo/sandbox/jbohn/daytrader-bp-new/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/TradeServicesManagerImpl.java
    geronimo/sandbox/jbohn/daytrader-bp-new/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/spi/TradeServiceUtilities.java
    geronimo/sandbox/jbohn/daytrader-bp-new/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/spi/TradeServices.java
    geronimo/sandbox/jbohn/daytrader-bp-new/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/spi/TradeServicesManager.java
    geronimo/sandbox/jbohn/daytrader-bp-new/modules/core/src/main/resources/OSGI-INF/blueprint/listener.xml
    geronimo/sandbox/jbohn/daytrader-bp-new/modules/persist-jdbc/src/main/java/org/apache/geronimo/samples/daytrader/persist/jdbc/TradeJDBCDirect.java
    geronimo/sandbox/jbohn/daytrader-bp-new/modules/persist-jdbc/src/main/resources/OSGI-INF/blueprint/blueprint.xml
    geronimo/sandbox/jbohn/daytrader-bp-new/modules/persist-jpa/src/main/java/org/apache/geronimo/samples/daytrader/persist/jpa/TradeJPADirect.java
    geronimo/sandbox/jbohn/daytrader-bp-new/modules/persist-jpa/src/main/resources/OSGI-INF/blueprint/blueprint.xml
    geronimo/sandbox/jbohn/daytrader-bp-new/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeBuildDB.java

Modified: geronimo/sandbox/jbohn/daytrader-bp-new/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/TradeServicesManagerImpl.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/jbohn/daytrader-bp-new/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/TradeServicesManagerImpl.java?rev=835963&r1=835962&r2=835963&view=diff
==============================================================================
--- geronimo/sandbox/jbohn/daytrader-bp-new/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/TradeServicesManagerImpl.java
(original)
+++ geronimo/sandbox/jbohn/daytrader-bp-new/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/TradeServicesManagerImpl.java
Fri Nov 13 19:30:51 2009
@@ -24,7 +24,6 @@
 import org.apache.geronimo.samples.daytrader.util.Log;
 import org.apache.geronimo.samples.daytrader.util.TradeConfig;
 import org.apache.geronimo.samples.daytrader.core.spi.MarketSummaryDataBean;
-import org.apache.geronimo.samples.daytrader.core.spi.TradeDBServices;
 import org.apache.geronimo.samples.daytrader.core.spi.TradeServices;
 import org.apache.geronimo.samples.daytrader.core.spi.TradeServicesManager;
 
@@ -49,7 +48,6 @@
 public class TradeServicesManagerImpl implements TradeServicesManager {
 
     private static TradeServices[] tradeServicesList = new TradeServices[TradeConfig.runTimeModeNames.length]
;
-    private static TradeDBServices[] tradeDBServicesList = new TradeDBServices[TradeConfig.runTimeModeNames.length];
     private List tradeList = null;
     private List tradeDBList = null;
 
@@ -106,20 +104,6 @@
     }
 
     /**
-      * Set TradeDBServicesList reference
-      */
-    public void setTradeDBServicesList(List tradeDBList) {
-        if (Log.doTrace())
-            Log.trace("TradeServicesManagerImpl:setTradeDBServicesList()" , tradeDBList);
-        this.tradeDBList = tradeDBList;
-        Iterator it = tradeDBList.iterator();
-        while (it.hasNext()) {  
-            TradeDBServices tradeDBServices =  (TradeDBServices) it.next(); 
-            this.tradeDBServicesList[tradeDBServices.getMode()] = tradeDBServices;
-        }  
-    }
-
-    /**
       * Set TradeServices reference
       */
     public void setTradeServices(TradeServices tradeServices) {
@@ -139,24 +123,6 @@
     }
 
     /**
-      * Set TradeDBServices reference
-      */
-    public void setTradeDBServices(TradeDBServices tradeDBServices) {
-        if (Log.doTrace())
-            Log.trace("TradeServicesManagerImpl:setTradeDBServices()", tradeDBServices);
-        tradeDBServicesList[tradeDBServices.getMode()] = tradeDBServices;
-    }
-
-    /**
-      * Get TradeDBServices reference
-      */
-    public TradeDBServices getTradeDBServices() {
-        if (Log.doTrace())
-            Log.trace("TradeServicesManagerImpl:getTradeDBServices()");
-        return tradeDBServicesList[TradeConfig.runTimeMode];
-    }
-
-    /**
       * Set TradeServicesJPA reference
       */
     public void setTradeServicesJPA(TradeServices tradeServicesJPA) {
@@ -166,16 +132,6 @@
     }
 
     /**
-      * Set TradeDBServicesJPA reference
-      */
-    public void setTradeDBServicesJPA(TradeDBServices tradeDBServicesJPA) {
-        if (Log.doTrace())
-            Log.trace("TradeServicesManagerImpl:setTradeDBServicesJPA()", tradeDBServicesJPA);
-        tradeDBServicesList[tradeDBServicesJPA.getMode()] = tradeDBServicesJPA;
-    }
-
-
-    /**
       * Bind a new TradeServices implementation
       */
     public void bindService(TradeServices tradeServices, Map props) {
@@ -198,28 +154,6 @@
     }
 
     /**
-      * Bind a new TradeDBServices implementation
-      */
-    public void bindDBService(TradeDBServices tradeDBServices, Map props) {
-        if (Log.doTrace())
-            Log.trace("TradeServicesManagerImpl:bindDBService()", tradeDBServices, props);
-        if (tradeDBServices != null) {
-            tradeDBServicesList[tradeDBServices.getMode()] = tradeDBServices;
-        }
-    }
-
-    /**
-      * Unbind a TradeDBServices implementation
-      */
-    public void unbindDBService(TradeServices tradeDBServices, Map props) {
-        if (Log.doTrace())
-            Log.trace("TradeServicesManagerImpl:unbindDBService()", tradeDBServices, props);
-        if (tradeDBServices != null) {
-            tradeDBServicesList[tradeDBServices.getMode()] = null;
-        }
-    }
-
-    /**
      * Market Summary is inherently a heavy database operation.  For servers that have a
caching
      * story this is a great place to cache data that is good for a period of time.  In order
to
      * provide a flexible framework for this we allow the market summary operation to be

Modified: geronimo/sandbox/jbohn/daytrader-bp-new/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/spi/TradeServiceUtilities.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/jbohn/daytrader-bp-new/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/spi/TradeServiceUtilities.java?rev=835963&r1=835962&r2=835963&view=diff
==============================================================================
--- geronimo/sandbox/jbohn/daytrader-bp-new/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/spi/TradeServiceUtilities.java
(original)
+++ geronimo/sandbox/jbohn/daytrader-bp-new/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/spi/TradeServiceUtilities.java
Fri Nov 13 19:30:51 2009
@@ -52,31 +52,6 @@
     }
 
     /**
-     * Lookup and return the TradeDBServices osgi service
-     * 
-     * @return TradeDBServices
-     * 
-     */
-    public static final TradeDBServices getTradeDBServices() {
-        if (Log.doTrace())
-            Log.trace("TradeServiceUtilities:getTradeDBServices()");
-        return getTradeDBServices(null);
-    }
-
-    /**
-     * Lookup and return the TradeDBServices osgi service with
-     * filter
-     * 
-     * @return TradeDBServices
-     * 
-     */
-    public static final TradeDBServices getTradeDBServices(String filter) {
-        if (Log.doTrace())
-            Log.trace("TradeServiceUtilities:getTradeDBServices()", filter);
-        return (TradeDBServices) ServiceUtilities.getOSGIService(TradeDBServices.class.getName(),
filter);
-    }
-
-    /**
      * Lookup and return the TradeServicesManager osgi service
      * 
      * @return TradeServicesManager

Modified: geronimo/sandbox/jbohn/daytrader-bp-new/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/spi/TradeServices.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/jbohn/daytrader-bp-new/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/spi/TradeServices.java?rev=835963&r1=835962&r2=835963&view=diff
==============================================================================
--- geronimo/sandbox/jbohn/daytrader-bp-new/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/spi/TradeServices.java
(original)
+++ geronimo/sandbox/jbohn/daytrader-bp-new/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/spi/TradeServices.java
Fri Nov 13 19:30:51 2009
@@ -279,6 +279,16 @@
 	 */
     public RunStatsDataBean resetTrade(boolean deleteAll) throws Exception, RemoteException;
     
+    /**
+     * TradeBuildDB needs this abstracted method
+     */
+    public String checkDBProductName() throws Exception;
+    
+    /**
+     * TradeBuildDB needs this abstracted method
+     */
+    public boolean recreateDBTables(Object[] sqlBuffer, java.io.PrintWriter out) throws Exception;
+
    /**
     * Get mode - returns the persistence mode
     * (TradeConfig.JDBC, JPA, etc...)

Modified: geronimo/sandbox/jbohn/daytrader-bp-new/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/spi/TradeServicesManager.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/jbohn/daytrader-bp-new/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/spi/TradeServicesManager.java?rev=835963&r1=835962&r2=835963&view=diff
==============================================================================
--- geronimo/sandbox/jbohn/daytrader-bp-new/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/spi/TradeServicesManager.java
(original)
+++ geronimo/sandbox/jbohn/daytrader-bp-new/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/spi/TradeServicesManager.java
Fri Nov 13 19:30:51 2009
@@ -39,37 +39,22 @@
     public void setTradeServicesList(List tradeList);
 
     /**
-      * Set TradeDBServicesList reference
-      */
-    public void setTradeDBServicesList(List tradeDBList);
-
-    /**
       * Set TradeServices reference
       */
     public void setTradeServices(TradeServices tradeServices);
 
     /**
-      * Set TradeDBServices reference
-      */
-    public void setTradeDBServices(TradeDBServices tradeDBServices);
-
-    /**
       * Get the currently selected TradeServices
       */
 
     public TradeServices getTradeServices();
 
     /**
-      * Get the currently selected TradeDBServices
-      */
-    public TradeDBServices getTradeDBServices();
-
-    /**
       * Compute and return a snapshot of the current market
       * conditions.  This includes the TSIA - and index of the prive
       * of the top 100 Trade stock quotes.  Ths openTSIA(the index
       * at the open), The volune of shares traded, Top Stocks gain
-      * and loss.  Get the currently selected TradeDBServices
+      * and loss.  Get the currently selected TradeServices
       * 
       * This is a special version of this function which will cache
       * the results provided by TradeServices.

Modified: geronimo/sandbox/jbohn/daytrader-bp-new/modules/core/src/main/resources/OSGI-INF/blueprint/listener.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/jbohn/daytrader-bp-new/modules/core/src/main/resources/OSGI-INF/blueprint/listener.xml?rev=835963&r1=835962&r2=835963&view=diff
==============================================================================
--- geronimo/sandbox/jbohn/daytrader-bp-new/modules/core/src/main/resources/OSGI-INF/blueprint/listener.xml
(original)
+++ geronimo/sandbox/jbohn/daytrader-bp-new/modules/core/src/main/resources/OSGI-INF/blueprint/listener.xml
Fri Nov 13 19:30:51 2009
@@ -2,11 +2,8 @@
 
   <bean id="tradeServicesManagerBean" class="org.apache.geronimo.samples.daytrader.core.TradeServicesManagerImpl"
activation="lazy" init-method="init">
       <!--<property name="tradeServicesList" ref="tradeServicesList"/>-->
-      <!--<property name="tradeDBServicesList" ref="tradeDBServicesList"/>-->
       <property name="tradeServices" ref="tradeServicesRefJDBC"/>
-      <property name="tradeDBServices" ref="tradeDBServicesRefJDBC"/>
       <property name="tradeServicesJPA" ref="tradeServicesRefJPA"/>
-      <property name="tradeDBServicesJPA" ref="tradeDBServicesRefJPA"/>
   </bean>
   
   <service id="TradeServicesManager" ref="tradeServicesManagerBean" interface="org.apache.geronimo.samples.daytrader.core.spi.TradeServicesManager"/>
@@ -25,18 +22,5 @@
   </ref-list>
 -->
 
-  <reference id="tradeDBServicesRefJDBC" availability="optional" interface="org.apache.geronimo.samples.daytrader.core.spi.TradeDBServices"
filter="(mode=jdbc)">
-    <reference-listener ref="tradeServicesManagerBean" bind-method="bindDBService" unbind-method="unbindDBService"/>
-  </reference>
-
-  <reference id="tradeDBServicesRefJPA" availability="optional" interface="org.apache.geronimo.samples.daytrader.core.spi.TradeDBServices"
filter="(mode=jpa)">
-    <reference-listener ref="tradeServicesManagerBean" bind-method="bindDBService" unbind-method="unbindDBService"/>
-  </reference>
-
-<!--
-  <ref-list id="tradeDBServicesList" availability="optional" interface="org.apache.geronimo.samples.daytrader.core.spi.TradeDBServices">
-      <reference-listener ref="tradeServicesManagerBean" bind-method="bindDBService" unbind-method="unbindDBService"
/>
-  </ref-list>
--->
 </blueprint>
 

Modified: geronimo/sandbox/jbohn/daytrader-bp-new/modules/persist-jdbc/src/main/java/org/apache/geronimo/samples/daytrader/persist/jdbc/TradeJDBCDirect.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/jbohn/daytrader-bp-new/modules/persist-jdbc/src/main/java/org/apache/geronimo/samples/daytrader/persist/jdbc/TradeJDBCDirect.java?rev=835963&r1=835962&r2=835963&view=diff
==============================================================================
--- geronimo/sandbox/jbohn/daytrader-bp-new/modules/persist-jdbc/src/main/java/org/apache/geronimo/samples/daytrader/persist/jdbc/TradeJDBCDirect.java
(original)
+++ geronimo/sandbox/jbohn/daytrader-bp-new/modules/persist-jdbc/src/main/java/org/apache/geronimo/samples/daytrader/persist/jdbc/TradeJDBCDirect.java
Fri Nov 13 19:30:51 2009
@@ -27,7 +27,6 @@
 import org.apache.geronimo.samples.daytrader.core.spi.FinancialUtils;
 import org.apache.geronimo.samples.daytrader.core.spi.MarketSummaryDataBean;
 import org.apache.geronimo.samples.daytrader.core.spi.RunStatsDataBean;
-import org.apache.geronimo.samples.daytrader.core.spi.TradeDBServices;
 import org.apache.geronimo.samples.daytrader.core.spi.TradeServices;
 import org.apache.geronimo.samples.daytrader.util.*;
 
@@ -58,7 +57,7 @@
  * 
  */
 
-public class TradeJDBCDirect implements TradeServices, TradeDBServices {
+public class TradeJDBCDirect implements TradeServices {
 
     private static String dsName = TradeConfig.DATASOURCE;
 

Modified: geronimo/sandbox/jbohn/daytrader-bp-new/modules/persist-jdbc/src/main/resources/OSGI-INF/blueprint/blueprint.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/jbohn/daytrader-bp-new/modules/persist-jdbc/src/main/resources/OSGI-INF/blueprint/blueprint.xml?rev=835963&r1=835962&r2=835963&view=diff
==============================================================================
--- geronimo/sandbox/jbohn/daytrader-bp-new/modules/persist-jdbc/src/main/resources/OSGI-INF/blueprint/blueprint.xml
(original)
+++ geronimo/sandbox/jbohn/daytrader-bp-new/modules/persist-jdbc/src/main/resources/OSGI-INF/blueprint/blueprint.xml
Fri Nov 13 19:30:51 2009
@@ -10,11 +10,5 @@
       </service-properties>
   </service>
 
-  <service id="tradeDBServicesJDBC" ref="tradeServicesBeanJDBC" interface="org.apache.geronimo.samples.daytrader.core.spi.TradeDBServices">
-      <service-properties>
-          <entry key="mode" value="jdbc"/>
-      </service-properties>
-  </service>
-
 </blueprint>
 

Modified: geronimo/sandbox/jbohn/daytrader-bp-new/modules/persist-jpa/src/main/java/org/apache/geronimo/samples/daytrader/persist/jpa/TradeJPADirect.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/jbohn/daytrader-bp-new/modules/persist-jpa/src/main/java/org/apache/geronimo/samples/daytrader/persist/jpa/TradeJPADirect.java?rev=835963&r1=835962&r2=835963&view=diff
==============================================================================
--- geronimo/sandbox/jbohn/daytrader-bp-new/modules/persist-jpa/src/main/java/org/apache/geronimo/samples/daytrader/persist/jpa/TradeJPADirect.java
(original)
+++ geronimo/sandbox/jbohn/daytrader-bp-new/modules/persist-jpa/src/main/java/org/apache/geronimo/samples/daytrader/persist/jpa/TradeJPADirect.java
Fri Nov 13 19:30:51 2009
@@ -34,7 +34,6 @@
 import org.apache.geronimo.samples.daytrader.core.spi.FinancialUtils;
 import org.apache.geronimo.samples.daytrader.core.spi.MarketSummaryDataBean;
 import org.apache.geronimo.samples.daytrader.core.spi.RunStatsDataBean;
-import org.apache.geronimo.samples.daytrader.core.spi.TradeDBServices;
 import org.apache.geronimo.samples.daytrader.core.spi.TradeServices;
 import org.apache.geronimo.samples.daytrader.persist.jdbc.TradeJDBCDirect;
 import org.apache.geronimo.samples.daytrader.util.Log;
@@ -55,7 +54,7 @@
  * 
  */
 
-public class TradeJPADirect implements TradeServices, TradeDBServices {
+public class TradeJPADirect implements TradeServices {
 
     private EntityManager entityManager;
 

Modified: geronimo/sandbox/jbohn/daytrader-bp-new/modules/persist-jpa/src/main/resources/OSGI-INF/blueprint/blueprint.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/jbohn/daytrader-bp-new/modules/persist-jpa/src/main/resources/OSGI-INF/blueprint/blueprint.xml?rev=835963&r1=835962&r2=835963&view=diff
==============================================================================
--- geronimo/sandbox/jbohn/daytrader-bp-new/modules/persist-jpa/src/main/resources/OSGI-INF/blueprint/blueprint.xml
(original)
+++ geronimo/sandbox/jbohn/daytrader-bp-new/modules/persist-jpa/src/main/resources/OSGI-INF/blueprint/blueprint.xml
Fri Nov 13 19:30:51 2009
@@ -9,11 +9,5 @@
       </service-properties>
   </service>
 
-  <service id="tradeDBServicesJPA" ref="tradeServicesBeanJPA" interface="org.apache.geronimo.samples.daytrader.core.spi.TradeDBServices">
-      <service-properties>
-          <entry key="mode" value="jpa"/>
-      </service-properties>
-  </service>
-
 </blueprint>
 

Modified: geronimo/sandbox/jbohn/daytrader-bp-new/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeBuildDB.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/jbohn/daytrader-bp-new/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeBuildDB.java?rev=835963&r1=835962&r2=835963&view=diff
==============================================================================
--- geronimo/sandbox/jbohn/daytrader-bp-new/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeBuildDB.java
(original)
+++ geronimo/sandbox/jbohn/daytrader-bp-new/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeBuildDB.java
Fri Nov 13 19:30:51 2009
@@ -24,7 +24,6 @@
 import java.util.ArrayList;
 
 import org.apache.geronimo.samples.daytrader.core.spi.TradeServices;
-import org.apache.geronimo.samples.daytrader.core.spi.TradeDBServices;
 import org.apache.geronimo.samples.daytrader.core.spi.TradeServicesManager;
 import org.apache.geronimo.samples.daytrader.core.spi.TradeServiceUtilities;
 import org.apache.geronimo.samples.daytrader.beans.*;
@@ -64,7 +63,6 @@
             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>"
@@ -79,7 +77,7 @@
 
             // Find out the Database being used
             try {
-                dbProductName = tradeDBServices.checkDBProductName();
+                dbProductName = tradeServices.checkDBProductName();
             } catch (Exception e) {
                 Log.error(e, "TradeBuildDB: Unable to check DB Product name");
             }
@@ -148,7 +146,7 @@
             // send the sql commands buffer to drop and recreate the Daytrader tables
             out.println("<BR>TradeBuildDB: **** Dropping and Recreating the DayTrader
tables... ****</BR>");
             try {
-                success = tradeDBServices.recreateDBTables(sqlBuffer, out);
+                success = tradeServices.recreateDBTables(sqlBuffer, out);
             } catch (Exception e) {
                 Log.error(e,
                     "TradeBuildDB: Unable to drop and recreate DayTrader Db Tables, "+



Mime
View raw message