incubator-aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jb...@apache.org
Subject svn commit: r934586 - in /incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules: ariestrader-api/src/main/java/org/apache/aries/samples/ariestrader/api/ ariestrader-core/src/main/java/org/apache/aries/samples/ariestrader/core/ ariestr...
Date Thu, 15 Apr 2010 20:37:15 GMT
Author: jbohn
Date: Thu Apr 15 20:37:14 2010
New Revision: 934586

URL: http://svn.apache.org/viewvc?rev=934586&view=rev
Log:
merge 934501 from trunk to branch - ARIES-284 AriesTrader - clean up mode processing

Modified:
    incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-api/src/main/java/org/apache/aries/samples/ariestrader/api/TradeServices.java
    incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-api/src/main/java/org/apache/aries/samples/ariestrader/api/TradeServicesManager.java
    incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-core/src/main/java/org/apache/aries/samples/ariestrader/core/TradeServicesManagerImpl.java
    incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-core/src/main/resources/OSGI-INF/blueprint/blueprint.xml
    incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-derby-ds/pom.xml
    incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-persist-jdbc/src/main/java/org/apache/aries/samples/ariestrader/persist/jdbc/TradeJdbc.java
    incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-persist-jdbc/src/main/resources/OSGI-INF/blueprint/blueprint.xml
    incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-persist-jpa-am/src/main/java/org/apache/aries/samples/ariestrader/persist/jpa/am/TradeJpaAm.java
    incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-persist-jpa-am/src/main/resources/OSGI-INF/blueprint/blueprint.xml
    incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-persist-jpa-cm/src/main/java/org/apache/aries/samples/ariestrader/persist/jpa/cm/TradeJpaCm.java
    incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-persist-jpa-cm/src/main/resources/OSGI-INF/blueprint/blueprint.xml
    incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-util/src/main/java/org/apache/aries/samples/ariestrader/util/TradeConfig.java
    incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/TradeConfigServlet.java
    incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingJDBCRead.java
    incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingJDBCWrite.java
    incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-web/src/main/resources/config.jsp

Modified: incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-api/src/main/java/org/apache/aries/samples/ariestrader/api/TradeServices.java
URL: http://svn.apache.org/viewvc/incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-api/src/main/java/org/apache/aries/samples/ariestrader/api/TradeServices.java?rev=934586&r1=934585&r2=934586&view=diff
==============================================================================
--- incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-api/src/main/java/org/apache/aries/samples/ariestrader/api/TradeServices.java
(original)
+++ incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-api/src/main/java/org/apache/aries/samples/ariestrader/api/TradeServices.java
Thu Apr 15 20:37:14 2010
@@ -28,6 +28,7 @@ import org.apache.aries.samples.ariestra
 import org.apache.aries.samples.ariestrader.api.persistence.MarketSummaryDataBean;
 import org.apache.aries.samples.ariestrader.api.persistence.OrderDataBean;
 import org.apache.aries.samples.ariestrader.api.persistence.QuoteDataBean;
+import org.apache.aries.samples.ariestrader.util.TradeConfig;
 
 /**
   * TradeServices interface specifies the business methods provided by the Trade online broker
application.
@@ -276,9 +277,9 @@ public interface TradeServices extends R
     * Get mode - returns the persistence mode
     * (TradeConfig.JDBC, JPA, etc...)
     *
-    * @return int mode
+    * @return TradeConfig.ModeType
     */
-    public int getMode();
+    public TradeConfig.ModeType getMode();
 
 }   
 

Modified: incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-api/src/main/java/org/apache/aries/samples/ariestrader/api/TradeServicesManager.java
URL: http://svn.apache.org/viewvc/incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-api/src/main/java/org/apache/aries/samples/ariestrader/api/TradeServicesManager.java?rev=934586&r1=934585&r2=934586&view=diff
==============================================================================
--- incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-api/src/main/java/org/apache/aries/samples/ariestrader/api/TradeServicesManager.java
(original)
+++ incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-api/src/main/java/org/apache/aries/samples/ariestrader/api/TradeServicesManager.java
Thu Apr 15 20:37:14 2010
@@ -36,12 +36,6 @@ public interface TradeServicesManager {
     public ArrayList<Integer> getCurrentModes();
 
     /**
-      * Set TradeServicesList reference
-      */
-    public void setTradeServicesList(List tradeList);
-
-
-    /**
       * Get the currently selected TradeServices
       */
     public TradeServices getTradeServices();

Modified: incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-core/src/main/java/org/apache/aries/samples/ariestrader/core/TradeServicesManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-core/src/main/java/org/apache/aries/samples/ariestrader/core/TradeServicesManagerImpl.java?rev=934586&r1=934585&r2=934586&view=diff
==============================================================================
--- incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-core/src/main/java/org/apache/aries/samples/ariestrader/core/TradeServicesManagerImpl.java
(original)
+++ incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-core/src/main/java/org/apache/aries/samples/ariestrader/core/TradeServicesManagerImpl.java
Thu Apr 15 20:37:14 2010
@@ -74,32 +74,19 @@ public class TradeServicesManagerImpl im
         for (int i=0; i<tradeServicesList.length; i++) {
             TradeServices tradeServicesRef = tradeServicesList[i];
             if (tradeServicesRef != null) {
-                modes.add(tradeServicesRef.getMode());
+                modes.add(i);
             }
         }
         return modes;
     }
 
     /**
-      * Set TradeServicesList reference
-      */
-    public void setTradeServicesList(List tradeList) {
-        if (Log.doTrace())
-            Log.trace("TradeServicesManagerImpl:setTradeServicesList()" , tradeList);
-        Iterator it = tradeList.iterator();
-        while (it.hasNext()) {  
-            TradeServices tradeServices =  (TradeServices) it.next(); 
-            this.tradeServicesList[tradeServices.getMode()] = tradeServices;
-        }  
-    }
-
-    /**
       * Get TradeServices reference
       */
     public TradeServices getTradeServices() {
         if (Log.doTrace()) 
             Log.trace("TradeServicesManagerImpl:getTradeServices()");
-        return tradeServicesList[TradeConfig.runTimeMode];
+        return tradeServicesList[TradeConfig.getRunTimeMode().ordinal()];
     }
 
     /**
@@ -109,7 +96,8 @@ public class TradeServicesManagerImpl im
         if (Log.doTrace())
             Log.trace("TradeServicesManagerImpl:bindService()", tradeServices, props);
         if (tradeServices != null) {
-            tradeServicesList[tradeServices.getMode()] = tradeServices;
+            String mode = (String) props.get("mode");
+            tradeServicesList[Enum.valueOf(TradeConfig.ModeType.class, mode).ordinal()] =
tradeServices;
         }
     }
 
@@ -120,7 +108,8 @@ public class TradeServicesManagerImpl im
         if (Log.doTrace())
             Log.trace("TradeServicesManagerImpl:unbindService()", tradeServices, props);
         if (tradeServices != null) {
-            tradeServicesList[tradeServices.getMode()] = null;
+            String mode = (String) props.get("mode");
+            tradeServicesList[Enum.valueOf(TradeConfig.ModeType.class, mode).ordinal()] =
null;
         }
     }
 
@@ -200,7 +189,7 @@ public class TradeServicesManagerImpl im
             Log.trace("TradeAction:getMarketSummaryInternal()");
         }
         MarketSummaryDataBean marketSummaryData = null;
-        marketSummaryData = tradeServicesList[TradeConfig.runTimeMode].getMarketSummary();
+        marketSummaryData = tradeServicesList[TradeConfig.getRunTimeMode().ordinal()].getMarketSummary();
         return marketSummaryData;
     }
 

Modified: incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-core/src/main/resources/OSGI-INF/blueprint/blueprint.xml
URL: http://svn.apache.org/viewvc/incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-core/src/main/resources/OSGI-INF/blueprint/blueprint.xml?rev=934586&r1=934585&r2=934586&view=diff
==============================================================================
--- incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-core/src/main/resources/OSGI-INF/blueprint/blueprint.xml
(original)
+++ incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-core/src/main/resources/OSGI-INF/blueprint/blueprint.xml
Thu Apr 15 20:37:14 2010
@@ -17,13 +17,12 @@
     limitations under the License.
 
 -->
-<blueprint  default-activation="lazy" 
+<blueprint  default-activation="lazy"  
             xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0">
 
   <bean id="tradeServicesManagerBean" class="org.apache.aries.samples.ariestrader.core.TradeServicesManagerImpl"
init-method="init">
-      <property name="tradeServicesList" ref="tradeServicesList"/>
   </bean>
 
   <service id="TradeServicesManager" ref="tradeServicesManagerBean" interface="org.apache.aries.samples.ariestrader.api.TradeServicesManager"/>
@@ -34,7 +33,7 @@
   <service id="TradeDBManager" ref="tradeDBManagerBean" interface="org.apache.aries.samples.ariestrader.api.TradeDBManager">
   </service>
 
-  <reference-list id="tradeServicesList" availability="optional" interface="org.apache.aries.samples.ariestrader.api.TradeServices">
+  <reference-list id="tradeServicesList" availability="optional" activation="eager" interface="org.apache.aries.samples.ariestrader.api.TradeServices">
       <reference-listener ref="tradeServicesManagerBean" bind-method="bindService" unbind-method="unbindService"
/>
   </reference-list>
 

Modified: incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-derby-ds/pom.xml
URL: http://svn.apache.org/viewvc/incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-derby-ds/pom.xml?rev=934586&r1=934585&r2=934586&view=diff
==============================================================================
--- incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-derby-ds/pom.xml
(original)
+++ incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-derby-ds/pom.xml
Thu Apr 15 20:37:14 2010
@@ -34,7 +34,6 @@
         <dependency>
             <groupId>org.apache.derby</groupId>
             <artifactId>derby</artifactId>
-            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.aries.transaction</groupId>

Modified: incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-persist-jdbc/src/main/java/org/apache/aries/samples/ariestrader/persist/jdbc/TradeJdbc.java
URL: http://svn.apache.org/viewvc/incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-persist-jdbc/src/main/java/org/apache/aries/samples/ariestrader/persist/jdbc/TradeJdbc.java?rev=934586&r1=934585&r2=934586&view=diff
==============================================================================
--- incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-persist-jdbc/src/main/java/org/apache/aries/samples/ariestrader/persist/jdbc/TradeJdbc.java
(original)
+++ incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-persist-jdbc/src/main/java/org/apache/aries/samples/ariestrader/persist/jdbc/TradeJdbc.java
Thu Apr 15 20:37:14 2010
@@ -1601,10 +1601,10 @@ public class TradeJdbc implements TradeS
     /**
      * Get mode - returns the persistence mode (TradeConfig.JDBC)
      * 
-     * @return int mode
+     * @return TradeConfig.ModeType
      */
-    public int getMode() {
-        return TradeConfig.JDBC;
+    public TradeConfig.ModeType getMode() {
+        return TradeConfig.ModeType.JDBC;
     }
 
 }

Modified: incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-persist-jdbc/src/main/resources/OSGI-INF/blueprint/blueprint.xml
URL: http://svn.apache.org/viewvc/incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-persist-jdbc/src/main/resources/OSGI-INF/blueprint/blueprint.xml?rev=934586&r1=934585&r2=934586&view=diff
==============================================================================
--- incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-persist-jdbc/src/main/resources/OSGI-INF/blueprint/blueprint.xml
(original)
+++ incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-persist-jdbc/src/main/resources/OSGI-INF/blueprint/blueprint.xml
Thu Apr 15 20:37:14 2010
@@ -17,7 +17,7 @@
     limitations under the License.
 
 -->
-<blueprint  default-activation="lazy" 
+<blueprint  default-activation="lazy"  
             xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0">
@@ -28,7 +28,7 @@
 
   <service id="tradeServicesJDBC" ref="tradeServicesBeanJDBC" interface="org.apache.aries.samples.ariestrader.api.TradeServices">
       <service-properties>
-          <entry key="mode" value="jdbc"/>
+          <entry key="mode" value="JDBC"/>
       </service-properties>
   </service>
 

Modified: incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-persist-jpa-am/src/main/java/org/apache/aries/samples/ariestrader/persist/jpa/am/TradeJpaAm.java
URL: http://svn.apache.org/viewvc/incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-persist-jpa-am/src/main/java/org/apache/aries/samples/ariestrader/persist/jpa/am/TradeJpaAm.java?rev=934586&r1=934585&r2=934586&view=diff
==============================================================================
--- incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-persist-jpa-am/src/main/java/org/apache/aries/samples/ariestrader/persist/jpa/am/TradeJpaAm.java
(original)
+++ incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-persist-jpa-am/src/main/java/org/apache/aries/samples/ariestrader/persist/jpa/am/TradeJpaAm.java
Thu Apr 15 20:37:14 2010
@@ -968,10 +968,10 @@ public class TradeJpaAm implements Trade
     /**
      * Get mode - returns the persistence mode (TradeConfig.JPA)
      * 
-     * @return int mode
+     * @return TradeConfig.ModeType
      */
-    public int getMode() {
-        return TradeConfig.JPA_AM;
+    public TradeConfig.ModeType getMode() {
+        return TradeConfig.ModeType.JPA_AM;
     }
 
 }

Modified: incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-persist-jpa-am/src/main/resources/OSGI-INF/blueprint/blueprint.xml
URL: http://svn.apache.org/viewvc/incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-persist-jpa-am/src/main/resources/OSGI-INF/blueprint/blueprint.xml?rev=934586&r1=934585&r2=934586&view=diff
==============================================================================
--- incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-persist-jpa-am/src/main/resources/OSGI-INF/blueprint/blueprint.xml
(original)
+++ incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-persist-jpa-am/src/main/resources/OSGI-INF/blueprint/blueprint.xml
Thu Apr 15 20:37:14 2010
@@ -29,7 +29,7 @@
   
   <service id="tradeServicesJPA-AM" ref="tradeServicesBeanJPA-AM" interface="org.apache.aries.samples.ariestrader.api.TradeServices">
       <service-properties>
-          <entry key="mode" value="jpa-am"/>
+          <entry key="mode" value="JPA_AM"/>
       </service-properties>
   </service>
 

Modified: incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-persist-jpa-cm/src/main/java/org/apache/aries/samples/ariestrader/persist/jpa/cm/TradeJpaCm.java
URL: http://svn.apache.org/viewvc/incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-persist-jpa-cm/src/main/java/org/apache/aries/samples/ariestrader/persist/jpa/cm/TradeJpaCm.java?rev=934586&r1=934585&r2=934586&view=diff
==============================================================================
--- incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-persist-jpa-cm/src/main/java/org/apache/aries/samples/ariestrader/persist/jpa/cm/TradeJpaCm.java
(original)
+++ incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-persist-jpa-cm/src/main/java/org/apache/aries/samples/ariestrader/persist/jpa/cm/TradeJpaCm.java
Thu Apr 15 20:37:14 2010
@@ -755,10 +755,10 @@ public class TradeJpaCm implements Trade
     /**
      * Get mode - returns the persistence mode (TradeConfig.JPA)
      * 
-     * @return int mode
+     * @return TradeConfig.ModeType
      */
-    public int getMode() {
-        return TradeConfig.JPA_CM;
+    public TradeConfig.ModeType getMode() {
+        return TradeConfig.ModeType.JPA_CM;
     }
 
 }

Modified: incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-persist-jpa-cm/src/main/resources/OSGI-INF/blueprint/blueprint.xml
URL: http://svn.apache.org/viewvc/incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-persist-jpa-cm/src/main/resources/OSGI-INF/blueprint/blueprint.xml?rev=934586&r1=934585&r2=934586&view=diff
==============================================================================
--- incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-persist-jpa-cm/src/main/resources/OSGI-INF/blueprint/blueprint.xml
(original)
+++ incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-persist-jpa-cm/src/main/resources/OSGI-INF/blueprint/blueprint.xml
Thu Apr 15 20:37:14 2010
@@ -31,7 +31,7 @@
   
   <service id="tradeServicesJPA-CM" ref="tradeServicesBeanJPA-CM" interface="org.apache.aries.samples.ariestrader.api.TradeServices">
       <service-properties>
-          <entry key="mode" value="jpa-cm"/>
+          <entry key="mode" value="JPA_CM"/>
       </service-properties>
   </service>
 

Modified: incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-util/src/main/java/org/apache/aries/samples/ariestrader/util/TradeConfig.java
URL: http://svn.apache.org/viewvc/incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-util/src/main/java/org/apache/aries/samples/ariestrader/util/TradeConfig.java?rev=934586&r1=934585&r2=934586&view=diff
==============================================================================
--- incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-util/src/main/java/org/apache/aries/samples/ariestrader/util/TradeConfig.java
(original)
+++ incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-util/src/main/java/org/apache/aries/samples/ariestrader/util/TradeConfig.java
Thu Apr 15 20:37:14 2010
@@ -32,19 +32,11 @@ public class TradeConfig {
 	/* Trade Runtime Configuration Parameters */
 
 	/* Trade Runtime Mode parameters */
-    public static String[] runTimeModeNames = { "Full EJB3", 
-                                                "Direct (JDBC)", 
-                                                "Session (EJB3) To Direct", 
-                                                "JDBC", 
+    public static String[] runTimeModeNames = { "JDBC", 
                                                 "JPA App Managed",
                                                 "JPA Container Managed"};
-    public static final int EJB3 = 0;
-    public static final int DIRECT = 1;
-    public static final int SESSION3 = 2;
-    public static final int JDBC = 3;
-    public static final int JPA_AM = 4;
-    public static final int JPA_CM = 5;
-    public static int runTimeMode = JDBC;
+    public static enum ModeType{JDBC,JPA_AM,JPA_CM}
+    public static ModeType runTimeMode = ModeType.JDBC;
 	
     /* Trade JPA Layer parameters */
 	public static String[] jpaLayerNames = {"OpenJPA", "Hibernate"};
@@ -501,7 +493,7 @@ public class TradeConfig {
 			try {
 				for (int i = 0; i < runTimeModeNames.length; i++) {
 					if (value.equalsIgnoreCase(runTimeModeNames[i])) {
-						setRunTimeMode(i);
+						setRunTimeMode(ModeType.values()[i]);
 						break;
 					}
 				}
@@ -511,7 +503,7 @@ public class TradeConfig {
 						+ "trying to set runtimemode to "
 						+ value
 						+ "reverting to current value: "
-						+ runTimeModeNames[getRunTimeMode()],
+						+ runTimeModeNames[getRunTimeMode().ordinal()],
 					e);
 			} // If the value is bad, simply revert to current
 		} else if (parm.equalsIgnoreCase("orderProcessingMode")) {
@@ -840,11 +832,11 @@ public class TradeConfig {
 		accessMode = value;
 	}
 
-    public static int getRunTimeMode() {
+    public static ModeType getRunTimeMode() {
         return runTimeMode;
     }
     
-    public static void setRunTimeMode(int value) {
+    public static void setRunTimeMode(ModeType value) {
         runTimeMode = value;
     }
 

Modified: incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/TradeConfigServlet.java
URL: http://svn.apache.org/viewvc/incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/TradeConfigServlet.java?rev=934586&r1=934585&r2=934586&view=diff
==============================================================================
--- incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/TradeConfigServlet.java
(original)
+++ incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/TradeConfigServlet.java
Thu Apr 15 20:37:14 2010
@@ -118,7 +118,7 @@ public class TradeConfigServlet extends 
 				int i = Integer.parseInt(runTimeModeStr);
 				if ((i >= 0) && (i < TradeConfig.runTimeModeNames.length)) //Input validation
                                 {
-                                    TradeConfig.setRunTimeMode(i);
+                                    TradeConfig.setRunTimeMode(TradeConfig.ModeType.values()[i]);
                                 }
 			}
 			catch (Exception e)
@@ -131,7 +131,7 @@ public class TradeConfigServlet extends 
 
 			} // If the value is bad, simply revert to current
 		}
-		currentConfigStr += "\t\tRunTimeMode:\t\t" + TradeConfig.runTimeModeNames[TradeConfig.getRunTimeMode()]
+ "\n";
+		currentConfigStr += "\t\tRunTimeMode:\t\t" + TradeConfig.runTimeModeNames[TradeConfig.getRunTimeMode().ordinal()]
+ "\n";
 		
 		/* Add JPA layer choice to avoid some ugly Hibernate bugs */
 		String jpaLayerStr = req.getParameter("JPALayer");

Modified: incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingJDBCRead.java
URL: http://svn.apache.org/viewvc/incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingJDBCRead.java?rev=934586&r1=934585&r2=934586&view=diff
==============================================================================
--- incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingJDBCRead.java
(original)
+++ incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingJDBCRead.java
Thu Apr 15 20:37:14 2010
@@ -66,7 +66,7 @@ public class PingJDBCRead extends HttpSe
 		try
 			{
 			//TradeJdbc (via TradeServices) uses prepared statements so I am going to make use of
it's code.
-                        TradeServices tradeServices = TradeServiceUtilities.getTradeServices("(mode=jdbc)");
+                        TradeServices tradeServices = TradeServiceUtilities.getTradeServices("(mode=JDBC)");
 			symbol = TradeConfig.rndSymbol();
 			
 			QuoteDataBean quoteData = null;

Modified: incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingJDBCWrite.java
URL: http://svn.apache.org/viewvc/incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingJDBCWrite.java?rev=934586&r1=934585&r2=934586&view=diff
==============================================================================
--- incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingJDBCWrite.java
(original)
+++ incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-web/src/main/java/org/apache/aries/samples/ariestrader/web/prims/PingJDBCWrite.java
Thu Apr 15 20:37:14 2010
@@ -62,7 +62,7 @@ public void doGet(HttpServletRequest req
 		newPrice = TradeConfig.getRandomPriceChangeFactor();
 
 		//TradeJdbc via TradeServices makes use of prepared statements so I am going to reuse the
existing code.
-                TradeServices tradeServices = TradeServiceUtilities.getTradeServices("(mode=jdbc)");
+                TradeServices tradeServices = TradeServiceUtilities.getTradeServices("(mode=JDBC)");
 
 		//update the price of our symbol
 		QuoteDataBean quoteData = null;

Modified: incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-web/src/main/resources/config.jsp
URL: http://svn.apache.org/viewvc/incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-web/src/main/resources/config.jsp?rev=934586&r1=934585&r2=934586&view=diff
==============================================================================
--- incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-web/src/main/resources/config.jsp
(original)
+++ incubator/aries/branches/0.1-incubating-RC1/samples/ariestrader/modules/ariestrader-web/src/main/resources/config.jsp
Thu Apr 15 20:37:14 2010
@@ -104,7 +104,7 @@ if (status != null) {
                 ArrayList activeModes = tradeServicesManager.getCurrentModes();
                 configParm = "RunTimeMode";
                 names = TradeConfig.runTimeModeNames;
-                index = TradeConfig.runTimeMode;
+                index = TradeConfig.getRunTimeMode().ordinal();
                 for (int i = 0; i < activeModes.size(); i++) {
                     out.print("<INPUT type=\"radio\" name=\""
                              + configParm



Mime
View raw message